1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2024-09-16 05:30:09 +00:00
MpcNET/LibMpcApp/Program.cs

43 lines
1.0 KiB
C#
Raw Normal View History

2016-12-02 14:19:18 +00:00
using System;
using System.Net;
using System.Threading.Tasks;
using LibMpc;
namespace LibMpcApp
{
public class Program
{
public static void Main(string[] args)
{
var mpc = new Mpc(new IPEndPoint(IPAddress.Loopback, 6600));
var connected = mpc.ConnectAsync().GetAwaiter().GetResult();
if (connected)
{
Console.WriteLine("Connected to MPD.");
2016-12-02 14:19:18 +00:00
StartReadCommands(mpc);
}
else
{
Console.WriteLine("Could not connect to MPD.");
2016-12-02 14:19:18 +00:00
}
mpc.DisconnectAsync().GetAwaiter().GetResult();
2016-12-02 14:19:18 +00:00
}
private static void StartReadCommands(Mpc mpc)
{
while(true)
{
Console.Write("Command: ");
var command = Console.ReadLine();
if (string.IsNullOrEmpty(command))
{
break;
}
}
2016-12-02 14:19:18 +00:00
}
}
}