diff --git a/FirebaseKaraoke/Extensions.cs b/FirebaseKaraoke/Extensions.cs
deleted file mode 100644
index 39d7b4a..0000000
--- a/FirebaseKaraoke/Extensions.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.Cryptography;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace FirebaseKaraoke.Extensions
-{
- public static class StringExtension
- {
- public static Guid ToGUID(this string input)
- {
- // Create a new instance of the MD5CryptoServiceProvider object.
- MD5 md5Hasher = MD5.Create();
- // Convert the input string to a byte array and compute the hash.
- byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));
- return new Guid(data);
- }
- }
-}
diff --git a/FirebaseKaraoke/FirebaseController.cs b/FirebaseKaraoke/FirebaseController.cs
index 28a25f5..f5b3c5b 100644
--- a/FirebaseKaraoke/FirebaseController.cs
+++ b/FirebaseKaraoke/FirebaseController.cs
@@ -1,71 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using KaraokePlayer.Enums;
using FireSharp.Interfaces;
using FireSharp.Config;
using FireSharp;
using Newtonsoft.Json;
using System.Configuration;
+using Herse.Models;
namespace KaraokePlayer.Classes
{
-
- public class Singer
- {
- [JsonProperty("name")]
- public string Name { get; set; }
- }
-
- public class Song
- {
- [JsonProperty("title")]
- public string Title { get; set; }
-
- [JsonProperty("artist")]
- public string Artist { get; set; }
-
- [JsonProperty("genre")]
- public string Genre { get; set; }
-
- [JsonProperty("year")]
- public int Year { get; set; }
-
- [JsonProperty("path")]
- public string Path { get; set; }
-
- [JsonIgnore]
- public FileType FileType
- {
- get
- {
- switch (Path.Substring(Path.Length - 3, 3).ToLower())
- {
- case "cdg":
- case "mp3":
- return FileType.CDG;
- case "mp4":
- return FileType.MP4;
- case "zip":
- return FileType.ZIP;
- default:
- throw new Exception("file type not handled");
-
- }
- }
- }
- }
-
-
- public class QueueItem
- {
- [JsonProperty("singer")]
- public Singer Singer { get; set; }
-
- [JsonProperty("song")]
- public Song Song { get; set; }
- }
-
public class FirebaseController
{
private IFirebaseConfig config = new FirebaseConfig
diff --git a/FirebaseKaraoke/FirebaseKaraoke.csproj b/FirebaseKaraoke/FirebaseKaraoke.csproj
index c32abee..17aca06 100644
--- a/FirebaseKaraoke/FirebaseKaraoke.csproj
+++ b/FirebaseKaraoke/FirebaseKaraoke.csproj
@@ -71,8 +71,6 @@
-
-
@@ -80,6 +78,12 @@
+
+
+ {f02eda00-aa8f-47ef-ac7f-66dc315aa13d}
+ Herse.Models
+
+
diff --git a/FirebaseKaraoke/PlayerDelegates.cs b/FirebaseKaraoke/PlayerDelegates.cs
index af67f7d..7abc544 100644
--- a/FirebaseKaraoke/PlayerDelegates.cs
+++ b/FirebaseKaraoke/PlayerDelegates.cs
@@ -1,4 +1,4 @@
-using KaraokePlayer.Enums;
+using Herse.Models;
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/Herse.Models/FileType.cs b/Herse.Models/FileType.cs
new file mode 100644
index 0000000..143484e
--- /dev/null
+++ b/Herse.Models/FileType.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Herse.Models
+{
+ public enum FileType
+ {
+ CDG, MP4, ZIP
+ }
+}
diff --git a/Herse.Models/Herse.Models.csproj b/Herse.Models/Herse.Models.csproj
new file mode 100644
index 0000000..cdf700d
--- /dev/null
+++ b/Herse.Models/Herse.Models.csproj
@@ -0,0 +1,65 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {F02EDA00-AA8F-47EF-AC7F-66DC315AA13D}
+ Library
+ Properties
+ Herse.Models
+ Herse.Models
+ v4.5.2
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FirebaseKaraoke/Enums.cs b/Herse.Models/PlayerState.cs
similarity index 65%
rename from FirebaseKaraoke/Enums.cs
rename to Herse.Models/PlayerState.cs
index d5a9bc5..3f87ae8 100644
--- a/FirebaseKaraoke/Enums.cs
+++ b/Herse.Models/PlayerState.cs
@@ -4,18 +4,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace KaraokePlayer.Enums
+namespace Herse.Models
{
public enum PlayerState
{
Play,
Stop,
- Pause,
+ Pause,
Next
}
-
- public enum FileType
- {
- CDG, MP4, ZIP
- }
}
diff --git a/Herse.Models/Properties/AssemblyInfo.cs b/Herse.Models/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..72e1b73
--- /dev/null
+++ b/Herse.Models/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Herse.Models")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Herse.Models")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("f02eda00-aa8f-47ef-ac7f-66dc315aa13d")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Herse.Models/QueueItem.cs b/Herse.Models/QueueItem.cs
new file mode 100644
index 0000000..0a7bc33
--- /dev/null
+++ b/Herse.Models/QueueItem.cs
@@ -0,0 +1,18 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Herse.Models
+{
+ public class QueueItem
+ {
+ [JsonProperty("singer")]
+ public Singer Singer { get; set; }
+
+ [JsonProperty("song")]
+ public Song Song { get; set; }
+ }
+}
diff --git a/Herse.Models/Singer.cs b/Herse.Models/Singer.cs
new file mode 100644
index 0000000..62e7e71
--- /dev/null
+++ b/Herse.Models/Singer.cs
@@ -0,0 +1,16 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Herse.Models
+{
+
+ public class Singer
+ {
+ [JsonProperty("name")]
+ public string Name { get; set; }
+ }
+}
diff --git a/Herse.Models/Song.cs b/Herse.Models/Song.cs
new file mode 100644
index 0000000..1db8857
--- /dev/null
+++ b/Herse.Models/Song.cs
@@ -0,0 +1,48 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Herse.Models
+{
+ public class Song
+ {
+ [JsonProperty("title")]
+ public string Title { get; set; }
+
+ [JsonProperty("artist")]
+ public string Artist { get; set; }
+
+ [JsonProperty("genre")]
+ public string Genre { get; set; }
+
+ [JsonProperty("year")]
+ public int Year { get; set; }
+
+ [JsonProperty("path")]
+ public string Path { get; set; }
+
+ [JsonIgnore]
+ public FileType FileType
+ {
+ get
+ {
+ switch (Path.Substring(Path.Length - 3, 3).ToLower())
+ {
+ case "cdg":
+ case "mp3":
+ return FileType.CDG;
+ case "mp4":
+ return FileType.MP4;
+ case "zip":
+ return FileType.ZIP;
+ default:
+ throw new Exception("file type not handled");
+
+ }
+ }
+ }
+ }
+}
diff --git a/Herse.Models/packages.config b/Herse.Models/packages.config
new file mode 100644
index 0000000..9d64bf3
--- /dev/null
+++ b/Herse.Models/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/KaraokePlayer.sln b/KaraokePlayer.sln
index 520ff4e..f2fdfed 100644
--- a/KaraokePlayer.sln
+++ b/KaraokePlayer.sln
@@ -17,7 +17,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FirebaseKaraoke", "Firebase
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SongCrawler", "SongCrawler\SongCrawler.csproj", "{82F60DD0-80EC-49C8-9E7C-95A250783E68}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Herse.Models", "herse.models\Herse.Models.csproj", "{BDE9BC7B-DB3D-4A28-9902-B5D8D1965E5C}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Herse.Models", "Herse.Models\Herse.Models.csproj", "{F02EDA00-AA8F-47EF-AC7F-66DC315AA13D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -45,10 +45,10 @@ Global
{82F60DD0-80EC-49C8-9E7C-95A250783E68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82F60DD0-80EC-49C8-9E7C-95A250783E68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82F60DD0-80EC-49C8-9E7C-95A250783E68}.Release|Any CPU.Build.0 = Release|Any CPU
- {BDE9BC7B-DB3D-4A28-9902-B5D8D1965E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BDE9BC7B-DB3D-4A28-9902-B5D8D1965E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BDE9BC7B-DB3D-4A28-9902-B5D8D1965E5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BDE9BC7B-DB3D-4A28-9902-B5D8D1965E5C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F02EDA00-AA8F-47EF-AC7F-66DC315AA13D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F02EDA00-AA8F-47EF-AC7F-66DC315AA13D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F02EDA00-AA8F-47EF-AC7F-66DC315AA13D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F02EDA00-AA8F-47EF-AC7F-66DC315AA13D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/KaraokePlayer/KaraokePlayer.csproj b/KaraokePlayer/KaraokePlayer.csproj
index 80b48a0..bc5670f 100644
--- a/KaraokePlayer/KaraokePlayer.csproj
+++ b/KaraokePlayer/KaraokePlayer.csproj
@@ -467,6 +467,10 @@
{4fe25e6d-1beb-4902-9815-c2b421233bd7}
FirebaseKaraoke
+
+ {F02EDA00-AA8F-47EF-AC7F-66DC315AA13D}
+ Herse.Models
+
diff --git a/KaraokePlayer/MainForm.cs b/KaraokePlayer/MainForm.cs
index 270cfbf..304e493 100644
--- a/KaraokePlayer/MainForm.cs
+++ b/KaraokePlayer/MainForm.cs
@@ -10,6 +10,7 @@ using System.Windows.Forms;
using KaraokePlayer.Classes;
using System.Threading.Tasks;
using System.Configuration;
+using Herse.Models;
namespace KaraokePlayer
{
@@ -38,15 +39,15 @@ namespace KaraokePlayer
clientId: ConfigurationManager.AppSettings["KaraokePlayer.ControllerId"],
stateChanged: (args) =>
{
- if (args.State == Enums.PlayerState.Play)
+ if (args.State == PlayerState.Play)
{
this.Invoke(new Action(() => { play(); }));
}
- else if (args.State == Enums.PlayerState.Pause)
+ else if (args.State == PlayerState.Pause)
{
this.Invoke(new Action(() => { pause(); }));
}
- else if (args.State == Enums.PlayerState.Next)
+ else if (args.State == PlayerState.Next)
{
this.Invoke(new Action(() => { next(); }));
}
@@ -104,7 +105,7 @@ namespace KaraokePlayer
currentPlayer.Resume();
return;
}
- if (currentSong.FileType == Enums.FileType.CDG)
+ if (currentSong.FileType == FileType.CDG)
{
currentPlayer = karaokeCDGPlayer;
karaokeCDGPlayer.Play(new Uri(Path.ChangeExtension(currentSong.Path, ".mp3")));
@@ -112,7 +113,7 @@ namespace KaraokePlayer
karaokeMP4Player.Visible = false;
karaokeMP4Player.Stop();
}
- else if (currentSong.FileType == Enums.FileType.ZIP)
+ else if (currentSong.FileType == FileType.ZIP)
{
string playPath = null;
string extractPath = Path.Combine(Directory.GetCurrentDirectory(), "temp");
diff --git a/KaraokePlayer/SongInfoForm.cs b/KaraokePlayer/SongInfoForm.cs
index 3cbd206..0194109 100644
--- a/KaraokePlayer/SongInfoForm.cs
+++ b/KaraokePlayer/SongInfoForm.cs
@@ -1,4 +1,5 @@
-using KaraokePlayer.Classes;
+using Herse.Models;
+using KaraokePlayer.Classes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
diff --git a/SongCrawler/SongCrawler.csproj b/SongCrawler/SongCrawler.csproj
index 6aab986..1b2df11 100644
--- a/SongCrawler/SongCrawler.csproj
+++ b/SongCrawler/SongCrawler.csproj
@@ -85,13 +85,13 @@
-
- {BDE9BC7B-DB3D-4A28-9902-B5D8D1965E5C}
- Herse.Models
-
+
-
+
+ {f02eda00-aa8f-47ef-ac7f-66dc315aa13d}
+ Herse.Models
+