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

Fixed pause command

This commit is contained in:
Kim Hugener-Ohlsen 2018-10-27 14:47:40 +02:00
parent 393df7ca9a
commit 19f0f92747
6 changed files with 68 additions and 31 deletions

View File

@ -11,7 +11,7 @@
"MSTest.TestAdapter": "1.3.0",
"MSTest.TestFramework": "1.3.0",
"Microsoft.NET.Test.Sdk": "15.7.2",
"MpcNET.SundewFork": "0.0.1-pre005"
"MpcNET.SundewFork": "0.0.1-pre007"
},
"runtime": {
"MpcNET.Test.dll": {}
@ -989,7 +989,7 @@
}
}
},
"MpcNET.SundewFork/0.0.1-pre005": {
"MpcNET.SundewFork/0.0.1-pre007": {
"dependencies": {
"Newtonsoft.Json": "11.0.2",
"Sundew.Base": "3.2.0-pre024",
@ -1504,7 +1504,7 @@
"path": "system.xml.xpath.xmldocument/4.0.1",
"hashPath": "system.xml.xpath.xmldocument.4.0.1.nupkg.sha512"
},
"MpcNET.SundewFork/0.0.1-pre005": {
"MpcNET.SundewFork/0.0.1-pre007": {
"type": "project",
"serviceable": false,
"sha512": ""

View File

@ -253,6 +253,40 @@
The deserialized response.
</returns>
</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">
<summary>
Command to start playback.
@ -311,29 +345,6 @@
The deserialized response.
</returns>
</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">
<summary>
Command to goto previous song.

View File

@ -1,5 +1,5 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PlayPauseCommand.cs" company="MpcNET">
// <copyright file="PauseResumeCommand.cs" company="MpcNET">
// Copyright (c) MpcNET. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>
@ -9,18 +9,44 @@ namespace MpcNET.Commands.Playback
using System.Collections.Generic;
/// <summary>
/// Command to play or pause.
/// Command to pause or resume.
/// https://www.musicpd.org/doc/protocol/playback_commands.html.
/// </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>
/// Serializes the command.
/// </summary>
/// <returns>
/// The serialize command.
/// </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>
/// Deserializes the specified response text pairs.

View File

@ -8,7 +8,7 @@
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace>MpcNET</RootNamespace>
<Version>0.0.1-pre005</Version>
<Version>0.0.1-pre007</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyVersion>0.0.1.0</AssemblyVersion>
<FileVersion>0.0.1.0</FileVersion>