From 6b72534a7a273716a001189960a3c534152d2cc6 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 2 Dec 2016 15:41:52 +0100 Subject: [PATCH] Connect and disconnect from mpd in test app implemented. --- LibMpcApp/Program.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/LibMpcApp/Program.cs b/LibMpcApp/Program.cs index eba6300..4cdf2b2 100644 --- a/LibMpcApp/Program.cs +++ b/LibMpcApp/Program.cs @@ -14,17 +14,29 @@ namespace LibMpcApp var connected = mpc.ConnectAsync().GetAwaiter().GetResult(); if (connected) { + Console.WriteLine("Connected to MPD."); StartReadCommands(mpc); } 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) { - + while(true) + { + Console.Write("Command: "); + var command = Console.ReadLine(); + + if (string.IsNullOrEmpty(command)) + { + break; + } + } } } }