mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
Type-safe commands for Audio output devices (partial implemented).
This commit is contained in:
parent
c1f763a9db
commit
1713c707f7
66
LibMpc/Commands/Commands.Output.cs
Normal file
66
LibMpc/Commands/Commands.Output.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
LibMpc/Commands/IMpcCommand.cs
Normal file
10
LibMpc/Commands/IMpcCommand.cs
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user