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

Type-safe commands for Audio output devices (partial implemented).

This commit is contained in:
glucaci 2016-12-01 17:52:00 +01:00
parent c1f763a9db
commit 1713c707f7
2 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,66 @@
namespace LibMpc
{
public partial class Commands
{
/// <summary>
/// https://www.musicpd.org/doc/protocol/output_commands.html
/// </summary>
public class Output
{
/// <summary>
/// Turns an output off.
/// </summary>
public class DisableOutput : IMpcCommand
{
private readonly int _outputId;
public DisableOutput(int outputId)
{
_outputId = outputId;
}
public string Value => string.Join(" ", "disableoutput", _outputId);
public object ParseResponse(object response)
{
throw new System.NotImplementedException();
}
}
/// <summary>
/// Turns an output on.
/// </summary>
public class EnableOutput : IMpcCommand
{
private readonly int _outputId;
public EnableOutput(int outputId)
{
_outputId = outputId;
}
public string Value => string.Join(" ", "enableoutput", _outputId);
public object ParseResponse(object response)
{
throw new System.NotImplementedException();
}
}
// TODO: toggleoutput // Turns an output on or off, depending on the current state.
/// <summary>
/// Shows information about all outputs.
/// </summary>
public class Outputs : IMpcCommand
{
public string Value => "outputs";
public object ParseResponse(object response)
{
throw new System.NotImplementedException();
}
}
}
}
}

View File

@ -0,0 +1,10 @@
namespace LibMpc
{
public interface IMpcCommand
{
string Value { get; }
// TODO: Return IMpdResponse and create type-safe input.
object ParseResponse(object response);
}
}