diff --git a/README.md b/README.md
index a014b9d..da53e03 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,9 @@
-
+
MpcNET
===========
-Pure .NET Client Library for [**Music Player Daemon**](https://www.musicpd.org/) Servers.
+Pure .NET Client Library for [**Music Player Daemon**](https://www.musicpd.org/) Servers.
+The heart and soul of [Stylophone](https://github.com/Difegue/Stylophone).
## Usage
### Connection
diff --git a/Sources/MpcNET/Commands/Database/FindCommand.cs b/Sources/MpcNET/Commands/Database/FindCommand.cs
deleted file mode 100644
index 954c14e..0000000
--- a/Sources/MpcNET/Commands/Database/FindCommand.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Database
-{
- using System.Collections.Generic;
- using System.Linq;
- using MpcNET.Tags;
- using MpcNET.Types;
-
- ///
- /// Finds songs in the database that is exactly "searchText".
- /// https://www.musicpd.org/doc/protocol/database.html.
- ///
- public class FindCommand : IMpcCommand>
- {
- private readonly List> filters;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The tag.
- /// The search text.
- public FindCommand(ITag tag, string searchText)
- {
- this.filters = new List>();
- this.filters.Add(new KeyValuePair(tag, searchText));
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// List of key/value filters
- public FindCommand(List> filters)
- {
- this.filters = filters;
- }
-
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() =>
- string.Join(" ",
- "find",
- string.Join(" ",
- this.filters
- .Select(x => string.Join(" ",
- x.Key.Value, escape(x.Value)))
- .ToArray()));
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public IEnumerable Deserialize(IReadOnlyList> response)
- {
- return MpdFile.CreateList(response);
- }
-
- private string escape(string value) => string.Format("\"{0}\"", value.Replace("\\", "\\\\").Replace("\"", "\\\""));
- }
- // TODO: rescan
-}
diff --git a/Sources/MpcNET/Commands/Playlist/AddCommand.cs b/Sources/MpcNET/Commands/Playlist/AddCommand.cs
deleted file mode 100644
index 27c3766..0000000
--- a/Sources/MpcNET/Commands/Playlist/AddCommand.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
-
- ///
- /// Adds the file URI to the playlist (directories add recursively). URI can also be a single file.
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class AddCommand : IMpcCommand
- {
- private readonly string uri;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The URI.
- public AddCommand(string uri)
- {
- this.uri = uri;
- }
-
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => string.Join(" ", "add", $"\"{this.uri}\"");
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public string Deserialize(IReadOnlyList> response)
- {
- return string.Join(", ", response);
- }
- }
-}
diff --git a/Sources/MpcNET/Commands/Playlist/AddIdCommand.cs b/Sources/MpcNET/Commands/Playlist/AddIdCommand.cs
deleted file mode 100644
index 0643ca3..0000000
--- a/Sources/MpcNET/Commands/Playlist/AddIdCommand.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
-
- ///
- /// Adds a song to the playlist (non-recursive) and returns the song id.
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class AddIdCommand : IMpcCommand
- {
- private readonly string uri;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The URI.
- public AddIdCommand(string uri)
- {
- this.uri = uri;
- }
-
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => string.Join(" ", "addid", $"\"{this.uri}\"");
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public string Deserialize(IReadOnlyList> response)
- {
- return string.Join(", ", response);
- }
- }
-}
\ No newline at end of file
diff --git a/Sources/MpcNET/Commands/Playlist/ClearCommand.cs b/Sources/MpcNET/Commands/Playlist/ClearCommand.cs
deleted file mode 100644
index a9ef8a4..0000000
--- a/Sources/MpcNET/Commands/Playlist/ClearCommand.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
-
- ///
- /// Clears the current playlist.
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class ClearCommand : IMpcCommand
- {
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => "clear";
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public string Deserialize(IReadOnlyList> response)
- {
- return string.Join(", ", response);
- }
- }
-}
\ No newline at end of file
diff --git a/Sources/MpcNET/Commands/Playlist/DeleteCommand.cs b/Sources/MpcNET/Commands/Playlist/DeleteCommand.cs
deleted file mode 100644
index 0f19bed..0000000
--- a/Sources/MpcNET/Commands/Playlist/DeleteCommand.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
-
- ///
- /// Deletes a song from the playlist.
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class DeleteCommand : IMpcCommand
- {
- private readonly int position;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The position.
- public DeleteCommand(int position)
- {
- this.position = position;
- }
-
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => string.Join(" ", "delete", this.position);
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public string Deserialize(IReadOnlyList> response)
- {
- return string.Join(", ", response);
- }
- }
-}
\ No newline at end of file
diff --git a/Sources/MpcNET/Commands/Playlist/DeleteIdCommand.cs b/Sources/MpcNET/Commands/Playlist/DeleteIdCommand.cs
deleted file mode 100644
index ea4a4bd..0000000
--- a/Sources/MpcNET/Commands/Playlist/DeleteIdCommand.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
-
- ///
- /// Deletes the song SONGID from the playlist.
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class DeleteIdCommand : IMpcCommand
- {
- private readonly int songId;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The song identifier.
- public DeleteIdCommand(int songId)
- {
- this.songId = songId;
- }
-
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => string.Join(" ", "deleteid", this.songId);
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public string Deserialize(IReadOnlyList> response)
- {
- return string.Join(", ", response);
- }
- }
-}
\ No newline at end of file
diff --git a/Sources/MpcNET/Commands/Playlist/MoveIdCommand.cs b/Sources/MpcNET/Commands/Playlist/MoveIdCommand.cs
deleted file mode 100644
index bdfdb10..0000000
--- a/Sources/MpcNET/Commands/Playlist/MoveIdCommand.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
-
- ///
- /// Moves the song with FROM (songid) to TO (playlist index) in the playlist.
- /// If TO is negative, it is relative to the current song in the playlist (if there is one)
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class MoveIdCommand : IMpcCommand
- {
- private readonly int from;
- private readonly int to;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// From (songid)
- /// To (playlist index)
- public MoveIdCommand(int from, int to)
- {
- this.from = from;
- this.to = to;
- }
-
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => string.Join(" ", "moveid", from, to);
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public string Deserialize(IReadOnlyList> response)
- {
- return string.Join(", ", response);
- }
- }
-}
diff --git a/Sources/MpcNET/Commands/Playlist/PlaylistCommand.cs b/Sources/MpcNET/Commands/Playlist/PlaylistCommand.cs
deleted file mode 100644
index 4ce6fe8..0000000
--- a/Sources/MpcNET/Commands/Playlist/PlaylistCommand.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
- using System.Linq;
- using MpcNET.Types;
-
- ///
- /// Displays the current playlist.
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class PlaylistCommand : IMpcCommand>
- {
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => "playlist";
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public IEnumerable Deserialize(IReadOnlyList> response)
- {
- var results = response.Select(line => MpdFile.Create(line.Value, int.Parse(line.Key)));
-
- return results;
- }
- }
-}
\ No newline at end of file
diff --git a/Sources/MpcNET/Commands/Playlist/PlaylistIdCommand.cs b/Sources/MpcNET/Commands/Playlist/PlaylistIdCommand.cs
deleted file mode 100644
index 6716e5e..0000000
--- a/Sources/MpcNET/Commands/Playlist/PlaylistIdCommand.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
- using MpcNET.Types;
-
- ///
- /// Displays song ID in the playlist.
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class PlaylistIdCommand : IMpcCommand>
- {
- private readonly int songId;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The song identifier.
- public PlaylistIdCommand(int songId)
- {
- this.songId = songId;
- }
-
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => string.Join(" ", new[] { "playlistid" }, this.songId);
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public IEnumerable Deserialize(IReadOnlyList> response)
- {
- return MpdFile.CreateList(response);
- }
- }
-}
\ No newline at end of file
diff --git a/Sources/MpcNET/Commands/Playlist/PlaylistInfoCommand.cs b/Sources/MpcNET/Commands/Playlist/PlaylistInfoCommand.cs
deleted file mode 100644
index c1aecea..0000000
--- a/Sources/MpcNET/Commands/Playlist/PlaylistInfoCommand.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-namespace MpcNET.Commands.Playlist
-{
- using System.Collections.Generic;
- using MpcNET.Types;
-
- ///
- /// Displays a list of all songs in the playlist.
- /// https://www.musicpd.org/doc/protocol/queue.html.
- ///
- public class PlaylistInfoCommand : IMpcCommand>
- {
- ///
- /// Serializes the command.
- ///
- ///
- /// The serialize command.
- ///
- public string Serialize() => "playlistinfo";
-
- ///
- /// Deserializes the specified response text pairs.
- ///
- /// The response.
- ///
- /// The deserialized response.
- ///
- public IEnumerable Deserialize(IReadOnlyList> response)
- {
- return MpdFile.CreateList(response);
- }
- }
-}
\ No newline at end of file
diff --git a/Sources/MpcNET/IMpcConnectionReporter.cs b/Sources/MpcNET/IMpcConnectionReporter.cs
deleted file mode 100644
index 59d67f7..0000000
--- a/Sources/MpcNET/IMpcConnectionReporter.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) MpcNET. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace MpcNET
-{
- using System;
- using Sundew.Base.Reporting;
-
- ///
- /// Interface for implementing an observer for .
- ///
- public interface IMpcConnectionReporter : IReporter
- {
- ///
- /// Called when connecting.
- ///
- /// if set to true [is reconnect].
- /// The connect attempt.
- void Connecting(bool isReconnect, int connectAttempt);
-
- ///
- /// Called when connection is accepted.
- ///
- /// if set to true [is reconnect].
- /// The connect attempt.
- void ConnectionAccepted(bool isReconnect, int connectAttempt);
-
- ///
- /// Called when connected.
- ///
- /// if set to true [is reconnect].
- /// The connect attempt.
- /// The connection information.
- void Connected(bool isReconnect, int connectAttempt, string connectionInfo);
-
- ///
- /// Called when sending command.
- ///
- /// The command.
- void Sending(string command);
-
- ///
- /// Called when send exception occured.
- ///
- /// The command text.
- /// The send attempt.
- /// The exception.
- void SendException(string commandText, int sendAttempt, Exception exception);
-
- ///
- /// Called when send is retried.
- ///
- /// The command.
- /// The send attempt.
- void RetrySend(string command, int sendAttempt);
-
- ///
- /// Called when response is read.
- ///
- /// The response line.
- /// The command text.
- void ReadResponse(string responseLine, string commandText);
-
- ///
- /// Called when disconnecting.
- ///
- /// if set to true the disconnect was explicitly called.
- void Disconnecting(bool isExplicitDisconnect);
-
- ///
- /// Called when disconnected.
- ///
- /// if set to true the disconnect was explicitly called.
- void Disconnected(bool isExplicitDisconnect);
- }
-}
\ No newline at end of file
diff --git a/Sources/MpcNET/MpcNET.csproj b/Sources/MpcNET/MpcNET.csproj
index 4116083..3e9840c 100644
--- a/Sources/MpcNET/MpcNET.csproj
+++ b/Sources/MpcNET/MpcNET.csproj
@@ -22,7 +22,7 @@
README.md
https://github.com/Difegue/MpcNET
mpd;client;mpcNET
- D:\Projects\LibMpcNETNuGet\LICENSE
+ MIT
True
@@ -55,6 +55,10 @@
+
+ True
+
+
True
diff --git a/Sources/MpcNET/icon.png b/icon.png
similarity index 100%
rename from Sources/MpcNET/icon.png
rename to icon.png