mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-07-01 16:47:37 +00:00
ConsoleApp removed => Unit Test instead.
This commit is contained in:
@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>ff176ad5-d6da-41ee-b27d-1dbef0ce462f</ProjectGuid>
|
||||
<RootNamespace>LibMpcApp</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
@ -1,88 +0,0 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using LibMpc;
|
||||
|
||||
namespace LibMpcApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Simple console app to test commands and parsed responses.
|
||||
/// </summary>
|
||||
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.");
|
||||
StartReadCommands(mpc);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Could not connect to MPD.");
|
||||
}
|
||||
|
||||
mpc.DisconnectAsync().GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
private static void StartReadCommands(Mpc mpc)
|
||||
{
|
||||
int userInput = 0;
|
||||
while ((userInput = DisplayMenu()) != 99)
|
||||
{
|
||||
var response = new object();
|
||||
|
||||
switch (userInput)
|
||||
{
|
||||
case 11:
|
||||
response = mpc.SendAsync(new Commands.Output.DisableOutput(0)).GetAwaiter().GetResult();
|
||||
break;
|
||||
case 12:
|
||||
response = mpc.SendAsync(new Commands.Output.EnableOutput(0)).GetAwaiter().GetResult();
|
||||
break;
|
||||
case 13:
|
||||
response = mpc.SendAsync(new Commands.Output.Outputs()).GetAwaiter().GetResult();
|
||||
break;
|
||||
|
||||
case 24:
|
||||
response = mpc.SendAsync(new Commands.Reflection.TagTypes()).GetAwaiter().GetResult();
|
||||
break;
|
||||
|
||||
case 313:
|
||||
response = mpc.SendAsync(new Commands.Database.Update()).GetAwaiter().GetResult();
|
||||
break;
|
||||
}
|
||||
|
||||
Console.WriteLine("Response: ");
|
||||
Console.WriteLine(response);
|
||||
}
|
||||
}
|
||||
|
||||
static public int DisplayMenu()
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Commands: ");
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("11. disableoutput 0");
|
||||
Console.WriteLine("12. enableoutput 0");
|
||||
Console.WriteLine("13. outputs");
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Reflection");
|
||||
Console.WriteLine("24. tagtypes");
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Database");
|
||||
Console.WriteLine("313. update");
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("99. Exit");
|
||||
Console.WriteLine();
|
||||
var result = Console.ReadLine();
|
||||
return Convert.ToInt32(result);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Windows User")]
|
||||
[assembly: AssemblyProduct("LibMpcApp")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("ff176ad5-d6da-41ee-b27d-1dbef0ce462f")]
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"LibMpc": "1.0.0-*",
|
||||
"Microsoft.NETCore.App": {
|
||||
"type": "platform",
|
||||
"version": "1.0.1"
|
||||
}
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user