mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
Fixed pause command
This commit is contained in:
parent
393df7ca9a
commit
19f0f92747
@ -11,7 +11,7 @@
|
|||||||
"MSTest.TestAdapter": "1.3.0",
|
"MSTest.TestAdapter": "1.3.0",
|
||||||
"MSTest.TestFramework": "1.3.0",
|
"MSTest.TestFramework": "1.3.0",
|
||||||
"Microsoft.NET.Test.Sdk": "15.7.2",
|
"Microsoft.NET.Test.Sdk": "15.7.2",
|
||||||
"MpcNET.SundewFork": "0.0.1-pre005"
|
"MpcNET.SundewFork": "0.0.1-pre007"
|
||||||
},
|
},
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"MpcNET.Test.dll": {}
|
"MpcNET.Test.dll": {}
|
||||||
@ -989,7 +989,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"MpcNET.SundewFork/0.0.1-pre005": {
|
"MpcNET.SundewFork/0.0.1-pre007": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Newtonsoft.Json": "11.0.2",
|
"Newtonsoft.Json": "11.0.2",
|
||||||
"Sundew.Base": "3.2.0-pre024",
|
"Sundew.Base": "3.2.0-pre024",
|
||||||
@ -1504,7 +1504,7 @@
|
|||||||
"path": "system.xml.xpath.xmldocument/4.0.1",
|
"path": "system.xml.xpath.xmldocument/4.0.1",
|
||||||
"hashPath": "system.xml.xpath.xmldocument.4.0.1.nupkg.sha512"
|
"hashPath": "system.xml.xpath.xmldocument.4.0.1.nupkg.sha512"
|
||||||
},
|
},
|
||||||
"MpcNET.SundewFork/0.0.1-pre005": {
|
"MpcNET.SundewFork/0.0.1-pre007": {
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"serviceable": false,
|
"serviceable": false,
|
||||||
"sha512": ""
|
"sha512": ""
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -253,6 +253,40 @@
|
|||||||
The deserialized response.
|
The deserialized response.
|
||||||
</returns>
|
</returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:MpcNET.Commands.Playback.PauseResumeCommand">
|
||||||
|
<summary>
|
||||||
|
Command to pause or resume.
|
||||||
|
https://www.musicpd.org/doc/protocol/playback_commands.html.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:MpcNET.Commands.Playback.PauseResumeCommand.#ctor(System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:MpcNET.Commands.Playback.PauseResumeCommand" /> class.
|
||||||
|
</summary>
|
||||||
|
<param name="pause">if set to <c>true</c> [pause].</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:MpcNET.Commands.Playback.PauseResumeCommand.#ctor">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:MpcNET.Commands.Playback.PauseResumeCommand"/> class.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:MpcNET.Commands.Playback.PauseResumeCommand.Serialize">
|
||||||
|
<summary>
|
||||||
|
Serializes the command.
|
||||||
|
</summary>
|
||||||
|
<returns>
|
||||||
|
The serialize command.
|
||||||
|
</returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:MpcNET.Commands.Playback.PauseResumeCommand.Deserialize(System.Collections.Generic.IReadOnlyList{System.Collections.Generic.KeyValuePair{System.String,System.String}})">
|
||||||
|
<summary>
|
||||||
|
Deserializes the specified response text pairs.
|
||||||
|
</summary>
|
||||||
|
<param name="response">The response.</param>
|
||||||
|
<returns>
|
||||||
|
The deserialized response.
|
||||||
|
</returns>
|
||||||
|
</member>
|
||||||
<member name="T:MpcNET.Commands.Playback.PlayCommand">
|
<member name="T:MpcNET.Commands.Playback.PlayCommand">
|
||||||
<summary>
|
<summary>
|
||||||
Command to start playback.
|
Command to start playback.
|
||||||
@ -311,29 +345,6 @@
|
|||||||
The deserialized response.
|
The deserialized response.
|
||||||
</returns>
|
</returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:MpcNET.Commands.Playback.PlayPauseCommand">
|
|
||||||
<summary>
|
|
||||||
Command to play or pause.
|
|
||||||
https://www.musicpd.org/doc/protocol/playback_commands.html.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:MpcNET.Commands.Playback.PlayPauseCommand.Serialize">
|
|
||||||
<summary>
|
|
||||||
Serializes the command.
|
|
||||||
</summary>
|
|
||||||
<returns>
|
|
||||||
The serialize command.
|
|
||||||
</returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:MpcNET.Commands.Playback.PlayPauseCommand.Deserialize(System.Collections.Generic.IReadOnlyList{System.Collections.Generic.KeyValuePair{System.String,System.String}})">
|
|
||||||
<summary>
|
|
||||||
Deserializes the specified response text pairs.
|
|
||||||
</summary>
|
|
||||||
<param name="response">The response.</param>
|
|
||||||
<returns>
|
|
||||||
The deserialized response.
|
|
||||||
</returns>
|
|
||||||
</member>
|
|
||||||
<member name="T:MpcNET.Commands.Playback.PreviousCommand">
|
<member name="T:MpcNET.Commands.Playback.PreviousCommand">
|
||||||
<summary>
|
<summary>
|
||||||
Command to goto previous song.
|
Command to goto previous song.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// --------------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------------
|
||||||
// <copyright file="PlayPauseCommand.cs" company="MpcNET">
|
// <copyright file="PauseResumeCommand.cs" company="MpcNET">
|
||||||
// Copyright (c) MpcNET. All rights reserved.
|
// Copyright (c) MpcNET. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
// </copyright>
|
// </copyright>
|
||||||
@ -9,18 +9,44 @@ namespace MpcNET.Commands.Playback
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Command to play or pause.
|
/// Command to pause or resume.
|
||||||
/// https://www.musicpd.org/doc/protocol/playback_commands.html.
|
/// https://www.musicpd.org/doc/protocol/playback_commands.html.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlayPauseCommand : IMpcCommand<string>
|
public class PauseResumeCommand : IMpcCommand<string>
|
||||||
{
|
{
|
||||||
|
private readonly string playArgument;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="PauseResumeCommand" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pause">if set to <c>true</c> [pause].</param>
|
||||||
|
public PauseResumeCommand(bool pause)
|
||||||
|
{
|
||||||
|
this.playArgument = pause ? "1" : "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="PauseResumeCommand"/> class.
|
||||||
|
/// </summary>
|
||||||
|
public PauseResumeCommand()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Serializes the command.
|
/// Serializes the command.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The serialize command.
|
/// The serialize command.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public string Serialize() => string.Join(" ", "pause");
|
public string Serialize()
|
||||||
|
{
|
||||||
|
if (this.playArgument == null)
|
||||||
|
{
|
||||||
|
return string.Join(" ", "pause");
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Join(" ", "pause", this.playArgument);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deserializes the specified response text pairs.
|
/// Deserializes the specified response text pairs.
|
@ -8,7 +8,7 @@
|
|||||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
||||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
|
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
|
||||||
<RootNamespace>MpcNET</RootNamespace>
|
<RootNamespace>MpcNET</RootNamespace>
|
||||||
<Version>0.0.1-pre005</Version>
|
<Version>0.0.1-pre007</Version>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<AssemblyVersion>0.0.1.0</AssemblyVersion>
|
<AssemblyVersion>0.0.1.0</AssemblyVersion>
|
||||||
<FileVersion>0.0.1.0</FileVersion>
|
<FileVersion>0.0.1.0</FileVersion>
|
||||||
|
Loading…
Reference in New Issue
Block a user