├── Chimney.MPD
├── obj
│ ├── Debug
│ │ ├── layout.resfiles
│ │ ├── pri.resfiles
│ │ ├── qualifiers.txt
│ │ ├── resources.resfiles
│ │ ├── pri.resfiles.intermediate
│ │ ├── layout.resfiles.intermediate
│ │ ├── qualifiers.txt.intermediate
│ │ ├── resources.resfiles.intermediate
│ │ ├── MultipleQualifiersPerDimensionFound.txt
│ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
│ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
│ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
│ │ ├── Chimney.MPD.dll
│ │ ├── Chimney.MPD.pdb
│ │ ├── MPD.csprojResolveAssemblyReference.cache
│ │ ├── ChimneyMPD.csprojResolveAssemblyReference.cache
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ ├── Chimney.MPD.csprojResolveAssemblyReference.cache
│ │ ├── MPD.csproj.FileListAbsolute.txt
│ │ ├── ChimneyMPD.csproj.FileListAbsolute.txt
│ │ ├── priconfig.xml
│ │ └── priconfig.xml.intermediate
│ └── Release
│ │ ├── pri.resfiles
│ │ ├── qualifiers.txt
│ │ ├── layout.resfiles
│ │ ├── resources.resfiles
│ │ ├── layout.resfiles.intermediate
│ │ ├── pri.resfiles.intermediate
│ │ ├── qualifiers.txt.intermediate
│ │ ├── resources.resfiles.intermediate
│ │ ├── MultipleQualifiersPerDimensionFound.txt
│ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
│ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
│ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
│ │ ├── Chimney.MPD.dll
│ │ ├── Chimney.MPD.pdb
│ │ ├── ChimneyMPD.dll
│ │ ├── ChimneyMPD.pdb
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ ├── Chimney.MPD.csprojResolveAssemblyReference.cache
│ │ ├── ChimneyMPD.csproj.FileListAbsolute.txt
│ │ ├── Chimney.MPD.csproj.FileListAbsolute.txt
│ │ ├── priconfig.xml
│ │ └── priconfig.xml.intermediate
├── bin
│ ├── Debug
│ │ ├── Chimney.MPD.dll
│ │ ├── Chimney.MPD.pdb
│ │ └── Chimney.MPD.pri
│ └── Release
│ │ ├── Chimney.MPD.dll
│ │ ├── Chimney.MPD.pdb
│ │ ├── Chimney.MPD.pri
│ │ ├── ChimneyMPD.dll
│ │ ├── ChimneyMPD.pdb
│ │ └── ChimneyMPD.pri
├── Classes
│ ├── TagType.cs
│ ├── QueueJob.cs
│ ├── Channel.cs
│ ├── Message.cs
│ ├── StoredPlaylist.cs
│ ├── Output.cs
│ ├── Stats.cs
│ ├── SongTag.cs
│ └── Status.cs
├── Chimney.MPD.csproj.vspscc
├── Properties
│ └── AssemblyInfo.cs
├── Net
│ └── Connection.cs
├── Chimney.MPD.csproj
├── ChimneyMPDEvent.cs
├── MPDKeyWords.cs
├── ChimneyMPDBase.cs
├── ChimneyMPDClient.cs
└── ChimneyMPDDirectClient.cs
├── .gitattributes
├── .gitignore
├── Chimney.Shared
└── UserControls
│ └── ChimneyServerUserControl.xaml
└── license.txt
/Chimney.MPD/obj/Debug/layout.resfiles:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/pri.resfiles:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/qualifiers.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/pri.resfiles:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/qualifiers.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/resources.resfiles:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/layout.resfiles:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/resources.resfiles:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/pri.resfiles.intermediate:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/layout.resfiles.intermediate:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/qualifiers.txt.intermediate:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/resources.resfiles.intermediate:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/layout.resfiles.intermediate:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/pri.resfiles.intermediate:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/qualifiers.txt.intermediate:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/resources.resfiles.intermediate:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/MultipleQualifiersPerDimensionFound.txt:
--------------------------------------------------------------------------------
1 | False
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/MultipleQualifiersPerDimensionFound.txt:
--------------------------------------------------------------------------------
1 | False
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Debug/Chimney.MPD.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Debug/Chimney.MPD.dll
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Debug/Chimney.MPD.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Debug/Chimney.MPD.pdb
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Debug/Chimney.MPD.pri:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Debug/Chimney.MPD.pri
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Release/Chimney.MPD.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Release/Chimney.MPD.dll
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Release/Chimney.MPD.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Release/Chimney.MPD.pdb
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Release/Chimney.MPD.pri:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Release/Chimney.MPD.pri
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Release/ChimneyMPD.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Release/ChimneyMPD.dll
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Release/ChimneyMPD.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Release/ChimneyMPD.pdb
--------------------------------------------------------------------------------
/Chimney.MPD/bin/Release/ChimneyMPD.pri:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/bin/Release/ChimneyMPD.pri
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/Chimney.MPD.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Debug/Chimney.MPD.dll
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/Chimney.MPD.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Debug/Chimney.MPD.pdb
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/Chimney.MPD.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Release/Chimney.MPD.dll
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/Chimney.MPD.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Release/Chimney.MPD.pdb
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/ChimneyMPD.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Release/ChimneyMPD.dll
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/ChimneyMPD.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Release/ChimneyMPD.pdb
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/MPD.csprojResolveAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Debug/MPD.csprojResolveAssemblyReference.cache
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/ChimneyMPD.csprojResolveAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Debug/ChimneyMPD.csprojResolveAssemblyReference.cache
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/Chimney.MPD.csprojResolveAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Debug/Chimney.MPD.csprojResolveAssemblyReference.cache
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/Chimney.MPD.csprojResolveAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opengd/Chimney/HEAD/Chimney.MPD/obj/Release/Chimney.MPD.csprojResolveAssemblyReference.cache
--------------------------------------------------------------------------------
/Chimney.MPD/Classes/TagType.cs:
--------------------------------------------------------------------------------
1 | namespace Chimney.MPD.Classes
2 | {
3 | public enum TagType
4 | {
5 | File, Directory, Playlist, Album, Genre, Artist, FileOrDirectory, Search, Alphabet, Empty
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Chimney.MPD/Chimney.MPD.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/Chimney.MPD/Classes/QueueJob.cs:
--------------------------------------------------------------------------------
1 | namespace Chimney.MPD.Classes
2 | {
3 | class QueueJob
4 | {
5 | public int id = -1;
6 | public string send = "";
7 | public bool retry = true;
8 | public bool silent = false;
9 | public bool wait = true;
10 | public string response = "";
11 |
12 | public QueueJob()
13 | {
14 |
15 | }
16 |
17 | public QueueJob(int id, string send, bool silent = false, bool retry = true, bool wait = true)
18 | {
19 | this.id = id;
20 | this.send = send;
21 | this.retry = retry;
22 | this.silent = silent;
23 | this.wait = wait;
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # Windows shortcuts
18 | *.lnk
19 |
20 | # =========================
21 | # Operating System Files
22 | # =========================
23 |
24 | # OSX
25 | # =========================
26 |
27 | .DS_Store
28 | .AppleDouble
29 | .LSOverride
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear on external disk
35 | .Spotlight-V100
36 | .Trashes
37 |
38 | # Directories potentially created on remote AFP share
39 | .AppleDB
40 | .AppleDesktop
41 | Network Trash Folder
42 | Temporary Items
43 | .apdisk
44 |
--------------------------------------------------------------------------------
/Chimney.Shared/UserControls/ChimneyServerUserControl.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Erik Johansson chimneyapp@outlook.com
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Chimney.MPD/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Resources;
2 | using System.Reflection;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("ChimneyMPD")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("ChimneyMPD")]
14 | [assembly: AssemblyCopyright("Copyright © 2015")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: NeutralResourcesLanguage("en")]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/Chimney.MPD/Classes/Channel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Chimney.MPD.Classes
4 | {
5 | public class Channel
6 | {
7 | public string channel { get; set; }
8 |
9 | public Channel(List> keyValuePairList)
10 | {
11 | if (keyValuePairList == null) return;
12 |
13 | foreach (var kv in keyValuePairList)
14 | {
15 | switch (kv.Key)
16 | {
17 | case "channel":
18 | this.channel = kv.Value;
19 | break;
20 | default:
21 | break;
22 | }
23 | }
24 | }
25 |
26 | public Channel(Dictionary dictionary)
27 | {
28 | foreach (string key in dictionary.Keys)
29 | {
30 | switch (key)
31 | {
32 | case "channel":
33 | this.channel = dictionary[key];
34 | break;
35 | default:
36 | break;
37 | }
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Chimney.MPD/Classes/Message.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Chimney.MPD.Classes
4 | {
5 | public class Message
6 | {
7 | public string message { get; set; }
8 | public Channel channel { get; set; }
9 |
10 | public Message(List> keyValuePairList)
11 | {
12 | if (keyValuePairList == null) return;
13 |
14 | foreach (var kv in keyValuePairList)
15 | {
16 | switch (kv.Key)
17 | {
18 | case "message":
19 | this.message = kv.Value;
20 | break;
21 | case "channel":
22 | this.channel = new Channel(new List>() { new KeyValuePair ("channel", kv.Value ) });
23 | break;
24 | default:
25 | break;
26 | }
27 | }
28 | }
29 |
30 | public Message(Dictionary dictionary)
31 | {
32 | foreach (string key in dictionary.Keys)
33 | {
34 | switch (key)
35 | {
36 | case "message":
37 | this.message = dictionary[key];
38 | break;
39 | case "channel":
40 | this.channel = new Channel(new Dictionary() { { "channel", dictionary[key] } });
41 | break;
42 | default:
43 | break;
44 | }
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/ChimneyMPD.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Release\ChimneyMPD.dll
2 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Release\ChimneyMPD.pdb
3 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Release\ChimneyMPD.pri
4 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\ChimneyMPD.dll
5 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\ChimneyMPD.pdb
6 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\priconfig.xml
7 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\priconfig.xml.intermediate
8 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\layout.resfiles
9 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\layout.resfiles.intermediate
10 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\resources.resfiles
11 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\resources.resfiles.intermediate
12 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\pri.resfiles
13 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\pri.resfiles.intermediate
14 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\qualifiers.txt
15 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\qualifiers.txt.intermediate
16 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\MultipleQualifiersPerDimensionFound.txt
17 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/MPD.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\MPD.csprojResolveAssemblyReference.cache
2 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Debug\ChimneyMPD.dll
3 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Debug\ChimneyMPD.pdb
4 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Debug\ChimneyMPD.pri
5 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\ChimneyMPD.dll
6 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\ChimneyMPD.pdb
7 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\priconfig.xml
8 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\priconfig.xml.intermediate
9 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\layout.resfiles
10 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\layout.resfiles.intermediate
11 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\resources.resfiles
12 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\resources.resfiles.intermediate
13 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\pri.resfiles
14 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\pri.resfiles.intermediate
15 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\qualifiers.txt
16 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\qualifiers.txt.intermediate
17 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\MultipleQualifiersPerDimensionFound.txt
18 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/ChimneyMPD.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Debug\ChimneyMPD.dll
2 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Debug\ChimneyMPD.pdb
3 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Debug\ChimneyMPD.pri
4 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\ChimneyMPD.csprojResolveAssemblyReference.cache
5 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\ChimneyMPD.dll
6 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\ChimneyMPD.pdb
7 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\priconfig.xml
8 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\priconfig.xml.intermediate
9 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\layout.resfiles
10 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\layout.resfiles.intermediate
11 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\resources.resfiles
12 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\resources.resfiles.intermediate
13 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\pri.resfiles
14 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\pri.resfiles.intermediate
15 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\qualifiers.txt
16 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\qualifiers.txt.intermediate
17 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Debug\MultipleQualifiersPerDimensionFound.txt
18 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/Chimney.MPD.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Release\Chimney.MPD.dll
2 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Release\Chimney.MPD.pdb
3 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\bin\Release\Chimney.MPD.pri
4 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\Chimney.MPD.csprojResolveAssemblyReference.cache
5 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\Chimney.MPD.dll
6 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\Chimney.MPD.pdb
7 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\priconfig.xml
8 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\priconfig.xml.intermediate
9 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\layout.resfiles
10 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\layout.resfiles.intermediate
11 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\resources.resfiles
12 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\resources.resfiles.intermediate
13 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\pri.resfiles
14 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\pri.resfiles.intermediate
15 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\qualifiers.txt
16 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\qualifiers.txt.intermediate
17 | C:\Users\ejevi_000\Documents\Visual Studio 2013\Projects\Chimney\ChimneyMPD\obj\Release\MultipleQualifiersPerDimensionFound.txt
18 |
--------------------------------------------------------------------------------
/Chimney.MPD/Classes/StoredPlaylist.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Chimney.MPD.Classes
5 | {
6 | public class StoredPlaylist
7 | {
8 | public string Playlist { get; set; }
9 | public string LastModified { get; set; }
10 |
11 | public override string ToString()
12 | {
13 | string storedplayliststring = string.Empty;
14 |
15 | storedplayliststring = storedplayliststring + "playlist: " + this.Playlist + "\n";
16 | if (string.IsNullOrEmpty(this.LastModified)) storedplayliststring = storedplayliststring + "Last-Modified: " + this.LastModified + "\n";
17 | else storedplayliststring = storedplayliststring + "Last-Modified: " + TimeSpan.FromSeconds(0) + "\n";
18 |
19 | return storedplayliststring;
20 | }
21 |
22 | public StoredPlaylist()
23 | {
24 |
25 | }
26 |
27 | public StoredPlaylist(List> keyValuePairList)
28 | {
29 | foreach (var kv in keyValuePairList)
30 | {
31 | switch (kv.Key)
32 | {
33 | case "playlist":
34 | this.Playlist = kv.Value;
35 | break;
36 | case "Last-Modified":
37 | this.LastModified = kv.Value;
38 | break;
39 | default:
40 | break;
41 | }
42 | }
43 | }
44 |
45 | public StoredPlaylist(Dictionary dictionary)
46 | {
47 | foreach (string key in dictionary.Keys)
48 | {
49 | switch (key)
50 | {
51 | case "playlist":
52 | this.Playlist = dictionary[key];
53 | break;
54 | case "Last-Modified":
55 | this.LastModified = dictionary[key];
56 | break;
57 | default:
58 | break;
59 | }
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/priconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/priconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Debug/priconfig.xml.intermediate:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Chimney.MPD/obj/Release/priconfig.xml.intermediate:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Chimney.MPD/Classes/Output.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Chimney.MPD.Classes
5 | {
6 | public class Output
7 | {
8 | public string outputname { get; set; }
9 | public bool outputenabled { get; set; }
10 | public string outputid { get; set; }
11 |
12 | public Output()
13 | {
14 |
15 | }
16 |
17 | public Output(List> keyValuePair)
18 | {
19 | if (keyValuePair == null) return;
20 |
21 | foreach(var kv in keyValuePair)
22 | {
23 | switch (kv.Key)
24 | {
25 | case "outputname":
26 | this.outputname = kv.Value;
27 | break;
28 | case "outputenabled":
29 | this.outputenabled = Convert.ToBoolean(Convert.ToInt32(kv.Value));
30 | break;
31 | case "outputid":
32 | this.outputid = kv.Value;
33 | break;
34 | default:
35 | break;
36 | }
37 | }
38 | }
39 |
40 | public Output(Dictionary dictionary)
41 | {
42 | foreach (string key in dictionary.Keys)
43 | {
44 | switch (key)
45 | {
46 | case "outputname":
47 | this.outputname = dictionary[key];
48 | break;
49 | case "outputenabled":
50 | this.outputenabled = Convert.ToBoolean(Convert.ToInt32(dictionary[key]));
51 | break;
52 | case "outputid":
53 | this.outputid = dictionary[key];
54 | break;
55 | default:
56 | break;
57 | }
58 | }
59 | }
60 |
61 | public override string ToString()
62 | {
63 | string returnstring = string.Empty;
64 | returnstring += "outputid: " + this.outputid + "\n";
65 | returnstring += "outputname: " + this.outputname + "\n";
66 | returnstring += "outputenabled: " + Convert.ToInt32(this.outputenabled) + "\n";
67 |
68 | return returnstring;
69 | }
70 |
71 | public string ToJson()
72 | {
73 | return "{\n" + "\"outputname\": " + "\"" + this.outputname + "\"," +
74 | "\n\"outputenabled\": " + "\"" + this.outputname + "\"," +
75 | "\n\"outputid\": " + "\"" + this.outputid + "\"" + "\n}";
76 | }
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/Chimney.MPD/Net/Connection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 | using Windows.Networking;
9 | using Windows.Networking.Sockets;
10 | using Windows.Storage.Streams;
11 |
12 | namespace Chimney.MPD.Net
13 | {
14 | class Connection
15 | {
16 | private bool _Connected;
17 | public bool Connected
18 | {
19 | get
20 | {
21 | return _Connected;
22 | }
23 | }
24 |
25 | private StreamSocket _streamSocket;
26 | public StreamSocket Socket
27 | {
28 | get
29 | {
30 | return _streamSocket;
31 | }
32 | }
33 |
34 | private string _host;
35 | private string _port;
36 |
37 | public void Close()
38 | {
39 | try
40 | {
41 | _streamSocket.Dispose();
42 | }
43 | catch (Exception ex)
44 | {
45 | Debug.WriteLine(ex.Message);
46 | }
47 | }
48 |
49 | public async Task Connect(string host, string port, int timeout = 0)
50 | {
51 | _streamSocket = new StreamSocket();
52 | _streamSocket.Control.KeepAlive = true;
53 | _streamSocket.Control.QualityOfService = SocketQualityOfService.Normal;
54 |
55 | var cts = new CancellationTokenSource();
56 |
57 | _host = host;
58 | _port = port;
59 |
60 | try
61 | {
62 | if(timeout > 0)
63 | {
64 | cts.CancelAfter(timeout);
65 | await _streamSocket.ConnectAsync(new HostName(host), port).AsTask(cts.Token);
66 | }
67 | else
68 | await _streamSocket.ConnectAsync(new HostName(host), port);
69 |
70 | _Connected = true;
71 | }
72 | catch (Exception ex)
73 | {
74 | Debug.WriteLine(ex.Message);
75 |
76 | Close();
77 |
78 | _streamSocket = null;
79 |
80 | _host = null;
81 | _port = null;
82 |
83 | _Connected = false;
84 | }
85 |
86 | return _Connected;
87 | }
88 |
89 | public static async Task Recive(StreamSocket streamSocket, List orstarts, List orends, List andstarts, List andends)
90 | {
91 | string returnString = string.Empty;
92 |
93 | try
94 | {
95 | using (var dataReader = new DataReader(streamSocket.InputStream))
96 | {
97 | dataReader.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
98 | dataReader.InputStreamOptions = InputStreamOptions.Partial;
99 |
100 | var end = false;
101 |
102 | while (!end && await dataReader.LoadAsync(64000) != 0)
103 | {
104 | string readString;
105 | var buffer = dataReader.ReadBuffer(dataReader.UnconsumedBufferLength);
106 | using (var dr = DataReader.FromBuffer(buffer))
107 | {
108 | var bytes1251 = new Byte[buffer.Length];
109 | dr.ReadBytes(bytes1251);
110 |
111 | readString = Encoding.GetEncoding("UTF-8").GetString(bytes1251, 0, bytes1251.Length);
112 | }
113 |
114 | if (!string.IsNullOrEmpty(readString))
115 | returnString += readString;
116 |
117 | if (readString == null)
118 | {
119 | end = true;
120 | }
121 | else if (orstarts.FirstOrDefault(o => returnString.StartsWith(o)) != null)
122 | {
123 | end = true;
124 | }
125 | else if (orends.FirstOrDefault(o => returnString.EndsWith(o)) != null)
126 | {
127 | end = true;
128 | }
129 | else if (andstarts.FirstOrDefault(o => returnString.StartsWith(o)) != null
130 | && andends.FirstOrDefault(o => returnString.EndsWith(o)) != null)
131 | {
132 | end = true;
133 | }
134 | }
135 |
136 | dataReader.DetachStream();
137 | }
138 | }
139 | catch(Exception ex)
140 | {
141 | Debug.WriteLine(ex.Message);
142 | returnString = string.Empty;
143 | }
144 |
145 | return returnString;
146 | }
147 |
148 |
149 |
150 | public static async Task Send(StreamSocket streamSocket, string send)
151 | {
152 | var bytearray = Encoding.GetEncoding("UTF-8").GetBytes(send);
153 |
154 | var success = true;
155 | try
156 | {
157 | using (var dataWriter = new DataWriter(streamSocket.OutputStream))
158 | {
159 | dataWriter.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
160 |
161 | dataWriter.WriteBytes(bytearray);
162 |
163 | await dataWriter.StoreAsync();
164 |
165 | await dataWriter.FlushAsync();
166 |
167 | dataWriter.DetachStream();
168 | }
169 | }
170 | catch (Exception ex)
171 | {
172 | Debug.WriteLine(ex.Message);
173 | success = false;
174 | }
175 |
176 | return success;
177 | }
178 | }
179 | }
180 |
--------------------------------------------------------------------------------
/Chimney.MPD/Chimney.MPD.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {FC9A0095-F01A-4A14-A16C-EDF6EFECF16C}
8 | Library
9 | Properties
10 | Chimney.MPD
11 | Chimney.MPD
12 | en-US
13 | UAP
14 | 10.0.10240.0
15 | 10.0.10240.0
16 | 14
17 | 512
18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
19 |
20 |
21 | AnyCPU
22 | true
23 | full
24 | false
25 | bin\Debug\
26 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
27 | prompt
28 | 4
29 |
30 |
31 | AnyCPU
32 | pdbonly
33 | true
34 | bin\Release\
35 | TRACE;NETFX_CORE;WINDOWS_UWP
36 | prompt
37 | 4
38 |
39 |
40 | ARM
41 | true
42 | bin\ARM\Debug\
43 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
44 | ;2008
45 | full
46 | ARM
47 | false
48 | prompt
49 | true
50 |
51 |
52 | ARM
53 | bin\ARM\Release\
54 | TRACE;NETFX_CORE;WINDOWS_UWP
55 | true
56 | ;2008
57 | pdbonly
58 | ARM
59 | false
60 | prompt
61 | true
62 |
63 |
64 | x64
65 | true
66 | bin\x64\Debug\
67 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
68 | ;2008
69 | full
70 | x64
71 | false
72 | prompt
73 | true
74 |
75 |
76 | x64
77 | bin\x64\Release\
78 | TRACE;NETFX_CORE;WINDOWS_UWP
79 | true
80 | ;2008
81 | pdbonly
82 | x64
83 | false
84 | prompt
85 | true
86 |
87 |
88 | x86
89 | true
90 | bin\x86\Debug\
91 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
92 | ;2008
93 | full
94 | x86
95 | false
96 | prompt
97 | true
98 |
99 |
100 | x86
101 | bin\x86\Release\
102 | TRACE;NETFX_CORE;WINDOWS_UWP
103 | true
104 | ;2008
105 | pdbonly
106 | x86
107 | false
108 | prompt
109 | true
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 14.0
137 |
138 |
139 |
146 |
--------------------------------------------------------------------------------
/Chimney.MPD/Classes/Stats.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Chimney.MPD.Classes
5 | {
6 | public class Stats
7 | {
8 | private string _albums;
9 | public string Albums
10 | {
11 | get
12 | {
13 | return (string.IsNullOrEmpty(this._albums)) ? "0" : this._albums; //string.Empty;
14 | }
15 | set
16 | {
17 | this._albums = value;
18 | }
19 | }
20 |
21 | private string _artists;
22 | public string Artists
23 | {
24 | get
25 | {
26 | return (string.IsNullOrEmpty(this._artists)) ? "0" : this._artists;
27 | }
28 | set
29 | {
30 | this._artists = value;
31 | }
32 | }
33 |
34 | private string _songs;
35 | public string Songs
36 | {
37 | get
38 | {
39 | return (string.IsNullOrEmpty(this._songs)) ? "0" : this._songs;
40 | }
41 | set
42 | {
43 | this._songs = value;
44 | }
45 | }
46 | private string _uptime;
47 | public string Uptime
48 | {
49 | get
50 | {
51 | if (string.IsNullOrEmpty(this._uptime)) return string.Empty;
52 | TimeSpan timeSpan = TimeSpan.FromSeconds(Convert.ToInt32(this._uptime));
53 | return timeSpan.Days + "d " + timeSpan.Hours + "h " +
54 | timeSpan.Minutes + "m " + timeSpan.Seconds + "s";
55 | }
56 | set
57 | {
58 | this._uptime = value;
59 | }
60 | }
61 |
62 | private string _db_playtime;
63 | public string DbPlaytime
64 | {
65 | get
66 | {
67 | if (string.IsNullOrEmpty(this._db_playtime)) return string.Empty;
68 | TimeSpan timeSpan = TimeSpan.FromSeconds(Convert.ToInt32(this._db_playtime));
69 | return timeSpan.Days + "d " + timeSpan.Hours + "h " +
70 | timeSpan.Minutes + "m " + timeSpan.Seconds + "s";
71 | }
72 | set
73 | {
74 | this._db_playtime = value;
75 | }
76 | }
77 |
78 | private string _db_update;
79 | public string DbUpdate
80 | {
81 | get
82 | {
83 | if (string.IsNullOrEmpty(this._db_update)) return string.Empty;
84 | DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
85 | dateTime = dateTime.AddSeconds(Convert.ToDouble(this._db_update)).ToLocalTime();
86 | TimeSpan timeSpan = DateTime.Now - dateTime;
87 | return timeSpan.Days + "d " + timeSpan.Hours + "h " +
88 | timeSpan.Minutes + "m " + timeSpan.Seconds + "s";
89 | }
90 | set
91 | {
92 | this._db_update = value;
93 | }
94 | }
95 |
96 | public TimeSpan DbUpdateTimeSpan
97 | {
98 | get
99 | {
100 | if (string.IsNullOrEmpty(this._db_update)) return new TimeSpan();
101 | DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
102 | dateTime = dateTime.AddSeconds(Convert.ToDouble(this._db_update)).ToLocalTime();
103 | return DateTime.Now - dateTime;
104 | }
105 | }
106 |
107 | private string _playtime;
108 | public string Playtime
109 | {
110 | get
111 | {
112 | if (string.IsNullOrEmpty(this._playtime)) return string.Empty;
113 | TimeSpan timeSpan = TimeSpan.FromSeconds(Convert.ToInt32(this._playtime));
114 | return timeSpan.Days + "d " + timeSpan.Hours + "h " +
115 | timeSpan.Minutes + "m " + timeSpan.Seconds + "s";
116 | }
117 | set
118 | {
119 | this._playtime = value;
120 | }
121 | }
122 |
123 | public override string ToString()
124 | {
125 | string statstext = string.Empty;
126 |
127 | if(!string.IsNullOrEmpty(this.Artists)) statstext = statstext + "artists: " + this.Artists + "\n";
128 | else statstext = statstext + "artists: 0\n";
129 |
130 | if (!string.IsNullOrEmpty(this.Albums)) statstext = statstext + "albums: " + this.Albums + "\n";
131 | else statstext = statstext + "albums: 0\n";
132 |
133 | if (!string.IsNullOrEmpty(this.Songs)) statstext = statstext + "songs: " + this.Songs + "\n";
134 | else statstext = statstext + "songs: 0\n";
135 |
136 | if (!string.IsNullOrEmpty(this.Uptime)) statstext = statstext + "uptime: " + this.Uptime + "\n";
137 | else statstext = statstext + "uptime: 0\n";
138 |
139 | if (!string.IsNullOrEmpty(this.DbPlaytime)) statstext = statstext + "db_playtime: " + this._db_playtime + "\n";
140 | else statstext = statstext + "db_playtime: 0\n";
141 |
142 | if (!string.IsNullOrEmpty(this.DbUpdate)) statstext = statstext + "db_update: " + this.DbUpdate + "\n";
143 | else statstext = statstext + "db_update: 0\n";
144 |
145 | if (!string.IsNullOrEmpty(this.Playtime)) statstext = statstext + "playtime: " + this.Playtime + "\n";
146 | else statstext = statstext + "playtime: 0\n";
147 |
148 | return statstext;
149 | }
150 |
151 | public Stats()
152 | {
153 | }
154 |
155 | public Stats(List> keyValuePair)
156 | {
157 | if (keyValuePair == null) return;
158 |
159 | foreach (var kv in keyValuePair)
160 | {
161 | switch (kv.Key)
162 | {
163 | case "artists":
164 | this.Artists = kv.Value;
165 | break;
166 | case "albums":
167 | this.Albums = kv.Value;
168 | break;
169 | case "songs":
170 | this.Songs = kv.Value;
171 | break;
172 | case "uptime":
173 | this.Uptime = kv.Value;
174 | break;
175 | case "db_playtime":
176 | this.DbPlaytime = kv.Value;
177 | break;
178 | case "db_update":
179 | this.DbUpdate = kv.Value;
180 | break;
181 | case "playtime":
182 | this.Playtime = kv.Value;
183 | break;
184 | default:
185 | break;
186 | }
187 | }
188 | }
189 |
190 | public Stats(Dictionary dictionary)
191 | {
192 | foreach (string key in dictionary.Keys)
193 | {
194 | switch (key)
195 | {
196 | case "artists":
197 | this.Artists = dictionary[key];
198 | break;
199 | case "albums":
200 | this.Albums = dictionary[key];
201 | break;
202 | case "songs":
203 | this.Songs = dictionary[key];
204 | break;
205 | case "uptime":
206 | this.Uptime = dictionary[key];
207 | break;
208 | case "db_playtime":
209 | this.DbPlaytime = dictionary[key];
210 | break;
211 | case "db_update":
212 | this.DbUpdate = dictionary[key];
213 | break;
214 | case "playtime":
215 | this.Playtime = dictionary[key];
216 | break;
217 | default:
218 | break;
219 | }
220 | }
221 | }
222 | }
223 | }
224 |
--------------------------------------------------------------------------------
/Chimney.MPD/ChimneyMPDEvent.cs:
--------------------------------------------------------------------------------
1 | using Chimney.MPD.Classes;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Threading.Tasks;
5 |
6 | namespace Chimney.MPD
7 | {
8 | public class PlaylistEventArgs : EventArgs
9 | {
10 | public List playlist;
11 | public List playlistchanges;
12 | public Status status;
13 | public SongTag currentsong;
14 |
15 | public PlaylistEventArgs(List playlist, List playlistchanges, Status status, SongTag currentsong)
16 | {
17 | this.playlist = playlist;
18 | this.playlistchanges = playlistchanges;
19 | this.status = status;
20 | this.currentsong = currentsong;
21 |
22 | }
23 | }
24 |
25 | public class StoredPlaylistEventArgs : EventArgs
26 | {
27 | public List storedplaylists;
28 |
29 | public StoredPlaylistEventArgs(List storedplaylists)
30 | {
31 | this.storedplaylists = storedplaylists;
32 | }
33 | }
34 |
35 | public class StatusEventArgs : EventArgs
36 | {
37 | public Status status;
38 |
39 | public StatusEventArgs(Status status)
40 | {
41 | this.status = status;
42 | }
43 | }
44 |
45 | public class StatsEventArgs : EventArgs
46 | {
47 | public Stats stats;
48 |
49 | public StatsEventArgs(Stats stats)
50 | {
51 | this.stats = stats;
52 | }
53 | }
54 |
55 | public class UpdateEventArgs : EventArgs
56 | {
57 | public Status status;
58 | public bool IsUpdating;
59 | public Stats stats;
60 |
61 | public UpdateEventArgs(Status status, bool IsUpdating, Stats stats)
62 | {
63 | this.status = status;
64 | this.IsUpdating = IsUpdating;
65 | this.stats = stats;
66 | }
67 | }
68 |
69 | public class PlayerEventArgs : EventArgs
70 | {
71 | public SongTag currentsong;
72 | public Status status;
73 |
74 | public PlayerEventArgs(SongTag currentsong, Status status)
75 | {
76 | this.currentsong = currentsong;
77 | this.status = status;
78 | }
79 | }
80 |
81 | public class OutputEventArgs : EventArgs
82 | {
83 | public List