commit
90e2d50a5d
34 files changed
+1038
-106
No files matched your search
@@ -203,6 +203,18 @@ namespace ServerLib
|
|||||||
_Init(port, encrypted);
|
_Init(port, encrypted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetLocalAddress()
|
||||||
|
{
|
||||||
|
IPAddress[] ips = Dns.GetHostAddresses(Dns.GetHostName());
|
||||||
|
string IPAddress = "";
|
||||||
|
foreach (IPAddress ip in ips)
|
||||||
|
{
|
||||||
|
if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
||||||
|
IPAddress = ip.ToString();
|
||||||
|
}
|
||||||
|
return IPAddress;
|
||||||
|
}
|
||||||
|
|
||||||
#region server control
|
#region server control
|
||||||
|
|
||||||
private void _Init(int port, bool encrypted)
|
private void _Init(int port, bool encrypted)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace ServerLib
|
|||||||
internal static class CUserRoleControl
|
internal static class CUserRoleControl
|
||||||
{
|
{
|
||||||
private static readonly Dictionary<EUserRoles, EUserRights> _RoleRightsMapping = new Dictionary<EUserRoles, EUserRights> {
|
private static readonly Dictionary<EUserRoles, EUserRights> _RoleRightsMapping = new Dictionary<EUserRoles, EUserRights> {
|
||||||
{EUserRoles.Administrator,
|
{EUserRoles.TR_USERROLE_ADMIN,
|
||||||
(EUserRights.EditAllProfiles|
|
(EUserRights.EditAllProfiles|
|
||||||
EUserRights.UploadPhotos|
|
EUserRights.UploadPhotos|
|
||||||
EUserRights.ViewOtherProfiles|
|
EUserRights.ViewOtherProfiles|
|
||||||
@@ -16,10 +16,23 @@ namespace ServerLib
|
|||||||
EUserRights.CreatePlaylists|
|
EUserRights.CreatePlaylists|
|
||||||
EUserRights.DeletePlaylists|
|
EUserRights.DeletePlaylists|
|
||||||
EUserRights.RemoveSongsFromPlaylists)},
|
EUserRights.RemoveSongsFromPlaylists)},
|
||||||
{EUserRoles.AuthenticatedUser,
|
{EUserRoles.TR_USERROLE_GUEST,
|
||||||
|
EUserRights.None},
|
||||||
|
{EUserRoles.TR_USERROLE_NORMAL,
|
||||||
(EUserRights.UploadPhotos|
|
(EUserRights.UploadPhotos|
|
||||||
EUserRights.ViewOtherProfiles|
|
EUserRights.ViewOtherProfiles)},
|
||||||
EUserRights.UseKeyboard)}
|
{EUserRoles.TR_USERROLE_KEYBOARDUSER,
|
||||||
|
EUserRights.UseKeyboard},
|
||||||
|
{EUserRoles.TR_USERROLE_ADDSONGSUSER,
|
||||||
|
EUserRights.AddSongToPlaylist},
|
||||||
|
{EUserRoles.TR_USERROLE_PLAYLISTEDITOR,
|
||||||
|
(EUserRights.AddSongToPlaylist|
|
||||||
|
EUserRights.ReorderPlaylists|
|
||||||
|
EUserRights.CreatePlaylists|
|
||||||
|
EUserRights.DeletePlaylists|
|
||||||
|
EUserRights.RemoveSongsFromPlaylists)},
|
||||||
|
{EUserRoles.TR_USERROLE_PROFILEEDITOR,
|
||||||
|
EUserRights.EditAllProfiles}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ namespace ServerLib
|
|||||||
[Flags]
|
[Flags]
|
||||||
internal enum EUserRoles
|
internal enum EUserRoles
|
||||||
{
|
{
|
||||||
AuthenticatedUser = 0,
|
TR_USERROLE_GUEST = 0,
|
||||||
Administrator = 1
|
TR_USERROLE_NORMAL = 1,
|
||||||
|
TR_USERROLE_ADMIN = 2,
|
||||||
|
TR_USERROLE_KEYBOARDUSER = 4,
|
||||||
|
TR_USERROLE_ADDSONGSUSER = 8,
|
||||||
|
TR_USERROLE_PLAYLISTEDITOR = 16,
|
||||||
|
TR_USERROLE_PROFILEEDITOR = 32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
// QRCode.dll from https://github.com/codebude/QRCoder/
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013 Raffael Herrmann
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
@@ -26,6 +26,9 @@
|
|||||||
<string name="TR_RATING_WANNABE">Wannabe</string>
|
<string name="TR_RATING_WANNABE">Wannabe</string>
|
||||||
<string name="TR_RATING_AMATEUR">Amateur</string>
|
<string name="TR_RATING_AMATEUR">Amateur</string>
|
||||||
<string name="TR_RATING_TONE_DEAF">Tone Deaf</string>
|
<string name="TR_RATING_TONE_DEAF">Tone Deaf</string>
|
||||||
|
<string name="TR_USERROLE_GUEST">Guest</string>
|
||||||
|
<string name="TR_USERROLE_NORMAL">Normal User</string>
|
||||||
|
<string name="TR_USERROLE_ADMIN">Administrator</string>
|
||||||
<string name="TR_CONFIG_SOFTWARE">Software</string>
|
<string name="TR_CONFIG_SOFTWARE">Software</string>
|
||||||
<string name="TR_CONFIG_OPENGL">OpenGL</string>
|
<string name="TR_CONFIG_OPENGL">OpenGL</string>
|
||||||
<string name="TR_CONFIG_DIRECT3D">Direct3D</string>
|
<string name="TR_CONFIG_DIRECT3D">Direct3D</string>
|
||||||
@@ -147,7 +150,7 @@
|
|||||||
<string name="TR_SCREENPROFILES_PLAYERNAME">Player Name</string>
|
<string name="TR_SCREENPROFILES_PLAYERNAME">Player Name</string>
|
||||||
<string name="TR_SCREENPROFILES_GAMEDIFFICULTY">Game Difficulty</string>
|
<string name="TR_SCREENPROFILES_GAMEDIFFICULTY">Game Difficulty</string>
|
||||||
<string name="TR_SCREENPROFILES_AVATAR">Avatar</string>
|
<string name="TR_SCREENPROFILES_AVATAR">Avatar</string>
|
||||||
<string name="TR_SCREENPROFILES_GUESTPROFILE">Guest Profile</string>
|
<string name="TR_SCREENPROFILES_USERROLE">User Role</string>
|
||||||
<string name="TR_SCREENPROFILES_ACTIVE">Active</string>
|
<string name="TR_SCREENPROFILES_ACTIVE">Active</string>
|
||||||
<string name="TR_SCREENPROFILES_BUTTON_NEW">New</string>
|
<string name="TR_SCREENPROFILES_BUTTON_NEW">New</string>
|
||||||
<string name="TR_SCREENPROFILES_BUTTON_DELETE">Delete</string>
|
<string name="TR_SCREENPROFILES_BUTTON_DELETE">Delete</string>
|
||||||
@@ -162,6 +165,7 @@
|
|||||||
<string name="TR_SCREENO_BUTTON_VIDEO">Video</string>
|
<string name="TR_SCREENO_BUTTON_VIDEO">Video</string>
|
||||||
<string name="TR_SCREENO_BUTTON_LYRICS">Lyrics</string>
|
<string name="TR_SCREENO_BUTTON_LYRICS">Lyrics</string>
|
||||||
<string name="TR_SCREENO_BUTTON_THEME">Theme</string>
|
<string name="TR_SCREENO_BUTTON_THEME">Theme</string>
|
||||||
|
<string name="TR_SCREENOGAME_BUTTON_SERVER">Server address</string>
|
||||||
<string name="TR_SCREENOGAME_OPTIONS">Game Options</string>
|
<string name="TR_SCREENOGAME_OPTIONS">Game Options</string>
|
||||||
<string name="TR_SCREENOGAME_LANGUAGE">Language</string>
|
<string name="TR_SCREENOGAME_LANGUAGE">Language</string>
|
||||||
<string name="TR_SCREENOGAME_DEBUGLEVEL">Debug Level</string>
|
<string name="TR_SCREENOGAME_DEBUGLEVEL">Debug Level</string>
|
||||||
@@ -204,4 +208,5 @@
|
|||||||
<string name="TR_SCREENO_VIDEO_WEBCAMDEVICES">Webcams</string>
|
<string name="TR_SCREENO_VIDEO_WEBCAMDEVICES">Webcams</string>
|
||||||
<string name="TR_SCREENO_VIDEO_WEBCAMCAPABILITIES">Webcamcapabilities</string>
|
<string name="TR_SCREENO_VIDEO_WEBCAMCAPABILITIES">Webcamcapabilities</string>
|
||||||
<string name="TR_SCREENPVOLUMECONTROL_VOLUME">Volume</string>
|
<string name="TR_SCREENPVOLUMECONTROL_VOLUME">Volume</string>
|
||||||
|
<string name="TR_SCREENPSERVERQR_ADDRESS">Server address</string>
|
||||||
</resources>
|
</resources>
|
||||||
Binary file not shown.
@@ -0,0 +1,285 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<PopupScreenServerQR>
|
||||||
|
<ScreenVersion>1</ScreenVersion>
|
||||||
|
<Static1>
|
||||||
|
<!--<Skin>: Texture name-->
|
||||||
|
<Skin>SongMenuBG</Skin>
|
||||||
|
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
|
||||||
|
<X>0</X>
|
||||||
|
<Y>0</Y>
|
||||||
|
<Z>-1,99</Z>
|
||||||
|
<W>1280</W>
|
||||||
|
<H>720</H>
|
||||||
|
<!--<Color>: Static color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<R>1,00</R>
|
||||||
|
<G>1,00</G>
|
||||||
|
<B>1,00</B>
|
||||||
|
<A>0,80</A>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</Static1>
|
||||||
|
<StaticQRServer>
|
||||||
|
<!--<Skin>: Texture name-->
|
||||||
|
<Skin>Menu</Skin>
|
||||||
|
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
|
||||||
|
<X>490</X>
|
||||||
|
<Y>210</Y>
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<W>300</W>
|
||||||
|
<H>300</H>
|
||||||
|
<!--<Color>: Static color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>Visible</Color>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</StaticQRServer>
|
||||||
|
<StaticQRAndroid>
|
||||||
|
<!--<Skin>: Texture name-->
|
||||||
|
<Skin>Menu</Skin>
|
||||||
|
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
|
||||||
|
<X>25</X>
|
||||||
|
<Y>25</Y>
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<W>200</W>
|
||||||
|
<H>200</H>
|
||||||
|
<!--<Color>: Static color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>Visible</Color>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</StaticQRAndroid>
|
||||||
|
<StaticQRSymbian>
|
||||||
|
<!--<Skin>: Texture name-->
|
||||||
|
<Skin>Menu</Skin>
|
||||||
|
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
|
||||||
|
<X>1055</X>
|
||||||
|
<Y>25</Y>
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<W>200</W>
|
||||||
|
<H>200</H>
|
||||||
|
<!--<Color>: Static color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>Visible</Color>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</StaticQRSymbian>
|
||||||
|
<StaticQRWebOS>
|
||||||
|
<!--<Skin>: Texture name-->
|
||||||
|
<Skin>Menu</Skin>
|
||||||
|
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
|
||||||
|
<X>25</X>
|
||||||
|
<Y>495</Y>
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<W>200</W>
|
||||||
|
<H>200</H>
|
||||||
|
<!--<Color>: Static color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>Visible</Color>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</StaticQRWebOS>
|
||||||
|
<StaticQRWindowsPhone>
|
||||||
|
<!--<Skin>: Texture name-->
|
||||||
|
<Skin>Menu</Skin>
|
||||||
|
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
|
||||||
|
<X>1055</X>
|
||||||
|
<Y>495</Y>
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<W>200</W>
|
||||||
|
<H>200</H>
|
||||||
|
<!--<Color>: Static color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>Visible</Color>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</StaticQRWindowsPhone>
|
||||||
|
<TextServerAddress>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>640</X>
|
||||||
|
<Y>515</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>35</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>300</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>StaticColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextSColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text />
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</TextServerAddress>
|
||||||
|
<Text1>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>640</X>
|
||||||
|
<Y>180</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>35</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>300</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>StaticColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextSColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text>TR_SCREENPSERVERQR_ADDRESS</Text>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</Text1>
|
||||||
|
<Text2>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>125</X>
|
||||||
|
<Y>230</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>27</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>200</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>StaticColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextSColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text>Android</Text>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</Text2>
|
||||||
|
<Text3>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>1155</X>
|
||||||
|
<Y>230</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>27</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>200</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>StaticColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextSColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text>Symbian</Text>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</Text3>
|
||||||
|
<Text4>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>125</X>
|
||||||
|
<Y>460</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>27</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>200</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>StaticColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextSColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text>WebOS</Text>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</Text4>
|
||||||
|
<Text5>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>1155</X>
|
||||||
|
<Y>460</Y>
|
||||||
|
<!--<Z>: Text position-->
|
||||||
|
<Z>-2,00</Z>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>27</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>200</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>StaticColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>TextSColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text>Windows Phone</Text>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
</Text5>
|
||||||
|
</PopupScreenServerQR>
|
||||||
|
</root>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<ScreenOptionsGame>
|
<ScreenOptionsGame>
|
||||||
<ScreenVersion>1</ScreenVersion>
|
<ScreenVersion>2</ScreenVersion>
|
||||||
<Background1>
|
<Background1>
|
||||||
<!--<Type>: Background type: None, Color, Texture, Video-->
|
<!--<Type>: Background type: None, Color, Texture, Video-->
|
||||||
<Type>Video</Type>
|
<Type>Video</Type>
|
||||||
@@ -385,6 +385,63 @@
|
|||||||
<Height>26</Height>
|
<Height>26</Height>
|
||||||
</SReflection>
|
</SReflection>
|
||||||
</ButtonExit>
|
</ButtonExit>
|
||||||
|
<ButtonServer>
|
||||||
|
<!--<Skin>: Texture name-->
|
||||||
|
<Skin>Button</Skin>
|
||||||
|
<!--<SkinSelected>: Texture name for selected button-->
|
||||||
|
<SkinSelected>Button</SkinSelected>
|
||||||
|
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
|
||||||
|
<X>355</X>
|
||||||
|
<Y>600</Y>
|
||||||
|
<Z>0,00</Z>
|
||||||
|
<W>150</W>
|
||||||
|
<H>50</H>
|
||||||
|
<!--<Color>: Button color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>ButtonColor</Color>
|
||||||
|
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>ButtonSColor</SColor>
|
||||||
|
<Text>
|
||||||
|
<!--<X>, <Y>: Text position-->
|
||||||
|
<X>75</X>
|
||||||
|
<Y>12</Y>
|
||||||
|
<!--<H>: Text height-->
|
||||||
|
<H>27</H>
|
||||||
|
<!--<MaxW>: Maximum text width (if exists)-->
|
||||||
|
<MaxW>142</MaxW>
|
||||||
|
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
|
<Color>ButtonTextColor</Color>
|
||||||
|
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
||||||
|
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
||||||
|
<SColor>ButtonTextSColor</SColor>
|
||||||
|
<!--<Align>: Text align horizontal: Left, Center, Right-->
|
||||||
|
<Align>Center</Align>
|
||||||
|
<!--<ResizeAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
|
||||||
|
<HAlign>Center</HAlign>
|
||||||
|
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<!--<Font>: Text font name-->
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<!--<Text>: Nothing or translation tag-->
|
||||||
|
<Text>TR_SCREENOGAME_BUTTON_SERVER</Text>
|
||||||
|
</Text>
|
||||||
|
<!--<Reflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space-->
|
||||||
|
<!-- <Height>: Reflection Height-->
|
||||||
|
<Reflection>
|
||||||
|
<Space>10</Space>
|
||||||
|
<Height>26</Height>
|
||||||
|
</Reflection>
|
||||||
|
<!--<SReflection> If exists:-->
|
||||||
|
<!-- <Space>: Reflection Space of selected button-->
|
||||||
|
<!-- <Height>: Reflection Height of selected button-->
|
||||||
|
<SReflection>
|
||||||
|
<Space>10</Space>
|
||||||
|
<Height>26</Height>
|
||||||
|
</SReflection>
|
||||||
|
</ButtonServer>
|
||||||
<SelectSlideLanguage>
|
<SelectSlideLanguage>
|
||||||
<!--<Skin>: Texture name-->
|
<!--<Skin>: Texture name-->
|
||||||
<Skin>Invisible</Skin>
|
<Skin>Invisible</Skin>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<ScreenProfiles>
|
<ScreenProfiles>
|
||||||
<ScreenVersion>2</ScreenVersion>
|
<ScreenVersion>3</ScreenVersion>
|
||||||
<Background1>
|
<Background1>
|
||||||
<!--<Type>: Background type: None, Color, Texture, Video-->
|
<!--<Type>: Background type: None, Color, Texture, Video-->
|
||||||
<Type>Video</Type>
|
<Type>Video</Type>
|
||||||
@@ -265,7 +265,7 @@
|
|||||||
<!--<Font>: Text font name-->
|
<!--<Font>: Text font name-->
|
||||||
<Font>Outline</Font>
|
<Font>Outline</Font>
|
||||||
<!--<Text>: Nothing or translation tag-->
|
<!--<Text>: Nothing or translation tag-->
|
||||||
<Text>TR_SCREENPROFILES_GUESTPROFILE</Text>
|
<Text>TR_SCREENPROFILES_USERROLE</Text>
|
||||||
<!--<Reflection> If exists:-->
|
<!--<Reflection> If exists:-->
|
||||||
<!-- <Space>: Reflection Space-->
|
<!-- <Space>: Reflection Space-->
|
||||||
<!-- <Height>: Reflection Height-->
|
<!-- <Height>: Reflection Height-->
|
||||||
@@ -989,7 +989,7 @@
|
|||||||
<!--<NumVisible>: Number of visible elements in the slide-->
|
<!--<NumVisible>: Number of visible elements in the slide-->
|
||||||
<NumVisible>3</NumVisible>
|
<NumVisible>3</NumVisible>
|
||||||
</SelectSlideAvatars>
|
</SelectSlideAvatars>
|
||||||
<SelectSlideGuestProfile>
|
<SelectSlideUserRole>
|
||||||
<!--<Skin>: Texture name-->
|
<!--<Skin>: Texture name-->
|
||||||
<Skin>Invisible</Skin>
|
<Skin>Invisible</Skin>
|
||||||
<!--<SkinArrowLeft>: Texture name of left arrow-->
|
<!--<SkinArrowLeft>: Texture name of left arrow-->
|
||||||
@@ -1055,7 +1055,7 @@
|
|||||||
<TextStyle>Bold</TextStyle>
|
<TextStyle>Bold</TextStyle>
|
||||||
<!--<NumVisible>: Number of visible elements in the slide-->
|
<!--<NumVisible>: Number of visible elements in the slide-->
|
||||||
<NumVisible>2</NumVisible>
|
<NumVisible>2</NumVisible>
|
||||||
</SelectSlideGuestProfile>
|
</SelectSlideUserRole>
|
||||||
<SelectSlideActive>
|
<SelectSlideActive>
|
||||||
<!--<Skin>: Texture name-->
|
<!--<Skin>: Texture name-->
|
||||||
<Skin>Invisible</Skin>
|
<Skin>Invisible</Skin>
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
ScreenOptionsGame
|
||||||
|
|
||||||
|
++++++++++
|
||||||
|
Version 2:
|
||||||
|
|
||||||
|
Add:
|
||||||
|
<ButtonServer>
|
||||||
|
++++++++++
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
ScreenProfiles
|
ScreenProfiles
|
||||||
|
++++++++++
|
||||||
|
Version 3:
|
||||||
|
Rename: <SelectSlideGuestProfile> to <SelectSlideUserRole>
|
||||||
|
|
||||||
++++++++++
|
++++++++++
|
||||||
Version 2:
|
Version 2:
|
||||||
|
|||||||
@@ -513,12 +513,18 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Calc avarage sing-count
|
||||||
|
int totalCounts = 0;
|
||||||
|
foreach (CSong song in visibleSongs)
|
||||||
|
totalCounts += song.NumPlayedSession;
|
||||||
|
int averageCount = totalCounts / visibleSongs.Count;
|
||||||
|
|
||||||
// ReSharper disable LoopCanBeConvertedToQuery
|
// ReSharper disable LoopCanBeConvertedToQuery
|
||||||
foreach (CSong song in visibleSongs)
|
foreach (CSong song in visibleSongs)
|
||||||
{
|
{
|
||||||
foreach (EGameMode mode in song.AvailableGameModes)
|
foreach (EGameMode mode in song.AvailableGameModes)
|
||||||
{
|
{
|
||||||
if (mode == EGameMode.TR_GAMEMODE_MEDLEY)
|
if (mode == EGameMode.TR_GAMEMODE_MEDLEY && song.NumPlayedSession <= averageCount)
|
||||||
ids.Add(song.ID);
|
ids.Add(song.ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
_PopupScreens.Add(new CPopupScreenPlayerControl());
|
_PopupScreens.Add(new CPopupScreenPlayerControl());
|
||||||
_PopupScreens.Add(new CPopupScreenVolumeControl());
|
_PopupScreens.Add(new CPopupScreenVolumeControl());
|
||||||
|
_PopupScreens.Add(new CPopupScreenServerQR());
|
||||||
|
|
||||||
CLog.StopBenchmark(1, "Build Screen List");
|
CLog.StopBenchmark(1, "Build Screen List");
|
||||||
|
|
||||||
@@ -379,6 +380,14 @@ namespace Vocaluxe.Base
|
|||||||
_Cursor.FadeOut();
|
_Cursor.FadeOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (keyEvent.Key == Keys.F11)
|
||||||
|
{
|
||||||
|
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
|
||||||
|
ShowPopup(EPopupScreens.PopupServerQR);
|
||||||
|
else
|
||||||
|
HidePopup(EPopupScreens.PopupServerQR);
|
||||||
|
}
|
||||||
|
|
||||||
if (popupPlayerControlAllowed && keyEvent.Key == Keys.Tab)
|
if (popupPlayerControlAllowed && keyEvent.Key == Keys.Tab)
|
||||||
{
|
{
|
||||||
if (_CurrentPopupScreen == EPopupScreens.NoPopup && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
|
if (_CurrentPopupScreen == EPopupScreens.NoPopup && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
|
||||||
|
|||||||
@@ -233,6 +233,16 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
return CSettings.DataPath;
|
return CSettings.DataPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float GetSlideShowImageTime()
|
||||||
|
{
|
||||||
|
return CSettings.SlideShowImageTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetSlideShowFadeTime()
|
||||||
|
{
|
||||||
|
return CSettings.SlideShowFadeTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CBtheme : ITheme
|
class CBtheme : ITheme
|
||||||
|
|||||||
+15
-13
@@ -212,7 +212,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void LoadProfiles()
|
public static void LoadProfiles()
|
||||||
{
|
{
|
||||||
var change = new SChange {Action = EAction.LoadProfiles};
|
var change = new SChange { Action = EAction.LoadProfiles };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -222,7 +222,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void LoadAvatars()
|
public static void LoadAvatars()
|
||||||
{
|
{
|
||||||
var change = new SChange {Action = EAction.LoadAvatars};
|
var change = new SChange { Action = EAction.LoadAvatars };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -235,7 +235,7 @@ namespace Vocaluxe.Base
|
|||||||
if (newProfile == null)
|
if (newProfile == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.AddProfile, Profile = newProfile};
|
var change = new SChange { Action = EAction.AddProfile, Profile = newProfile };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -248,7 +248,7 @@ namespace Vocaluxe.Base
|
|||||||
if (editProfile == null)
|
if (editProfile == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.EditProfile, Profile = editProfile};
|
var change = new SChange { Action = EAction.EditProfile, Profile = editProfile };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -261,7 +261,7 @@ namespace Vocaluxe.Base
|
|||||||
if (!IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.DeleteProfile, ProfileID = profileID};
|
var change = new SChange { Action = EAction.DeleteProfile, ProfileID = profileID };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -274,7 +274,7 @@ namespace Vocaluxe.Base
|
|||||||
if (newAvatar == null)
|
if (newAvatar == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.AddAvatar, Avatar = newAvatar};
|
var change = new SChange { Action = EAction.AddAvatar, Avatar = newAvatar };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -287,7 +287,7 @@ namespace Vocaluxe.Base
|
|||||||
if (editAvatar == null)
|
if (editAvatar == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.EditAvatar, Avatar = editAvatar};
|
var change = new SChange { Action = EAction.EditAvatar, Avatar = editAvatar };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -433,17 +433,19 @@ namespace Vocaluxe.Base
|
|||||||
_Profiles[profileID].Difficulty = difficulty;
|
_Profiles[profileID].Difficulty = difficulty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EOffOn GetGuestProfile(int profileID)
|
public static EUserRole GetUserRoleProfile(int profileID)
|
||||||
{
|
{
|
||||||
return IsProfileIDValid(profileID) ? _Profiles[profileID].GuestProfile : EOffOn.TR_CONFIG_OFF;
|
return IsProfileIDValid(profileID) ? _Profiles[profileID].UserRole : EUserRole.TR_USERROLE_GUEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetGuestProfile(int profileID, EOffOn option)
|
public static void SetUserRoleProfile(int profileID, EUserRole option)
|
||||||
{
|
{
|
||||||
if (!IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
|
//Only allow the change of TR_USERROLE_GUEST, TR_USERROLE_NORMAL and TR_USERROLE_ADMIN
|
||||||
_Profiles[profileID].GuestProfile = option;
|
const EUserRole mask = (EUserRole.TR_USERROLE_GUEST | EUserRole.TR_USERROLE_NORMAL | EUserRole.TR_USERROLE_ADMIN);
|
||||||
|
option &= mask;
|
||||||
|
_Profiles[profileID].UserRole = (_Profiles[profileID].UserRole & ~mask) | option;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EOffOn GetActive(int profileID)
|
public static EOffOn GetActive(int profileID)
|
||||||
@@ -464,7 +466,7 @@ namespace Vocaluxe.Base
|
|||||||
if (!IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return true; // this will prevent from saving dummy profiles to highscore db
|
return true; // this will prevent from saving dummy profiles to highscore db
|
||||||
|
|
||||||
return _Profiles[profileID].GuestProfile == EOffOn.TR_CONFIG_ON;
|
return _Profiles[profileID].UserRole.HasFlag(EUserRole.TR_USERROLE_GUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsActive(int profileID)
|
public static bool IsActive(int profileID)
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ namespace Vocaluxe.Base
|
|||||||
public const string FolderPartyModeLanguages = "Languages";
|
public const string FolderPartyModeLanguages = "Languages";
|
||||||
public const string FolderPartyModeFonts = "Fonts";
|
public const string FolderPartyModeFonts = "Fonts";
|
||||||
|
|
||||||
|
public const string LinkAndroidApp = "https://build.phonegap.com/apps/639714/download/android/?qr_key=uY98ymvTr6K144RyTdhs";
|
||||||
|
public const string LinkSymbianApp = "https://build.phonegap.com/apps/639714/download/symbian/?qr_key=uY98ymvTr6K144RyTdhs";
|
||||||
|
public const string LinkWebOSApp = "https://build.phonegap.com/apps/639714/download/webos/?qr_key=uY98ymvTr6K144RyTdhs";
|
||||||
|
public const string LinkWindowsPhoneApp = "https://build.phonegap.com/apps/639714/download/winphone/?qr_key=uY98ymvTr6K144RyTdhs";
|
||||||
|
|
||||||
//public const String[] ToneStrings = new String[]{ "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
|
//public const String[] ToneStrings = new String[]{ "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
|
||||||
public const int ToneMin = -36;
|
public const int ToneMin = -36;
|
||||||
public const int ToneMax = 89;
|
public const int ToneMax = 89;
|
||||||
@@ -143,6 +148,9 @@ namespace Vocaluxe.Base
|
|||||||
public const float BackgroundMusicFadeTime = 0.5f;
|
public const float BackgroundMusicFadeTime = 0.5f;
|
||||||
public const float PauseResetTime = 1f;
|
public const float PauseResetTime = 1f;
|
||||||
|
|
||||||
|
public const float SlideShowImageTime = 3500f;
|
||||||
|
public const float SlideShowFadeTime = 500f;
|
||||||
|
|
||||||
public static readonly List<string> MusicFileTypes = new List<string>
|
public static readonly List<string> MusicFileTypes = new List<string>
|
||||||
{
|
{
|
||||||
"*.mp3",
|
"*.mp3",
|
||||||
|
|||||||
+14
-1
@@ -217,7 +217,20 @@ namespace Vocaluxe.Base
|
|||||||
public static void UpdateRandomSongList()
|
public static void UpdateRandomSongList()
|
||||||
{
|
{
|
||||||
_SongsForRandom.Clear();
|
_SongsForRandom.Clear();
|
||||||
_SongsForRandom.AddRange(VisibleSongs);
|
//Calc avarage sing-count
|
||||||
|
int totalCounts = 0;
|
||||||
|
foreach (CSong song in VisibleSongs)
|
||||||
|
totalCounts += song.NumPlayedSession;
|
||||||
|
int averageCount = totalCounts / NumSongsVisible;
|
||||||
|
|
||||||
|
foreach(CSong song in VisibleSongs)
|
||||||
|
{
|
||||||
|
if (song.NumPlayedSession <= averageCount)
|
||||||
|
_SongsForRandom.Add(song);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_SongsForRandom.Count == 0)
|
||||||
|
_SongsForRandom.AddRange(VisibleSongs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetRandomCategory()
|
public static int GetRandomCategory()
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ namespace Vocaluxe.Base.Server
|
|||||||
AvatarFileName = existingProfile.AvatarFileName,
|
AvatarFileName = existingProfile.AvatarFileName,
|
||||||
Avatar = existingProfile.Avatar,
|
Avatar = existingProfile.Avatar,
|
||||||
Difficulty = existingProfile.Difficulty,
|
Difficulty = existingProfile.Difficulty,
|
||||||
GuestProfile = existingProfile.GuestProfile,
|
UserRole = existingProfile.UserRole,
|
||||||
PlayerName = existingProfile.PlayerName
|
PlayerName = existingProfile.PlayerName
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ namespace Vocaluxe.Base.Server
|
|||||||
newProfile = new CProfile
|
newProfile = new CProfile
|
||||||
{
|
{
|
||||||
Active = EOffOn.TR_CONFIG_ON,
|
Active = EOffOn.TR_CONFIG_ON,
|
||||||
GuestProfile = EOffOn.TR_CONFIG_OFF
|
UserRole = EUserRole.TR_USERROLE_NORMAL
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +228,10 @@ namespace Vocaluxe.Base.Server
|
|||||||
|
|
||||||
if (profile.Type >= 0 && profile.Type <= 1)
|
if (profile.Type >= 0 && profile.Type <= 1)
|
||||||
{
|
{
|
||||||
newProfile.GuestProfile = (EOffOn)profile.Type;
|
var option = profile.Type == 0 ? EUserRole.TR_USERROLE_GUEST : EUserRole.TR_USERROLE_NORMAL;
|
||||||
|
//Only allow the change of TR_USERROLE_GUEST and TR_USERROLE_NORMAL
|
||||||
|
const EUserRole mask = EUserRole.TR_USERROLE_NORMAL;
|
||||||
|
newProfile.UserRole = (newProfile.UserRole & mask) | option;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(profile.Password))
|
if (!string.IsNullOrEmpty(profile.Password))
|
||||||
@@ -281,7 +284,8 @@ namespace Vocaluxe.Base.Server
|
|||||||
IsEditable = !isReadonly,
|
IsEditable = !isReadonly,
|
||||||
ProfileId = profile.ID,
|
ProfileId = profile.ID,
|
||||||
PlayerName = profile.PlayerName,
|
PlayerName = profile.PlayerName,
|
||||||
Type = (int)profile.GuestProfile,
|
//Is TR_USERROLE_GUEST or TR_USERROLE_NORMAL?
|
||||||
|
Type = (profile.UserRole.HasFlag(EUserRole.TR_USERROLE_NORMAL)?1:0),
|
||||||
Difficulty = (int)profile.Difficulty
|
Difficulty = (int)profile.Difficulty
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -673,7 +677,10 @@ namespace Vocaluxe.Base.Server
|
|||||||
throw new ArgumentException("Invalid profileId");
|
throw new ArgumentException("Invalid profileId");
|
||||||
}
|
}
|
||||||
|
|
||||||
return profile.UserRoles;
|
//Hide TR_USERROLE_GUEST and TR_USERROLE_NORMAL
|
||||||
|
const EUserRole mask = (EUserRole.TR_USERROLE_GUEST | EUserRole.TR_USERROLE_NORMAL);
|
||||||
|
|
||||||
|
return (int)(profile.UserRole & ~mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void _SetUserRole(int profileId, int userRole)
|
private static void _SetUserRole(int profileId, int userRole)
|
||||||
@@ -684,7 +691,13 @@ namespace Vocaluxe.Base.Server
|
|||||||
throw new ArgumentException("Invalid profileId");
|
throw new ArgumentException("Invalid profileId");
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.UserRoles = userRole;
|
var option = (EUserRole)userRole;
|
||||||
|
|
||||||
|
//Only allow the change of all options exept TR_USERROLE_GUEST and TR_USERROLE_NORMAL
|
||||||
|
const EUserRole mask = (EUserRole.TR_USERROLE_GUEST | EUserRole.TR_USERROLE_NORMAL);
|
||||||
|
option &= ~mask;
|
||||||
|
|
||||||
|
profile.UserRole = (profile.UserRole & mask) | option;
|
||||||
|
|
||||||
CProfiles.EditProfile(profile);
|
CProfiles.EditProfile(profile);
|
||||||
CProfiles.Update();
|
CProfiles.Update();
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
#region license
|
||||||
|
// This file is part of Vocaluxe.
|
||||||
|
//
|
||||||
|
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// Vocaluxe is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using ServerLib;
|
||||||
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib;
|
||||||
|
using VocaluxeLib.Menu;
|
||||||
|
using VocaluxeLib.Draw;
|
||||||
|
using QRCoder;
|
||||||
|
|
||||||
|
namespace Vocaluxe.Screens
|
||||||
|
{
|
||||||
|
class CPopupScreenServerQR : CMenu
|
||||||
|
{
|
||||||
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private CTexture _QRServerAddress;
|
||||||
|
private CTexture _QRAndroidLink;
|
||||||
|
private CTexture _QRSymbianLink;
|
||||||
|
private CTexture _QRWebOSLink;
|
||||||
|
private CTexture _QRWindowsPhoneLink;
|
||||||
|
|
||||||
|
private const string _StaticQRServer = "StaticQRServer";
|
||||||
|
private const string _StaticQRAndroid = "StaticQRAndroid";
|
||||||
|
private const string _StaticQRSymbian = "StaticQRSymbian";
|
||||||
|
private const string _StaticQRWebOS = "StaticQRWebOS";
|
||||||
|
private const string _StaticQRWindowsPhone = "StaticQRWindowsPhone";
|
||||||
|
|
||||||
|
private const string _TextServerAddress = "TextServerAddress";
|
||||||
|
|
||||||
|
public override void Init()
|
||||||
|
{
|
||||||
|
base.Init();
|
||||||
|
|
||||||
|
_ThemeStatics = new string[] { _StaticQRServer, _StaticQRAndroid, _StaticQRSymbian, _StaticQRWebOS, _StaticQRWindowsPhone };
|
||||||
|
_ThemeTexts = new string[] { _TextServerAddress };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void LoadTheme(string xmlPath)
|
||||||
|
{
|
||||||
|
base.LoadTheme(xmlPath);
|
||||||
|
_GenerateQRs();
|
||||||
|
_Statics[_StaticQRServer].Texture = _QRServerAddress;
|
||||||
|
_Statics[_StaticQRAndroid].Texture = _QRAndroidLink;
|
||||||
|
_Statics[_StaticQRSymbian].Texture = _QRSymbianLink;
|
||||||
|
_Statics[_StaticQRWebOS].Texture = _QRWebOSLink;
|
||||||
|
_Statics[_StaticQRWindowsPhone].Texture = _QRWindowsPhoneLink;
|
||||||
|
_Texts[_TextServerAddress].Text = CServer.GetLocalAddress() + ":" + CConfig.ServerPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool HandleMouse(SMouseEvent mouseEvent)
|
||||||
|
{
|
||||||
|
if (mouseEvent.LB)
|
||||||
|
{
|
||||||
|
CGraphics.HidePopup(EPopupScreens.PopupServerQR);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool UpdateGame()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Draw()
|
||||||
|
{
|
||||||
|
if (!_Active)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return base.Draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void _GenerateQRs()
|
||||||
|
{
|
||||||
|
QRCodeGenerator qr = new QRCodeGenerator();
|
||||||
|
|
||||||
|
//ServerAddress
|
||||||
|
QRCodeGenerator.QRCode qrcode = qr.CreateQrCode(CServer.GetLocalAddress() + ":" + CConfig.ServerPort, QRCodeGenerator.ECCLevel.H);
|
||||||
|
_QRServerAddress = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||||
|
|
||||||
|
//Android
|
||||||
|
qrcode = qr.CreateQrCode(CSettings.LinkAndroidApp, QRCodeGenerator.ECCLevel.H);
|
||||||
|
_QRAndroidLink = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||||
|
|
||||||
|
//Symbian
|
||||||
|
qrcode = qr.CreateQrCode(CSettings.LinkSymbianApp, QRCodeGenerator.ECCLevel.H);
|
||||||
|
_QRSymbianLink = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||||
|
|
||||||
|
//WebOS
|
||||||
|
qrcode = qr.CreateQrCode(CSettings.LinkWebOSApp, QRCodeGenerator.ECCLevel.H);
|
||||||
|
_QRWebOSLink = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||||
|
|
||||||
|
//WindowsPhone
|
||||||
|
qrcode = qr.CreateQrCode(CSettings.LinkWindowsPhoneApp, QRCodeGenerator.ECCLevel.H);
|
||||||
|
_QRWindowsPhoneLink = CDraw.AddTexture(qrcode.GetGraphic(20));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ namespace Vocaluxe.Screens
|
|||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion
|
protected override int _ScreenVersion
|
||||||
{
|
{
|
||||||
get { return 1; }
|
get { return 2; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string _SelectSlideLanguage = "SelectSlideLanguage";
|
private const string _SelectSlideLanguage = "SelectSlideLanguage";
|
||||||
@@ -38,12 +38,13 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _SelectSlideTimerMode = "SelectSlideTimerMode";
|
private const string _SelectSlideTimerMode = "SelectSlideTimerMode";
|
||||||
|
|
||||||
private const string _ButtonExit = "ButtonExit";
|
private const string _ButtonExit = "ButtonExit";
|
||||||
|
private const string _ButtonServer = "ButtonServer";
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeButtons = new string[] {_ButtonExit};
|
_ThemeButtons = new string[] {_ButtonExit, _ButtonServer};
|
||||||
_ThemeSelectSlides = new string[] {_SelectSlideLanguage, _SelectSlideDebugLevel, _SelectSlideSongMenu, _SelectSlideSongSorting, _SelectSlideTabs, _SelectSlideTimerMode};
|
_ThemeSelectSlides = new string[] {_SelectSlideLanguage, _SelectSlideDebugLevel, _SelectSlideSongMenu, _SelectSlideSongSorting, _SelectSlideTabs, _SelectSlideTimerMode};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +87,8 @@ namespace Vocaluxe.Screens
|
|||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreens.ScreenOptions);
|
CGraphics.FadeTo(EScreens.ScreenOptions);
|
||||||
}
|
}
|
||||||
|
else if (_Buttons[_ButtonServer].Selected)
|
||||||
|
CGraphics.ShowPopup(EPopupScreens.PopupServerQR);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Left:
|
case Keys.Left:
|
||||||
@@ -112,9 +115,13 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
if (mouseEvent.LB && _IsMouseOver(mouseEvent))
|
if (mouseEvent.LB && _IsMouseOver(mouseEvent))
|
||||||
{
|
{
|
||||||
_SaveConfig();
|
|
||||||
if (_Buttons[_ButtonExit].Selected)
|
if (_Buttons[_ButtonExit].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreens.ScreenOptions);
|
CGraphics.FadeTo(EScreens.ScreenOptions);
|
||||||
|
_SaveConfig();
|
||||||
|
}
|
||||||
|
else if (_Buttons[_ButtonServer].Selected)
|
||||||
|
CGraphics.ShowPopup(EPopupScreens.PopupServerQR);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ namespace Vocaluxe.Screens
|
|||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion
|
protected override int _ScreenVersion
|
||||||
{
|
{
|
||||||
get { return 2; }
|
get { return 3; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string _SelectSlideProfiles = "SelectSlideProfiles";
|
private const string _SelectSlideProfiles = "SelectSlideProfiles";
|
||||||
private const string _SelectSlideDifficulty = "SelectSlideDifficulty";
|
private const string _SelectSlideDifficulty = "SelectSlideDifficulty";
|
||||||
private const string _SelectSlideAvatars = "SelectSlideAvatars";
|
private const string _SelectSlideAvatars = "SelectSlideAvatars";
|
||||||
private const string _SelectSlideGuestProfile = "SelectSlideGuestProfile";
|
private const string _SelectSlideUserRole = "SelectSlideUserRole";
|
||||||
private const string _SelectSlideActive = "SelectSlideActive";
|
private const string _SelectSlideActive = "SelectSlideActive";
|
||||||
private const string _ButtonPlayerName = "ButtonPlayerName";
|
private const string _ButtonPlayerName = "ButtonPlayerName";
|
||||||
private const string _ButtonExit = "ButtonExit";
|
private const string _ButtonExit = "ButtonExit";
|
||||||
@@ -73,7 +73,7 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
_ThemeButtons = new string[]
|
_ThemeButtons = new string[]
|
||||||
{_ButtonPlayerName, _ButtonExit, _ButtonSave, _ButtonNew, _ButtonDelete, _ButtonWebcam, _ButtonSaveSnapshot, _ButtonDiscardSnapshot, _ButtonTakeSnapshot};
|
{_ButtonPlayerName, _ButtonExit, _ButtonSave, _ButtonNew, _ButtonDelete, _ButtonWebcam, _ButtonSaveSnapshot, _ButtonDiscardSnapshot, _ButtonTakeSnapshot};
|
||||||
_ThemeSelectSlides = new string[] {_SelectSlideProfiles, _SelectSlideDifficulty, _SelectSlideAvatars, _SelectSlideGuestProfile, _SelectSlideActive};
|
_ThemeSelectSlides = new string[] {_SelectSlideProfiles, _SelectSlideDifficulty, _SelectSlideAvatars, _SelectSlideUserRole, _SelectSlideActive};
|
||||||
_ThemeStatics = new string[] {_StaticAvatar};
|
_ThemeStatics = new string[] {_StaticAvatar};
|
||||||
|
|
||||||
_EditMode = EEditMode.None;
|
_EditMode = EEditMode.None;
|
||||||
@@ -91,7 +91,7 @@ namespace Vocaluxe.Screens
|
|||||||
_Buttons[_ButtonTakeSnapshot].Visible = false;
|
_Buttons[_ButtonTakeSnapshot].Visible = false;
|
||||||
_Buttons[_ButtonWebcam].Visible = CWebcam.IsDeviceAvailable();
|
_Buttons[_ButtonWebcam].Visible = CWebcam.IsDeviceAvailable();
|
||||||
_SelectSlides[_SelectSlideDifficulty].SetValues<EGameDifficulty>(0);
|
_SelectSlides[_SelectSlideDifficulty].SetValues<EGameDifficulty>(0);
|
||||||
_SelectSlides[_SelectSlideGuestProfile].SetValues<EOffOn>(0);
|
_SelectSlides[_SelectSlideUserRole].SetValues<EUserRole>(0);
|
||||||
_SelectSlides[_SelectSlideActive].SetValues<EOffOn>(0);
|
_SelectSlides[_SelectSlideActive].SetValues<EOffOn>(0);
|
||||||
_Statics[_StaticAvatar].Aspect = EAspect.Crop;
|
_Statics[_StaticAvatar].Aspect = EAspect.Crop;
|
||||||
}
|
}
|
||||||
@@ -176,10 +176,10 @@ namespace Vocaluxe.Screens
|
|||||||
CProfiles.SetAvatar(_SelectSlides[_SelectSlideProfiles].ValueIndex,
|
CProfiles.SetAvatar(_SelectSlides[_SelectSlideProfiles].ValueIndex,
|
||||||
_SelectSlides[_SelectSlideAvatars].ValueIndex);
|
_SelectSlides[_SelectSlideAvatars].ValueIndex);
|
||||||
}
|
}
|
||||||
else if (_SelectSlides[_SelectSlideGuestProfile].Selected)
|
else if (_SelectSlides[_SelectSlideUserRole].Selected)
|
||||||
{
|
{
|
||||||
CProfiles.SetGuestProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex,
|
CProfiles.SetUserRoleProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex,
|
||||||
(EOffOn)_SelectSlides[_SelectSlideGuestProfile].Selection);
|
(EUserRole)_SelectSlides[_SelectSlideUserRole].Selection);
|
||||||
}
|
}
|
||||||
else if (_SelectSlides[_SelectSlideActive].Selected)
|
else if (_SelectSlides[_SelectSlideActive].Selected)
|
||||||
{
|
{
|
||||||
@@ -225,10 +225,10 @@ namespace Vocaluxe.Screens
|
|||||||
if (CWebcam.IsDeviceAvailable() && _WebcamTexture != null)
|
if (CWebcam.IsDeviceAvailable() && _WebcamTexture != null)
|
||||||
_OnDiscardSnapshot();
|
_OnDiscardSnapshot();
|
||||||
}
|
}
|
||||||
else if (_SelectSlides[_SelectSlideGuestProfile].Selected)
|
else if (_SelectSlides[_SelectSlideUserRole].Selected)
|
||||||
{
|
{
|
||||||
CProfiles.SetGuestProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex,
|
CProfiles.SetUserRoleProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex,
|
||||||
(EOffOn)_SelectSlides[_SelectSlideGuestProfile].Selection);
|
(EUserRole)_SelectSlides[_SelectSlideUserRole].Selection);
|
||||||
}
|
}
|
||||||
else if (_SelectSlides[_SelectSlideActive].Selected)
|
else if (_SelectSlides[_SelectSlideActive].Selected)
|
||||||
{
|
{
|
||||||
@@ -265,7 +265,7 @@ namespace Vocaluxe.Screens
|
|||||||
_Buttons[_ButtonPlayerName].Text.Text += "|";
|
_Buttons[_ButtonPlayerName].Text.Text += "|";
|
||||||
|
|
||||||
_SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(_SelectSlides[_SelectSlideProfiles].ValueIndex);
|
_SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(_SelectSlides[_SelectSlideProfiles].ValueIndex);
|
||||||
_SelectSlides[_SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex);
|
_SelectSlides[_SelectSlideUserRole].Selection = (int)CProfiles.GetUserRoleProfile(_SelectSlides[_SelectSlideProfiles].ValueIndex);
|
||||||
_SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(_SelectSlides[_SelectSlideProfiles].ValueIndex);
|
_SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(_SelectSlides[_SelectSlideProfiles].ValueIndex);
|
||||||
|
|
||||||
int avatarID = CProfiles.GetAvatarID(_SelectSlides[_SelectSlideProfiles].ValueIndex);
|
int avatarID = CProfiles.GetAvatarID(_SelectSlides[_SelectSlideProfiles].ValueIndex);
|
||||||
@@ -428,7 +428,7 @@ namespace Vocaluxe.Screens
|
|||||||
if (!keep)
|
if (!keep)
|
||||||
{
|
{
|
||||||
_SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(selectedProfileID);
|
_SelectSlides[_SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(selectedProfileID);
|
||||||
_SelectSlides[_SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(selectedProfileID);
|
_SelectSlides[_SelectSlideUserRole].Selection = (int)CProfiles.GetUserRoleProfile(selectedProfileID);
|
||||||
_SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(selectedProfileID);
|
_SelectSlides[_SelectSlideActive].Selection = (int)CProfiles.GetActive(selectedProfileID);
|
||||||
_SelectSlides[_SelectSlideAvatars].SetSelectionByValueIndex(CProfiles.GetAvatarID(selectedProfileID));
|
_SelectSlides[_SelectSlideAvatars].SetSelectionByValueIndex(CProfiles.GetAvatarID(selectedProfileID));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using Vocaluxe.Base.Server;
|
||||||
using VocaluxeLib;
|
using VocaluxeLib;
|
||||||
using VocaluxeLib.Game;
|
using VocaluxeLib.Game;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
@@ -42,6 +43,8 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _ScreenSettingShortDifficulty = "ScreenSettingShortDifficulty";
|
private const string _ScreenSettingShortDifficulty = "ScreenSettingShortDifficulty";
|
||||||
private const string _ScreenSettingAnimationDirection = "ScreenSettingAnimationDirection";
|
private const string _ScreenSettingAnimationDirection = "ScreenSettingAnimationDirection";
|
||||||
|
|
||||||
|
private CBackground _SlideShowBG;
|
||||||
|
|
||||||
private string[,] _TextNames;
|
private string[,] _TextNames;
|
||||||
private string[,] _TextScores;
|
private string[,] _TextScores;
|
||||||
private string[,] _TextRatings;
|
private string[,] _TextRatings;
|
||||||
@@ -53,6 +56,7 @@ namespace Vocaluxe.Screens
|
|||||||
private int _Round;
|
private int _Round;
|
||||||
private CPoints _Points;
|
private CPoints _Points;
|
||||||
private Stopwatch _Timer;
|
private Stopwatch _Timer;
|
||||||
|
private bool _SlideShowBGAvailable;
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
@@ -72,6 +76,8 @@ namespace Vocaluxe.Screens
|
|||||||
_ThemeScreenSettings = new string[] {_ScreenSettingShortScore, _ScreenSettingShortRating, _ScreenSettingShortDifficulty, _ScreenSettingAnimationDirection};
|
_ThemeScreenSettings = new string[] {_ScreenSettingShortScore, _ScreenSettingShortRating, _ScreenSettingShortDifficulty, _ScreenSettingAnimationDirection};
|
||||||
|
|
||||||
_StaticPointsBarDrawnPoints = new double[CSettings.MaxNumPlayer];
|
_StaticPointsBarDrawnPoints = new double[CSettings.MaxNumPlayer];
|
||||||
|
|
||||||
|
_SlideShowBG = GetNewBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(SKeyEvent keyEvent)
|
public override bool HandleInput(SKeyEvent keyEvent)
|
||||||
@@ -125,6 +131,7 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
_SetVisibility();
|
_SetVisibility();
|
||||||
_UpdateRatings();
|
_UpdateRatings();
|
||||||
|
_SlideShowBGAvailable = _UpdateBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool UpdateGame()
|
public override bool UpdateGame()
|
||||||
@@ -176,7 +183,11 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
public override bool Draw()
|
public override bool Draw()
|
||||||
{
|
{
|
||||||
base.Draw();
|
if (_SlideShowBGAvailable)
|
||||||
|
_SlideShowBG.Draw();
|
||||||
|
else
|
||||||
|
base._DrawBG();
|
||||||
|
base._DrawFG();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,12 +420,22 @@ namespace Vocaluxe.Screens
|
|||||||
CSong song = CSongs.GetSong(players[p].SongID);
|
CSong song = CSongs.GetSong(players[p].SongID);
|
||||||
CDataBase.IncreaseSongCounter(song.DataBaseSongID);
|
CDataBase.IncreaseSongCounter(song.DataBaseSongID);
|
||||||
song.NumPlayed++;
|
song.NumPlayed++;
|
||||||
|
song.NumPlayedSession++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _UpdateBackground()
|
||||||
|
{
|
||||||
|
string[] photos = CVocaluxeServer.getPhotosOfThisRound();
|
||||||
|
_SlideShowBG.RemoveSlideShowTextures();
|
||||||
|
foreach (string photo in photos)
|
||||||
|
_SlideShowBG.AddSlideShowTexture(photo);
|
||||||
|
return photos.Length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
private void _LeaveScreen()
|
private void _LeaveScreen()
|
||||||
{
|
{
|
||||||
CParty.LeavingScore();
|
CParty.LeavingScore();
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ namespace Vocaluxe.Screens
|
|||||||
private bool _Pause;
|
private bool _Pause;
|
||||||
private bool _Webcam;
|
private bool _Webcam;
|
||||||
|
|
||||||
|
private CBackground _SlideShow;
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
@@ -474,6 +476,8 @@ namespace Vocaluxe.Screens
|
|||||||
CDraw.DrawTexture(background, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, 0f),
|
CDraw.DrawTexture(background, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, 0f),
|
||||||
background.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
|
background.Color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f));
|
||||||
}
|
}
|
||||||
|
else if (_SlideShow != null)
|
||||||
|
_SlideShow.Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
_DrawBG();
|
_DrawBG();
|
||||||
@@ -557,6 +561,9 @@ namespace Vocaluxe.Screens
|
|||||||
}
|
}
|
||||||
CDraw.RemoveTexture(ref _Background);
|
CDraw.RemoveTexture(ref _Background);
|
||||||
|
|
||||||
|
if(_SlideShow != null)
|
||||||
|
_SlideShow.RemoveSlideShowTextures();
|
||||||
|
|
||||||
_Lyrics[_LyricMain].Clear();
|
_Lyrics[_LyricMain].Clear();
|
||||||
_Lyrics[_LyricSub].Clear();
|
_Lyrics[_LyricSub].Clear();
|
||||||
_Lyrics[_LyricMainDuet].Clear();
|
_Lyrics[_LyricMainDuet].Clear();
|
||||||
@@ -622,8 +629,18 @@ namespace Vocaluxe.Screens
|
|||||||
}
|
}
|
||||||
|
|
||||||
CDraw.RemoveTexture(ref _Background);
|
CDraw.RemoveTexture(ref _Background);
|
||||||
if (!String.IsNullOrEmpty(song.BackgroundFileName))
|
if (song.BackgroundFileNames.Count > 1)
|
||||||
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName));
|
{
|
||||||
|
_SlideShow = GetNewBackground();
|
||||||
|
foreach(string bgFile in song.BackgroundFileNames)
|
||||||
|
_SlideShow.AddSlideShowTexture(Path.Combine(song.Folder, bgFile));
|
||||||
|
_Background = null;
|
||||||
|
}
|
||||||
|
else if (song.BackgroundFileNames.Count == 1)
|
||||||
|
{
|
||||||
|
if (!String.IsNullOrEmpty(song.BackgroundFileNames[0]))
|
||||||
|
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileNames[0]));
|
||||||
|
}
|
||||||
|
|
||||||
_SingNotes[_SingBars].Reset();
|
_SingNotes[_SingBars].Reset();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">DebugWin</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">DebugWin</Configuration>
|
||||||
@@ -191,6 +191,10 @@
|
|||||||
<Reference Include="OpenTK.GLControl">
|
<Reference Include="OpenTK.GLControl">
|
||||||
<HintPath>..\Output\OpenTK.GLControl.dll</HintPath>
|
<HintPath>..\Output\OpenTK.GLControl.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="QRCoder, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\Output\QRCoder.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@@ -239,6 +243,7 @@
|
|||||||
<Compile Include="Lib\Input\CControllerFramework.cs" />
|
<Compile Include="Lib\Input\CControllerFramework.cs" />
|
||||||
<Compile Include="Lib\Video\Acinerella\CDecoder.cs" />
|
<Compile Include="Lib\Video\Acinerella\CDecoder.cs" />
|
||||||
<Compile Include="Lib\Video\Acinerella\CFramebuffer.cs" />
|
<Compile Include="Lib\Video\Acinerella\CFramebuffer.cs" />
|
||||||
|
<Compile Include="Screens\CPopupScreenServerQR.cs" />
|
||||||
<Compile Include="SongQueue\CSongQueue.cs" />
|
<Compile Include="SongQueue\CSongQueue.cs" />
|
||||||
<Compile Include="GameModes\IGameMode.cs" />
|
<Compile Include="GameModes\IGameMode.cs" />
|
||||||
<Compile Include="SongQueue\ISongQueue.cs" />
|
<Compile Include="SongQueue\ISongQueue.cs" />
|
||||||
|
|||||||
@@ -329,10 +329,16 @@
|
|||||||
<div id="displayUserAdminContent" data-role="content">
|
<div id="displayUserAdminContent" data-role="content">
|
||||||
<fieldset data-role="controlgroup">
|
<fieldset data-role="controlgroup">
|
||||||
<legend></legend>
|
<legend></legend>
|
||||||
<input type="checkbox" id="roleAuthenticatedUser" checked="checked" disabled="disabled">
|
<input type="checkbox" id="TR_USERROLE_ADMIN">
|
||||||
<label for="roleAuthenticatedUser">AuthenticatedUser</label>
|
<label for="TR_USERROLE_ADMIN">Administrator</label>
|
||||||
<input type="checkbox" id="roleAdministrator">
|
<input type="checkbox" id="TR_USERROLE_KEYBOARDUSER">
|
||||||
<label for="roleAdministrator">Administrator</label>
|
<label for="TR_USERROLE_KEYBOARDUSER">Keyboard</label>
|
||||||
|
<input type="checkbox" id="TR_USERROLE_ADDSONGSUSER">
|
||||||
|
<label for="TR_USERROLE_ADDSONGSUSER">AddSongs</label>
|
||||||
|
<input type="checkbox" id="TR_USERROLE_PLAYLISTEDITOR">
|
||||||
|
<label for="TR_USERROLE_PLAYLISTEDITOR">PlaylistEditor</label>
|
||||||
|
<input type="checkbox" id="TR_USERROLE_PROFILEEDITOR">
|
||||||
|
<label for="TR_USERROLE_PROFILEEDITOR">ProfileEditor</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<a data-role="button" id="btnRoleSave" data-transition="slidefade" data-i18n="displayUserAdminContentSaveButton"></a>
|
<a data-role="button" id="btnRoleSave" data-transition="slidefade" data-i18n="displayUserAdminContentSaveButton"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+195
-29
@@ -7,34 +7,24 @@ var playlistRequestName = "";
|
|||||||
var customSelectPlaylistSongCallback = null;
|
var customSelectPlaylistSongCallback = null;
|
||||||
var sessionId = "";
|
var sessionId = "";
|
||||||
var serverBaseAddress = "";
|
var serverBaseAddress = "";
|
||||||
var tranlationLoaded;
|
|
||||||
|
|
||||||
if (document.location.protocol == "file:") {
|
if (document.location.protocol == "file:") {
|
||||||
if (typeof (window.deviceAndJqmLoaded) == "undefined") {
|
if (typeof (window.deviceAndJqmLoaded) == "undefined") {
|
||||||
window.deviceAndJqmLoaded = $.Deferred();
|
window.deviceAndJqmLoaded = $.Deferred();
|
||||||
}
|
}
|
||||||
window.deviceAndJqmLoaded.done(function () {
|
window.deviceAndJqmLoaded.done(function () {
|
||||||
preStart();
|
start();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
preStart();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function preStart() {
|
|
||||||
tranlationLoaded = $.Deferred();
|
|
||||||
|
|
||||||
initTranslation();
|
|
||||||
|
|
||||||
tranlationLoaded.done(function () {
|
|
||||||
translate();
|
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
replaceTransitionHandler();
|
replaceTransitionHandler();
|
||||||
|
initTranslation();
|
||||||
initPageLoadHandler();
|
initPageLoadHandler();
|
||||||
initKeyboardPageHandler();
|
initKeyboardPageHandler();
|
||||||
initMainPageHandler();
|
initMainPageHandler();
|
||||||
@@ -410,13 +400,28 @@ function initPageLoadHandler() {
|
|||||||
var promise = request({
|
var promise = request({
|
||||||
url: "getUserRole?profileId=" + profileIdRequest
|
url: "getUserRole?profileId=" + profileIdRequest
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
$('#roleAdministrator').prop("checked", ((result & 0x01) != 0)).checkboxradio("refresh");
|
var userRoles = {
|
||||||
|
TR_USERROLE_ADMIN: 2,
|
||||||
|
TR_USERROLE_KEYBOARDUSER: 4,
|
||||||
|
TR_USERROLE_ADDSONGSUSER: 8,
|
||||||
|
TR_USERROLE_PLAYLISTEDITOR: 16,
|
||||||
|
TR_USERROLE_PROFILEEDITOR: 32
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var roleName in userRoles) {
|
||||||
|
$('#' + roleName).prop("checked", ((result & userRoles[roleName]) != 0)).checkboxradio("refresh");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$('#btnRoleSave').unbind('click').click(function () {
|
$('#btnRoleSave').unbind('click').click(function () {
|
||||||
var role = 0;
|
var role = 0;
|
||||||
if ($('#roleAdministrator').prop("checked")) {
|
|
||||||
role = (role | 0x01);
|
for (var roleName2 in userRoles) {
|
||||||
|
if ($('#' + roleName2).prop("checked")) {
|
||||||
|
role = (role | userRoles[roleName2]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
request({
|
request({
|
||||||
url: "setUserRole?profileId=" + profileIdRequest + "&userRole=" + role,
|
url: "setUserRole?profileId=" + profileIdRequest + "&userRole=" + role,
|
||||||
headers: { "session": sessionId }
|
headers: { "session": sessionId }
|
||||||
@@ -1239,24 +1244,185 @@ function showWikipedia(artist) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function initTranslation() {
|
function initTranslation() {
|
||||||
$.i18n.init({
|
var translations = {
|
||||||
resGetPath: 'locales/__lng__.json',
|
"en": {
|
||||||
supportedLngs: ['en', 'de'],
|
translation: {
|
||||||
fallbackLng: 'en',
|
'loginName': 'User:',
|
||||||
keyseparator: '::',
|
'loginPassword': 'Password:',
|
||||||
nsseparator: ':::'
|
'loginButton': 'Login',
|
||||||
}).done(function () {
|
'registerButton': 'Create Profile',
|
||||||
tranlationLoaded.resolve();
|
'discoverReadQrButton': 'Scan QRCode',
|
||||||
});
|
'mainPageYourProfileLink': 'Your Profile',
|
||||||
}
|
'mainPageYourProfileLinkDesc': 'Edit your profile',
|
||||||
|
'mainPageCurrentSongLink': 'Current Song',
|
||||||
|
'mainPageCurrentSongLinkDesc': 'Display informations about the current song',
|
||||||
|
'mainPageSelectSong': 'All songs',
|
||||||
|
'mainPageSelectSongDesc': 'Lists all available songs',
|
||||||
|
'mainPageSelectPlaylist': 'All playlists',
|
||||||
|
'mainPageSelectPlaylistDesc': 'Lists all playlists',
|
||||||
|
'mainPageSelectProfile': 'Profiles',
|
||||||
|
'mainPageSelectProfileDesc': 'Shows all profiles',
|
||||||
|
'mainPageTakePhotoLink': 'Take Photo',
|
||||||
|
'mainPageTakePhotoLinkDesc': 'Takes a photo and displays it at the end of the current round',
|
||||||
|
'mainPageKeyboard': 'Keyboard',
|
||||||
|
'mainPageKeyboardDesc': 'Send keys',
|
||||||
|
'mainPageSelectUserAdmin': 'Administration',
|
||||||
|
'mainPageSelectUserAdminDesc': 'Configure user rights',
|
||||||
|
'mainPageLogoutLink': 'Logout',
|
||||||
|
'mainPageLogoutLinkDesc': 'Closes the session',
|
||||||
|
'selectProfileHeader': 'All profiles',
|
||||||
|
'displayProfileHeader': 'Profile',
|
||||||
|
'displayProfileName': 'Name:',
|
||||||
|
'displayProfilePlayerType': 'Player Type:',
|
||||||
|
'displayProfilePlayerTypeNormal': 'Normal',
|
||||||
|
'displayProfilePlayerTypeGuest': 'Guest',
|
||||||
|
'displayProfilePlayerDifficulty': 'Difficulty:',
|
||||||
|
'displayProfilePlayerDifficultyEasy': 'Easy',
|
||||||
|
'displayProfilePlayerDifficultyNormal': 'Normal',
|
||||||
|
'displayProfilePlayerDifficultyHard': 'Hard',
|
||||||
|
'displayProfilePlayerPassword': 'New Password:',
|
||||||
|
'displayProfilePlayerSaveButton': 'Save and upload',
|
||||||
|
'displaySongHeader': 'No current song',
|
||||||
|
'displaySongArtist': 'Artist:',
|
||||||
|
'displaySongGenre': 'Genre:',
|
||||||
|
'displaySongYear': 'Year:',
|
||||||
|
'displaySongLanguage': 'Language:',
|
||||||
|
'displaySongIsDuet': 'Duet:',
|
||||||
|
'popupVideoClose': 'Close',
|
||||||
|
'selectSongHeader': 'All songs',
|
||||||
|
'keyboardHeader': 'Keyboard',
|
||||||
|
'keyboardButtonUp': 'up',
|
||||||
|
'keyboardButtonLeft': 'left',
|
||||||
|
'keyboardButtonRight': 'right',
|
||||||
|
'keyboardButtonDown': 'down',
|
||||||
|
'keyboardButtonEscape': 'escape',
|
||||||
|
'keyboardButtonTab': 'tab',
|
||||||
|
'keyboardButtonReturn': 'return',
|
||||||
|
'keyboardButtonKeys': 'To send other keys type here:',
|
||||||
|
'selectUserAdminHeader': 'All profiles',
|
||||||
|
'displayUserAdminHeader': 'Profile',
|
||||||
|
'displayUserAdminContentSaveButton': 'Save',
|
||||||
|
'selectPlaylistHeader': 'Select a playlist',
|
||||||
|
'displayPlaylistHeader': 'Playlist',
|
||||||
|
'displayPlaylistSaveButton': 'Save',
|
||||||
|
'selectPlaylistAddPlaylistButton': 'Add',
|
||||||
|
'Loading (external)...': 'Loading (external)...',
|
||||||
|
'Loading...': 'Loading...',
|
||||||
|
'Error...': 'Error...',
|
||||||
|
'No connection': 'No connection',
|
||||||
|
'No session': 'No session',
|
||||||
|
'Uploading photo...': 'Uploading photo...',
|
||||||
|
'Getting current song...': 'Getting current song...',
|
||||||
|
'Login...': 'Login...',
|
||||||
|
'Creating profile...': 'Creating profile...',
|
||||||
|
'This is not a valid name.': 'This is not a valid name.',
|
||||||
|
'Uploading profile...': 'Uploading profile...',
|
||||||
|
'songs': 'songs',
|
||||||
|
'YourName': 'YourName',
|
||||||
|
'discoverConnectHeader': 'Connect to server',
|
||||||
|
'discoverConnectServerAddress': 'Serveraddress:',
|
||||||
|
'discoverConnectButton': 'Connect',
|
||||||
|
'Checking...': 'Checking...',
|
||||||
|
'timeout': 'Timeout'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"de": {
|
||||||
|
translation: {
|
||||||
|
'loginName': 'Benutzer:',
|
||||||
|
'loginPassword': 'Passwort:',
|
||||||
|
'loginButton': 'Einloggen',
|
||||||
|
'registerButton': 'Erstelle Profil',
|
||||||
|
'discoverReadQrButton': 'Fotografiere QRCode',
|
||||||
|
'mainPageYourProfileLink': 'Dein Profil',
|
||||||
|
'mainPageYourProfileLinkDesc': 'Bearbeite dein Profil',
|
||||||
|
'mainPageCurrentSongLink': 'Aktuelles Lied',
|
||||||
|
'mainPageCurrentSongLinkDesc': 'Zeigt Informationen über das aktuelle Lied an',
|
||||||
|
'mainPageSelectSong': 'Alle Lieder',
|
||||||
|
'mainPageSelectSongDesc': 'Listet alle verfügbaren Lieder auf',
|
||||||
|
'mainPageSelectPlaylist': 'Alle Playlisten',
|
||||||
|
'mainPageSelectPlaylistDesc': 'Listet alle verfügbaren Playlisten auf',
|
||||||
|
'mainPageSelectProfile': 'Profile',
|
||||||
|
'mainPageSelectProfileDesc': 'Listet alle Profile auf',
|
||||||
|
'mainPageTakePhotoLink': 'Nehme Foto auf',
|
||||||
|
'mainPageTakePhotoLinkDesc': 'Nimmt ein Foto auf und zeigt es am ende der Runde an',
|
||||||
|
'mainPageKeyboard': 'Tastatur',
|
||||||
|
'mainPageKeyboardDesc': 'Sende Tastatureingaben',
|
||||||
|
'mainPageSelectUserAdmin': 'Administration',
|
||||||
|
'mainPageSelectUserAdminDesc': 'Konfiguriere die Benutzerrechte',
|
||||||
|
'mainPageLogoutLink': 'Abmelden',
|
||||||
|
'mainPageLogoutLinkDesc': 'Beendet diese Sitzung',
|
||||||
|
'selectProfileHeader': 'Alle Profile',
|
||||||
|
'displayProfileHeader': 'Profile',
|
||||||
|
'displayProfileName': 'Name:',
|
||||||
|
'displayProfilePlayerType': 'Player Typ:',
|
||||||
|
'displayProfilePlayerTypeNormal': 'Normal',
|
||||||
|
'displayProfilePlayerTypeGuest': 'Gast',
|
||||||
|
'displayProfilePlayerDifficulty': 'Schwierigkeit:',
|
||||||
|
'displayProfilePlayerDifficultyEasy': 'Einfach',
|
||||||
|
'displayProfilePlayerDifficultyNormal': 'Normal',
|
||||||
|
'displayProfilePlayerDifficultyHard': 'Schwer',
|
||||||
|
'displayProfilePlayerPassword': 'Neues Passwort:',
|
||||||
|
'displayProfilePlayerSaveButton': 'Speichern und hochladen',
|
||||||
|
'displaySongHeader': 'Kein aktuelles Lied',
|
||||||
|
'displaySongArtist': 'Künstler:',
|
||||||
|
'displaySongGenre': 'Genre:',
|
||||||
|
'displaySongYear': 'Jahr:',
|
||||||
|
'displaySongLanguage': 'Sprache:',
|
||||||
|
'displaySongIsDuet': 'Duet:',
|
||||||
|
'popupVideoClose': 'Schließen',
|
||||||
|
'selectSongHeader': 'Alle Lieder',
|
||||||
|
'keyboardHeader': 'Tastatur',
|
||||||
|
'keyboardButtonUp': 'hoch',
|
||||||
|
'keyboardButtonLeft': 'links',
|
||||||
|
'keyboardButtonRight': 'rechts',
|
||||||
|
'keyboardButtonDown': 'runter',
|
||||||
|
'keyboardButtonEscape': 'Escape',
|
||||||
|
'keyboardButtonTab': 'Tab',
|
||||||
|
'keyboardButtonReturn': 'Enter',
|
||||||
|
'keyboardButtonKeys': 'Um andere Zeichen zu senden, hier tippen:',
|
||||||
|
'selectUserAdminHeader': 'Alle Profile',
|
||||||
|
'displayUserAdminHeader': 'Profile',
|
||||||
|
'displayUserAdminContentSaveButton': 'Speichern',
|
||||||
|
'selectPlaylistHeader': 'Wähle eine Playlist',
|
||||||
|
'displayPlaylistHeader': 'Playlist',
|
||||||
|
'displayPlaylistSaveButton': 'Speichern',
|
||||||
|
'selectPlaylistAddPlaylistButton': 'Hinzufügen',
|
||||||
|
'Loading (external)...': 'Laden (extern)...',
|
||||||
|
'Loading...': 'Laden...',
|
||||||
|
'Error...': 'Fehler...',
|
||||||
|
'No connection': 'Keine Verbindung',
|
||||||
|
'No session': 'Keine Sitzung',
|
||||||
|
'Uploading photo...': 'Foto hochladen...',
|
||||||
|
'Getting current song...': 'Lade aktuelles Lied...',
|
||||||
|
'Login...': 'Einloggen...',
|
||||||
|
'Creating profile...': 'Erstelle Profil...',
|
||||||
|
'This is not a valid name.': 'Dies ist kein gültiger Name.',
|
||||||
|
'Uploading profile...': 'Profil hochladen...',
|
||||||
|
'songs': 'Lieder',
|
||||||
|
'YourName': 'DeinName',
|
||||||
|
'discoverConnectHeader': 'Verbinde zum Server',
|
||||||
|
'discoverConnectServerAddress': 'Serveradresse:',
|
||||||
|
'discoverConnectButton': 'Verbinden',
|
||||||
|
'Checking...': 'Prüfen...',
|
||||||
|
'timeout': 'Zeitüberschreitung'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function translate() {
|
|
||||||
//repair broken buttons on the first page (get broken while translating)
|
//repair broken buttons on the first page (get broken while translating)
|
||||||
var repairButtons = function () {
|
var repairButtons = function () {
|
||||||
$($('#discoverConnect')[0].childNodes).wrap('<span class="ui-btn-inner"><span class="ui-btn-text"> </span></span>');
|
$($('#discoverConnect')[0].childNodes).wrap('<span class="ui-btn-inner"><span class="ui-btn-text"> </span></span>');
|
||||||
$($('#discoverReadQr')[0].childNodes).wrap('<span class="ui-btn-inner"><span class="ui-btn-text"> </span></span>');
|
$($('#discoverReadQr')[0].childNodes).wrap('<span class="ui-btn-inner"><span class="ui-btn-text"> </span></span>');
|
||||||
};
|
};
|
||||||
|
|
||||||
$('body').i18n();
|
$.i18n.init({
|
||||||
repairButtons();
|
resStore: translations,
|
||||||
|
supportedLngs: ['en', 'de'],
|
||||||
|
fallbackLng: 'en',
|
||||||
|
keyseparator: '::',
|
||||||
|
nsseparator: ':::'
|
||||||
|
}).done(function () {
|
||||||
|
$('body').i18n();
|
||||||
|
repairButtons();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -345,7 +345,20 @@ namespace VocaluxeLib
|
|||||||
{
|
{
|
||||||
PopupPlayerControl = 0,
|
PopupPlayerControl = 0,
|
||||||
PopupVolumeControl = 1,
|
PopupVolumeControl = 1,
|
||||||
|
PopupServerQR = 2,
|
||||||
|
|
||||||
NoPopup = -1
|
NoPopup = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum EUserRole
|
||||||
|
{
|
||||||
|
TR_USERROLE_GUEST = 0,
|
||||||
|
TR_USERROLE_NORMAL = 1,
|
||||||
|
TR_USERROLE_ADMIN = 2,
|
||||||
|
TR_USERROLE_KEYBOARDUSER = 4,
|
||||||
|
TR_USERROLE_ADDSONGSUSER = 8,
|
||||||
|
TR_USERROLE_PLAYLISTEDITOR = 16,
|
||||||
|
TR_USERROLE_PROFILEEDITOR = 32
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -86,6 +86,9 @@ namespace VocaluxeLib
|
|||||||
|
|
||||||
string GetFolderProfiles();
|
string GetFolderProfiles();
|
||||||
string GetDataPath();
|
string GetDataPath();
|
||||||
|
|
||||||
|
float GetSlideShowImageTime();
|
||||||
|
float GetSlideShowFadeTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ITheme
|
public interface ITheme
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Collections.Generic;
|
||||||
using VocaluxeLib.Draw;
|
using VocaluxeLib.Draw;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
@@ -27,6 +29,7 @@ namespace VocaluxeLib.Menu
|
|||||||
None,
|
None,
|
||||||
Color,
|
Color,
|
||||||
Texture,
|
Texture,
|
||||||
|
SlideShow,
|
||||||
Video
|
Video
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,6 +39,8 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public EBackgroundTypes Type;
|
public EBackgroundTypes Type;
|
||||||
|
|
||||||
|
public List<string> SlideShowTextures;
|
||||||
|
|
||||||
public string VideoName;
|
public string VideoName;
|
||||||
public string TextureName;
|
public string TextureName;
|
||||||
|
|
||||||
@@ -48,6 +53,10 @@ namespace VocaluxeLib.Menu
|
|||||||
private SThemeBackground _Theme;
|
private SThemeBackground _Theme;
|
||||||
private bool _ThemeLoaded;
|
private bool _ThemeLoaded;
|
||||||
|
|
||||||
|
private int _SlideShowCurrent;
|
||||||
|
private Stopwatch _SlideShowTimer = new Stopwatch();
|
||||||
|
private List<CTexture> _SlideShowTextures = new List<CTexture>();
|
||||||
|
|
||||||
public SColorF Color;
|
public SColorF Color;
|
||||||
|
|
||||||
public string GetThemeName()
|
public string GetThemeName()
|
||||||
@@ -61,6 +70,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_PartyModeID = partyModeID;
|
_PartyModeID = partyModeID;
|
||||||
_ThemeLoaded = false;
|
_ThemeLoaded = false;
|
||||||
_Theme = new SThemeBackground();
|
_Theme = new SThemeBackground();
|
||||||
|
_Theme.SlideShowTextures = new List<string>();
|
||||||
|
|
||||||
Color = new SColorF(0f, 0f, 0f, 1f);
|
Color = new SColorF(0f, 0f, 0f, 1f);
|
||||||
}
|
}
|
||||||
@@ -92,6 +102,17 @@ namespace VocaluxeLib.Menu
|
|||||||
_ThemeLoaded &= success;
|
_ThemeLoaded &= success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string slideShow = "";
|
||||||
|
int i = 1;
|
||||||
|
|
||||||
|
while (xmlReader.ItemExists(item + "/SlideShow" + i))
|
||||||
|
{
|
||||||
|
xmlReader.GetValue(item + "/SlideShow" + i, out slideShow, String.Empty);
|
||||||
|
if (slideShow != "")
|
||||||
|
_Theme.SlideShowTextures.Add(slideShow);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
if (_ThemeLoaded)
|
if (_ThemeLoaded)
|
||||||
{
|
{
|
||||||
_Theme.Name = elementName;
|
_Theme.Name = elementName;
|
||||||
@@ -115,6 +136,12 @@ namespace VocaluxeLib.Menu
|
|||||||
writer.WriteComment("<Skin>: Background Texture name");
|
writer.WriteComment("<Skin>: Background Texture name");
|
||||||
writer.WriteElementString("Skin", _Theme.TextureName);
|
writer.WriteElementString("Skin", _Theme.TextureName);
|
||||||
|
|
||||||
|
writer.WriteComment("<SlideShow%>: Texture name for slide-show");
|
||||||
|
for (int i = 0; i < _Theme.SlideShowTextures.Count; i++)
|
||||||
|
{
|
||||||
|
writer.WriteElementString("SlideShow" + (i + 1), _Theme.SlideShowTextures[i]);
|
||||||
|
}
|
||||||
|
|
||||||
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
|
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
|
||||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||||
@@ -164,6 +191,11 @@ namespace VocaluxeLib.Menu
|
|||||||
ok = _DrawVideo();
|
ok = _DrawVideo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_Theme.Type == EBackgroundTypes.SlideShow )
|
||||||
|
{
|
||||||
|
ok = _DrawSlideShow();
|
||||||
|
}
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(_Theme.TextureName) &&
|
if (!String.IsNullOrEmpty(_Theme.TextureName) &&
|
||||||
(_Theme.Type == EBackgroundTypes.Texture ||
|
(_Theme.Type == EBackgroundTypes.Texture ||
|
||||||
(_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok))))
|
(_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok))))
|
||||||
@@ -176,12 +208,36 @@ namespace VocaluxeLib.Menu
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnloadTextures() {}
|
public void UnloadTextures() { _SlideShowTextures.Clear(); }
|
||||||
|
|
||||||
public void LoadTextures()
|
public void LoadTextures()
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
if (!String.IsNullOrEmpty(_Theme.ColorName))
|
||||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||||
|
|
||||||
|
foreach (string s in _Theme.SlideShowTextures)
|
||||||
|
_SlideShowTextures.Add(CBase.Theme.GetSkinTexture(s, _PartyModeID));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddSlideShowTexture(string image)
|
||||||
|
{
|
||||||
|
_Theme.Type = EBackgroundTypes.SlideShow;
|
||||||
|
if (!String.IsNullOrEmpty(image))
|
||||||
|
{
|
||||||
|
CTexture texture = CBase.Drawing.AddTexture(image);
|
||||||
|
if(texture != null)
|
||||||
|
_SlideShowTextures.Add(texture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveSlideShowTextures()
|
||||||
|
{
|
||||||
|
foreach (CTexture tex in _SlideShowTextures)
|
||||||
|
{
|
||||||
|
CTexture texture = tex;
|
||||||
|
CBase.Drawing.RemoveTexture(ref texture);
|
||||||
|
}
|
||||||
|
_SlideShowTextures.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReloadTextures()
|
public void ReloadTextures()
|
||||||
@@ -214,6 +270,58 @@ namespace VocaluxeLib.Menu
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _DrawSlideShow()
|
||||||
|
{
|
||||||
|
if (_SlideShowTextures.Count > 0)
|
||||||
|
{
|
||||||
|
if (!_SlideShowTimer.IsRunning)
|
||||||
|
{
|
||||||
|
_SlideShowTimer.Start();
|
||||||
|
_SlideShowCurrent = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_SlideShowTimer.ElapsedMilliseconds >= (CBase.Settings.GetSlideShowFadeTime() + CBase.Settings.GetSlideShowImageTime()))
|
||||||
|
{
|
||||||
|
_SlideShowTimer.Restart();
|
||||||
|
if (_SlideShowCurrent + 1 < _SlideShowTextures.Count)
|
||||||
|
_SlideShowCurrent++;
|
||||||
|
else if (_SlideShowCurrent != 0)
|
||||||
|
_SlideShowCurrent = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CTexture texture = _SlideShowTextures[_SlideShowCurrent];
|
||||||
|
|
||||||
|
if (texture == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
|
||||||
|
RectangleF rect;
|
||||||
|
CHelper.SetRect(bounds, out rect, texture.OrigAspect, EAspect.Crop);
|
||||||
|
|
||||||
|
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CBase.Settings.GetZFar() / 4));
|
||||||
|
|
||||||
|
if (_SlideShowTimer.ElapsedMilliseconds >= CBase.Settings.GetSlideShowImageTime())
|
||||||
|
{
|
||||||
|
if (_SlideShowCurrent + 1 < _SlideShowTextures.Count)
|
||||||
|
texture = _SlideShowTextures[_SlideShowCurrent + 1];
|
||||||
|
else if (_SlideShowCurrent != 0)
|
||||||
|
texture = _SlideShowTextures[0];
|
||||||
|
else
|
||||||
|
texture = null;
|
||||||
|
|
||||||
|
if (texture != null)
|
||||||
|
{
|
||||||
|
float alpha = (_SlideShowTimer.ElapsedMilliseconds - CBase.Settings.GetSlideShowImageTime()) / CBase.Settings.GetSlideShowFadeTime();
|
||||||
|
CHelper.SetRect(bounds, out rect, texture.OrigAspect, EAspect.Crop);
|
||||||
|
CBase.Drawing.DrawTexture(texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, (CBase.Settings.GetZFar() / 4) - 1), new SColorF(1,1,1, alpha));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private bool _DrawVideo()
|
private bool _DrawVideo()
|
||||||
{
|
{
|
||||||
CTexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
|
CTexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Player = player;
|
_Player = player;
|
||||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||||
}
|
}
|
||||||
//Normal activation
|
//Normal activation
|
||||||
else if (active)
|
else if (active)
|
||||||
{
|
{
|
||||||
Selection = 0;
|
Selection = 0;
|
||||||
@@ -379,7 +379,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||||
_PlayerSelector.Visible = true;
|
_PlayerSelector.Visible = true;
|
||||||
}
|
}
|
||||||
//Deactivate
|
//Deactivate
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Selection = -1;
|
Selection = -1;
|
||||||
@@ -456,7 +456,7 @@ namespace VocaluxeLib.Menu
|
|||||||
return new CStatic(_PartyModeID);
|
return new CStatic(_PartyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnloadTextures() {}
|
public void UnloadTextures() { }
|
||||||
|
|
||||||
public void LoadTextures()
|
public void LoadTextures()
|
||||||
{
|
{
|
||||||
@@ -486,7 +486,7 @@ namespace VocaluxeLib.Menu
|
|||||||
for (int j = 0; j < _NumW; j++)
|
for (int j = 0; j < _NumW; j++)
|
||||||
{
|
{
|
||||||
var rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
|
var rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
|
||||||
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) {Aspect = EAspect.Crop};
|
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) { Aspect = EAspect.Crop };
|
||||||
var tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle,
|
var tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle,
|
||||||
_Theme.NameFont, _Theme.NameColor, "");
|
_Theme.NameFont, _Theme.NameColor, "");
|
||||||
_Tiles.Add(new CTile(tileStatic, tileText, -1));
|
_Tiles.Add(new CTile(tileStatic, tileText, -1));
|
||||||
@@ -508,7 +508,8 @@ namespace VocaluxeLib.Menu
|
|||||||
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
|
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
|
||||||
{
|
{
|
||||||
//Don't show profile if is selected, but if selected and guest
|
//Don't show profile if is selected, but if selected and guest
|
||||||
if (CBase.Game.GetPlayers()[p].ProfileID == profile.ID && profile.GuestProfile == EOffOn.TR_CONFIG_OFF)
|
if (CBase.Game.GetPlayers()[p].ProfileID == profile.ID
|
||||||
|
&& profile.UserRole.HasFlag(EUserRole.TR_USERROLE_GUEST))
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ namespace VocaluxeLib.Profile
|
|||||||
public string AvatarFileName;
|
public string AvatarFileName;
|
||||||
public byte[] PasswordHash;
|
public byte[] PasswordHash;
|
||||||
public byte[] PasswordSalt;
|
public byte[] PasswordSalt;
|
||||||
public int UserRoles;
|
|
||||||
|
|
||||||
public EGameDifficulty Difficulty;
|
public EGameDifficulty Difficulty;
|
||||||
|
|
||||||
@@ -47,7 +46,7 @@ namespace VocaluxeLib.Profile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EOffOn GuestProfile;
|
public EUserRole UserRole;
|
||||||
public EOffOn Active;
|
public EOffOn Active;
|
||||||
|
|
||||||
public CProfile()
|
public CProfile()
|
||||||
@@ -55,7 +54,7 @@ namespace VocaluxeLib.Profile
|
|||||||
PlayerName = String.Empty;
|
PlayerName = String.Empty;
|
||||||
Difficulty = EGameDifficulty.TR_CONFIG_EASY;
|
Difficulty = EGameDifficulty.TR_CONFIG_EASY;
|
||||||
Avatar = new CAvatar(-1);
|
Avatar = new CAvatar(-1);
|
||||||
GuestProfile = EOffOn.TR_CONFIG_OFF;
|
UserRole = EUserRole.TR_USERROLE_NORMAL;
|
||||||
Active = EOffOn.TR_CONFIG_ON;
|
Active = EOffOn.TR_CONFIG_ON;
|
||||||
|
|
||||||
AvatarFileName = String.Empty;
|
AvatarFileName = String.Empty;
|
||||||
@@ -88,7 +87,7 @@ namespace VocaluxeLib.Profile
|
|||||||
|
|
||||||
xmlReader.TryGetEnumValue("//root/Info/Difficulty", ref Difficulty);
|
xmlReader.TryGetEnumValue("//root/Info/Difficulty", ref Difficulty);
|
||||||
xmlReader.GetValue("//root/Info/Avatar", out AvatarFileName, String.Empty);
|
xmlReader.GetValue("//root/Info/Avatar", out AvatarFileName, String.Empty);
|
||||||
xmlReader.TryGetEnumValue("//root/Info/GuestProfile", ref GuestProfile);
|
xmlReader.TryGetEnumValue("//root/Info/UserRole", ref UserRole);
|
||||||
xmlReader.TryGetEnumValue("//root/Info/Active", ref Active);
|
xmlReader.TryGetEnumValue("//root/Info/Active", ref Active);
|
||||||
string passwordHash;
|
string passwordHash;
|
||||||
xmlReader.GetValue("//root/Info/PasswordHash", out passwordHash, "");
|
xmlReader.GetValue("//root/Info/PasswordHash", out passwordHash, "");
|
||||||
@@ -96,9 +95,6 @@ namespace VocaluxeLib.Profile
|
|||||||
string passwordSalt;
|
string passwordSalt;
|
||||||
xmlReader.GetValue("//root/Info/PasswordSalt", out passwordSalt, "");
|
xmlReader.GetValue("//root/Info/PasswordSalt", out passwordSalt, "");
|
||||||
PasswordSalt = !string.IsNullOrEmpty(passwordSalt) ? Convert.FromBase64String(passwordSalt) : null;
|
PasswordSalt = !string.IsNullOrEmpty(passwordSalt) ? Convert.FromBase64String(passwordSalt) : null;
|
||||||
string userRoles;
|
|
||||||
xmlReader.GetValue("//root/Info/UserRoles", out userRoles, "0");
|
|
||||||
Int32.TryParse(userRoles, out UserRoles);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +153,7 @@ namespace VocaluxeLib.Profile
|
|||||||
writer.WriteElementString("PlayerName", PlayerName);
|
writer.WriteElementString("PlayerName", PlayerName);
|
||||||
writer.WriteElementString("Difficulty", Enum.GetName(typeof(EGameDifficulty), Difficulty));
|
writer.WriteElementString("Difficulty", Enum.GetName(typeof(EGameDifficulty), Difficulty));
|
||||||
writer.WriteElementString("Avatar", Path.GetFileName(Avatar.FileName));
|
writer.WriteElementString("Avatar", Path.GetFileName(Avatar.FileName));
|
||||||
writer.WriteElementString("GuestProfile", Enum.GetName(typeof(EOffOn), GuestProfile));
|
writer.WriteElementString("UserRole", Enum.GetName(typeof(EUserRole), UserRole));
|
||||||
writer.WriteElementString("Active", Enum.GetName(typeof(EOffOn), Active));
|
writer.WriteElementString("Active", Enum.GetName(typeof(EOffOn), Active));
|
||||||
if (PasswordHash != null)
|
if (PasswordHash != null)
|
||||||
{
|
{
|
||||||
@@ -167,7 +163,6 @@ namespace VocaluxeLib.Profile
|
|||||||
{
|
{
|
||||||
writer.WriteElementString("PasswordSalt", Convert.ToBase64String(PasswordSalt));
|
writer.WriteElementString("PasswordSalt", Convert.ToBase64String(PasswordSalt));
|
||||||
}
|
}
|
||||||
writer.WriteElementString("UserRoles", UserRoles.ToString());
|
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
|
|
||||||
writer.WriteEndElement(); //end of root
|
writer.WriteEndElement(); //end of root
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ namespace VocaluxeLib.Songs
|
|||||||
|
|
||||||
public string MP3FileName = String.Empty;
|
public string MP3FileName = String.Empty;
|
||||||
public string CoverFileName = String.Empty;
|
public string CoverFileName = String.Empty;
|
||||||
public string BackgroundFileName = String.Empty;
|
public List<string> BackgroundFileNames = new List<string>();
|
||||||
public string VideoFileName = String.Empty;
|
public string VideoFileName = String.Empty;
|
||||||
|
|
||||||
public EAspect VideoAspect = EAspect.Crop;
|
public EAspect VideoAspect = EAspect.Crop;
|
||||||
@@ -174,6 +174,7 @@ namespace VocaluxeLib.Songs
|
|||||||
public int DataBaseSongID = -1;
|
public int DataBaseSongID = -1;
|
||||||
public string DateAdded = "";
|
public string DateAdded = "";
|
||||||
public int NumPlayed;
|
public int NumPlayed;
|
||||||
|
public int NumPlayedSession;
|
||||||
|
|
||||||
// Notes
|
// Notes
|
||||||
public readonly CNotes Notes = new CNotes();
|
public readonly CNotes Notes = new CNotes();
|
||||||
@@ -226,7 +227,7 @@ namespace VocaluxeLib.Songs
|
|||||||
|
|
||||||
MP3FileName = song.MP3FileName;
|
MP3FileName = song.MP3FileName;
|
||||||
CoverFileName = song.CoverFileName;
|
CoverFileName = song.CoverFileName;
|
||||||
BackgroundFileName = song.BackgroundFileName;
|
BackgroundFileNames = song.BackgroundFileNames;
|
||||||
VideoFileName = song.VideoFileName;
|
VideoFileName = song.VideoFileName;
|
||||||
|
|
||||||
VideoAspect = song.VideoAspect;
|
VideoAspect = song.VideoAspect;
|
||||||
@@ -266,6 +267,7 @@ namespace VocaluxeLib.Songs
|
|||||||
DataBaseSongID = song.DataBaseSongID;
|
DataBaseSongID = song.DataBaseSongID;
|
||||||
DateAdded = song.DateAdded;
|
DateAdded = song.DateAdded;
|
||||||
NumPlayed = song.NumPlayed;
|
NumPlayed = song.NumPlayed;
|
||||||
|
NumPlayedSession = song.NumPlayedSession;
|
||||||
|
|
||||||
Notes = new CNotes(song.Notes);
|
Notes = new CNotes(song.Notes);
|
||||||
}
|
}
|
||||||
@@ -328,7 +330,7 @@ namespace VocaluxeLib.Songs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BackgroundFileName == "")
|
if (BackgroundFileNames.Count == 0)
|
||||||
{
|
{
|
||||||
List<string> files = CHelper.ListFiles(Folder, "*.jpg");
|
List<string> files = CHelper.ListFiles(Folder, "*.jpg");
|
||||||
files.AddRange(CHelper.ListFiles(Folder, "*.jpeg"));
|
files.AddRange(CHelper.ListFiles(Folder, "*.jpeg"));
|
||||||
@@ -338,7 +340,7 @@ namespace VocaluxeLib.Songs
|
|||||||
{
|
{
|
||||||
if (file.ContainsIgnoreCase("[BG]") &&
|
if (file.ContainsIgnoreCase("[BG]") &&
|
||||||
(file.ContainsIgnoreCase(Title) || file.ContainsIgnoreCase(Artist)))
|
(file.ContainsIgnoreCase(Title) || file.ContainsIgnoreCase(Artist)))
|
||||||
BackgroundFileName = file;
|
BackgroundFileNames.Add(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ namespace VocaluxeLib.Songs
|
|||||||
break;
|
break;
|
||||||
case "BACKGROUND":
|
case "BACKGROUND":
|
||||||
if (File.Exists(Path.Combine(_Song.Folder, value)))
|
if (File.Exists(Path.Combine(_Song.Folder, value)))
|
||||||
_Song.BackgroundFileName = value;
|
_Song.BackgroundFileNames.Add(value);
|
||||||
else
|
else
|
||||||
_LogWarning("Can't find background file: " + Path.Combine(_Song.Folder, value));
|
_LogWarning("Can't find background file: " + Path.Combine(_Song.Folder, value));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace VocaluxeLib.Songs
|
|||||||
_WriteHeaderEntry("YEAR", _Song.Year);
|
_WriteHeaderEntry("YEAR", _Song.Year);
|
||||||
_WriteHeaderEntry("MP3", _Song.MP3FileName);
|
_WriteHeaderEntry("MP3", _Song.MP3FileName);
|
||||||
_WriteHeaderEntry("COVER", _Song.CoverFileName);
|
_WriteHeaderEntry("COVER", _Song.CoverFileName);
|
||||||
_WriteHeaderEntry("BACKGROUND", _Song.BackgroundFileName);
|
_WriteHeaderEntrys("BACKGROUND", _Song.BackgroundFileNames);
|
||||||
_WriteHeaderEntry("VIDEO", _Song.VideoFileName);
|
_WriteHeaderEntry("VIDEO", _Song.VideoFileName);
|
||||||
_WriteHeaderEntry("VIDEOGAP", _Song.VideoGap);
|
_WriteHeaderEntry("VIDEOGAP", _Song.VideoGap);
|
||||||
if (_Song.VideoAspect != EAspect.Crop)
|
if (_Song.VideoAspect != EAspect.Crop)
|
||||||
|
|||||||
Reference in new issue
Block a user