Song information over Webserver
This commit is contained in:
1 parent
197f003211
commit
fb0308b8d8
8 files changed
+172
-26
No files matched your search
@@ -43,7 +43,6 @@ namespace ClientServerLib
|
||||
set { CServer.getProfileList = value; }
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region photo
|
||||
@@ -69,13 +68,28 @@ namespace ClientServerLib
|
||||
|
||||
#region songs
|
||||
|
||||
private static GetCurrentSongDelegate getCurrentSong;
|
||||
public static GetCurrentSongDelegate GetCurrentSong
|
||||
private static GetSongDelegate getSong;
|
||||
public static GetSongDelegate GetSong
|
||||
{
|
||||
internal get { return CServer.getCurrentSong; }
|
||||
set { CServer.getCurrentSong = value; }
|
||||
internal get { return CServer.getSong; }
|
||||
set { CServer.getSong = value; }
|
||||
}
|
||||
|
||||
private static GetAllSongsDelegate getAllSongs;
|
||||
public static GetAllSongsDelegate GetAllSongs
|
||||
{
|
||||
get { return CServer.getAllSongs; }
|
||||
set { CServer.getAllSongs = value; }
|
||||
}
|
||||
|
||||
private static GetCurrentSongIdDelegate getCurrentSongId;
|
||||
public static GetCurrentSongIdDelegate GetCurrentSongId
|
||||
{
|
||||
get { return CServer.getCurrentSongId; }
|
||||
set { CServer.getCurrentSongId = value; }
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public CServer(int port)
|
||||
|
||||
@@ -90,8 +90,20 @@ namespace ClientServerLib
|
||||
[OperationContract]
|
||||
[WebInvoke(Method = "GET",
|
||||
ResponseFormat = WebMessageFormat.Json,
|
||||
UriTemplate = "/getCurrentSong")]
|
||||
SongInfo getCurrentSong();
|
||||
UriTemplate = "/getSong?songId={songId}")]
|
||||
SongInfo getSong(int songId);
|
||||
|
||||
[OperationContract]
|
||||
[WebInvoke(Method = "GET",
|
||||
ResponseFormat = WebMessageFormat.Json,
|
||||
UriTemplate = "/getCurrentSongId")]
|
||||
int getCurrentSongId();
|
||||
|
||||
[OperationContract]
|
||||
[WebInvoke(Method = "GET",
|
||||
ResponseFormat = WebMessageFormat.Json,
|
||||
UriTemplate = "/getAllSongs")]
|
||||
SongInfo[] getAllSongs();
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -249,11 +261,22 @@ namespace ClientServerLib
|
||||
|
||||
#region songs
|
||||
|
||||
public SongInfo getCurrentSong()
|
||||
public SongInfo getSong(int songId)
|
||||
{
|
||||
return CServer.GetCurrentSong();
|
||||
return CServer.GetSong(songId);
|
||||
}
|
||||
|
||||
public int getCurrentSongId()
|
||||
{
|
||||
return CServer.GetCurrentSongId();
|
||||
}
|
||||
|
||||
public SongInfo[] getAllSongs()
|
||||
{
|
||||
return CServer.GetAllSongs();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ using System.Text.RegularExpressions;
|
||||
namespace ClientServerLib
|
||||
{
|
||||
public delegate bool SendKeyEventDelegate(string key);
|
||||
|
||||
|
||||
|
||||
#region profile
|
||||
|
||||
@@ -93,7 +93,11 @@ namespace ClientServerLib
|
||||
|
||||
#region songs
|
||||
|
||||
public delegate SongInfo GetCurrentSongDelegate();
|
||||
public delegate SongInfo GetSongDelegate(int songId);
|
||||
|
||||
public delegate SongInfo[] GetAllSongsDelegate();
|
||||
|
||||
public delegate int GetCurrentSongIdDelegate();
|
||||
|
||||
[DataContract]
|
||||
public struct SongInfo
|
||||
@@ -112,6 +116,8 @@ namespace ClientServerLib
|
||||
public string Year { get; set; }
|
||||
[DataMember]
|
||||
public bool IsDuet { get; set; }
|
||||
[DataMember]
|
||||
public int SongId { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user