mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
Connect and disconnect from mpd in test app implemented.
This commit is contained in:
parent
483f6740e0
commit
6b72534a7a
@ -14,17 +14,29 @@ namespace LibMpcApp
|
|||||||
var connected = mpc.ConnectAsync().GetAwaiter().GetResult();
|
var connected = mpc.ConnectAsync().GetAwaiter().GetResult();
|
||||||
if (connected)
|
if (connected)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("Connected to MPD.");
|
||||||
StartReadCommands(mpc);
|
StartReadCommands(mpc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("Could not connect to MPD");
|
Console.WriteLine("Could not connect to MPD.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mpc.DisconnectAsync().GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void StartReadCommands(Mpc mpc)
|
private static void StartReadCommands(Mpc mpc)
|
||||||
{
|
{
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
Console.Write("Command: ");
|
||||||
|
var command = Console.ReadLine();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(command))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user