Add current songInfo to the Webserver and Site
This commit is contained in:
1 parent
8dfa321c8a
commit
197f003211
10 files changed
+196
-3
No files matched your search
@@ -28,6 +28,7 @@ using ClientServerLib;
|
||||
using Vocaluxe.Lib.Input;
|
||||
using VocaluxeLib;
|
||||
using VocaluxeLib.Profile;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
namespace Vocaluxe.Base.Server
|
||||
{
|
||||
@@ -59,6 +60,7 @@ namespace Vocaluxe.Base.Server
|
||||
CServer.GetProfileList = getProfileList;
|
||||
CServer.SendPhoto = sendPhoto;
|
||||
CServer.GetSiteFile = getSiteFile;
|
||||
CServer.GetCurrentSong = getCurrentSong;
|
||||
|
||||
_Discover = new CDiscover(CConfig.ServerPort, CCommands.BroadcastKeyword);
|
||||
Controller.Init();
|
||||
@@ -324,6 +326,28 @@ namespace Vocaluxe.Base.Server
|
||||
|
||||
#endregion
|
||||
|
||||
#region songs
|
||||
|
||||
private static SongInfo getCurrentSong()
|
||||
{
|
||||
SongInfo result = new SongInfo();
|
||||
CSong song = CGame.GetSong();
|
||||
if (song != null)
|
||||
{
|
||||
result.Title = song.Title;
|
||||
result.Artist = song.Artist;
|
||||
result.Genre = song.Genre.FirstOrDefault();
|
||||
result.Language = song.Language.FirstOrDefault();
|
||||
result.Year = song.Year;
|
||||
result.IsDuet = song.IsDuet;
|
||||
Image cover = Image.FromFile(song.Folder + "\\" + song.CoverFileName);
|
||||
result.Cover = new Base64Image(cover, cover.RawFormat);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private static string _SaveImage(Base64Image imageDate, string name, string folder)
|
||||
{
|
||||
Image avatarImage = imageDate.getImage();
|
||||
|
||||
Reference in new issue
Block a user