Merge pull request #356 from flokuep/develop

Minor fixes/release-0.4.1 merge
This commit is contained in:
Florian Küpper authored and GitHub committed 2017-12-26 11:48:48 +01:00
commit fc01e442b5
8 files changed
+140 -82

No files matched your search

+8 -8
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOCUMENT Type="Advanced Installer" CreateVersion="14.2.1" version="14.2.1" Modules="professional" RootPath="." Language="en" Id="{0664D363-F696-4E25-87C5-DE348E591191}"> <DOCUMENT Type="Advanced Installer" CreateVersion="14.2.1" version="14.4.2" Modules="professional" RootPath="." Language="en" Id="{0664D363-F696-4E25-87C5-DE348E591191}">
<COMPONENT cid="caphyon.advinst.msicomp.ProjectOptionsComponent"> <COMPONENT cid="caphyon.advinst.msicomp.ProjectOptionsComponent">
<ROW Name="HiddenItems" Value="AppXProductDetailsComponent;AppXDependenciesComponent;AppXAppDetailsComponent;AppXVisualAssetsComponent;AppXCapabilitiesComponent;AppXAppDeclarationsComponent;AppXUriRulesComponent;MsiJavaComponent;MsiDriverPackagesComponent;UserAccountsComponent;ScheduledTasksComponent;SqlConnectionComponent;AutorunComponent;FirewallExceptionComponent;GameUxComponent;MsiDirectEditorComponent;SharePointSlnComponent;SilverlightSlnComponent;MultipleInstancesComponent;SccmComponent;ActSyncAppComponent"/> <ROW Name="HiddenItems" Value="AppXProductDetailsComponent;AppXDependenciesComponent;AppXAppDetailsComponent;AppXVisualAssetsComponent;AppXCapabilitiesComponent;AppXAppDeclarationsComponent;AppXUriRulesComponent;MsiJavaComponent;MsiDriverPackagesComponent;UserAccountsComponent;ScheduledTasksComponent;SqlConnectionComponent;AutorunComponent;FirewallExceptionComponent;GameUxComponent;MsiDirectEditorComponent;SharePointSlnComponent;SilverlightSlnComponent;MultipleInstancesComponent;SccmComponent;ActSyncAppComponent"/>
</COMPONENT> </COMPONENT>
@@ -18,7 +18,7 @@
<ROW Property="ALLUSERS" Value="1"/> <ROW Property="ALLUSERS" Value="1"/>
<ROW Property="ARPCOMMENTS" Value="This installs Vocaluxe. Vocaluxe is an open source singing game inspired by SingStar™ and Ultrastar Deluxe." ValueLocId="*"/> <ROW Property="ARPCOMMENTS" Value="This installs Vocaluxe. Vocaluxe is an open source singing game inspired by SingStar™ and Ultrastar Deluxe." ValueLocId="*"/>
<ROW Property="ARPNOMODIFY" MultiBuildValue="DefaultBuild:1#x64_1:1"/> <ROW Property="ARPNOMODIFY" MultiBuildValue="DefaultBuild:1#x64_1:1"/>
<ROW Property="ARPNOREPAIR" Value="1"/> <ROW Property="ARPNOREPAIR" Value="1" MultiBuildValue="DefaultBuild:1#x64_1:1"/>
<ROW Property="ARPPRODUCTICON" Value="Vocaluxe.exe" Type="8"/> <ROW Property="ARPPRODUCTICON" Value="Vocaluxe.exe" Type="8"/>
<ROW Property="ARPURLINFOABOUT" Value="https://vocaluxe.org"/> <ROW Property="ARPURLINFOABOUT" Value="https://vocaluxe.org"/>
<ROW Property="BannerBitmap" Value="banner" MultiBuildValue="DefaultBuild:banner.jpg#x64_1:banner.jpg" Type="1" MsiKey="BannerBitmap"/> <ROW Property="BannerBitmap" Value="banner" MultiBuildValue="DefaultBuild:banner.jpg#x64_1:banner.jpg" Type="1" MsiKey="BannerBitmap"/>
@@ -28,7 +28,7 @@
<ROW Property="ProductCode" Value="1029:{DCDF3A8D-05B4-4CBF-8128-0BD10FDE4BDB} 1031:{3A3B2184-E965-4A08-8864-8B59990F963A} 1033:{756FABFA-4336-40AE-9245-60AB2D2C38F9} 1036:{ABCA971F-E153-4014-AC14-FF305678F6DE} 1038:{4345A445-5D72-4C8D-BB34-98C8B5D152E4} 1040:{D060F8C3-D29E-442F-B13C-B132B29C58BF} 1043:{5C0D700A-45AC-4616-94F6-2CAF8FA7E8AA} 1053:{0CAB03D2-183F-4680-970F-07F7EFAB0373} 1055:{307D49D0-9D47-409F-A3D1-92630CAE5C7E} 2070:{87BE9C14-3781-4EE9-871C-15E8F220A4E0} 3082:{F262F983-9F34-4201-B38B-0D45D2879E23} " Type="16"/> <ROW Property="ProductCode" Value="1029:{DCDF3A8D-05B4-4CBF-8128-0BD10FDE4BDB} 1031:{3A3B2184-E965-4A08-8864-8B59990F963A} 1033:{756FABFA-4336-40AE-9245-60AB2D2C38F9} 1036:{ABCA971F-E153-4014-AC14-FF305678F6DE} 1038:{4345A445-5D72-4C8D-BB34-98C8B5D152E4} 1040:{D060F8C3-D29E-442F-B13C-B132B29C58BF} 1043:{5C0D700A-45AC-4616-94F6-2CAF8FA7E8AA} 1053:{0CAB03D2-183F-4680-970F-07F7EFAB0373} 1055:{307D49D0-9D47-409F-A3D1-92630CAE5C7E} 2070:{87BE9C14-3781-4EE9-871C-15E8F220A4E0} 3082:{F262F983-9F34-4201-B38B-0D45D2879E23} " Type="16"/>
<ROW Property="ProductLanguage" Value="1055"/> <ROW Property="ProductLanguage" Value="1055"/>
<ROW Property="ProductName" Value="Vocaluxe"/> <ROW Property="ProductName" Value="Vocaluxe"/>
<ROW Property="ProductVersion" Value="0.4.0.11" Type="32" TargetFile="Vocaluxe.exe"/> <ROW Property="ProductVersion" Value="0.4.0.12" Type="32" TargetFile="Vocaluxe.exe"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/> <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
<ROW Property="UpgradeCode" Value="{4254D936-CC8F-4E52-B79B-A6C733ABEC96}"/> <ROW Property="UpgradeCode" Value="{4254D936-CC8F-4E52-B79B-A6C733ABEC96}"/>
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME#x64_1:Windows 9x/ME" ValueLocId="-"/> <ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME#x64_1:Windows 9x/ME" ValueLocId="-"/>
@@ -3765,8 +3765,8 @@
<ROW Action="AI_DetectSoftware" Sequence="101"/> <ROW Action="AI_DetectSoftware" Sequence="101"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent">
<ROW BuildKey="DefaultBuild" BuildName="x64" BuildOrder="1" BuildType="0" PackageFolder="Setup Files" Languages="en;cs;pt;fr;de;es;sv;hu;it;nl;tr" LangOpt="1" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExeIconPath="Files\Output\Vocaluxe.ico" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" UseLargeSchema="true" ExeName="[|ProductName]-[|ProductVersion]-x64" MsiPackageType="x64"/> <ROW BuildKey="DefaultBuild" BuildName="x64" BuildOrder="1" BuildType="0" PackageFolder="Setup Files" Languages="en;cs;pt;fr;de;es;sv;hu;it;nl;tr" LangOpt="1" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExeIconPath="Files\Output\Vocaluxe.ico" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" UseLargeSchema="true" ExeName="[|ProductName]_[|ProductVersion]_Windows_x64" MsiPackageType="x64"/>
<ROW BuildKey="x64_1" BuildName="x86" BuildOrder="2" BuildType="0" PackageFolder="Setup Files" Languages="en;cs;pt;fr;de;es;sv;hu;it;nl;tr" LangOpt="1" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExeIconPath="Files\Output\Vocaluxe.ico" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" UseLargeSchema="true" ExeName="[|ProductName]-[|ProductVersion]-x86"/> <ROW BuildKey="x64_1" BuildName="x86" BuildOrder="2" BuildType="0" PackageFolder="Setup Files" Languages="en;cs;pt;fr;de;es;sv;hu;it;nl;tr" LangOpt="1" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExeIconPath="Files\Output\Vocaluxe.ico" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" UseLargeSchema="true" ExeName="[|ProductName]_[|ProductVersion]_Windows_x86"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent"> <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent">
<ROW Path="&lt;AI_DICTS&gt;ui.ail"/> <ROW Path="&lt;AI_DICTS&gt;ui.ail"/>
@@ -4032,8 +4032,8 @@
<ATTRIBUTE name="PrereqsOrder" value="B63_41B8_9CB7_8C5E07C0FC18_ CB585686_DAA3_4384_BDDF_08ABA631E9F3_ C673FE9433B49AFAC9592AB26B8F8E4"/> <ATTRIBUTE name="PrereqsOrder" value="B63_41B8_9CB7_8C5E07C0FC18_ CB585686_DAA3_4384_BDDF_08ABA631E9F3_ C673FE9433B49AFAC9592AB26B8F8E4"/>
</COMPONENT> </COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.PreReqSearchComponent"> <COMPONENT cid="caphyon.advinst.msicomp.PreReqSearchComponent">
<ROW SearchKey="B63_41B8_9CB7_8C5E07C0FC18_Version" Prereq="B63_41B8_9CB7_8C5E07C0FC18_" SearchType="2" SearchString="HKLM\SOFTWARE\Microsoft\DevDiv\VC\Servicing\10.0\red\amd64\1033\Version" VerMin="40219.325" Order="1" Property="PreReqSearch_B63_41B8_9CB7_8C5E07C0FC18_"/> <ROW SearchKey="B63_41B8_9CB7_8C5E07C0FC18_Version" Prereq="B63_41B8_9CB7_8C5E07C0FC18_" SearchType="2" SearchString="HKLM\SOFTWARE\Microsoft\DevDiv\VC\Servicing\10.0\red\amd64\1033\Version" VerMin="40219.325" Order="1" Property="PreReqSearch_B63_41B8_9CB7_8C5E07C0"/>
<ROW SearchKey="C673FE9433B49AFAC9592AB26B8F8E4Install" Prereq="C673FE9433B49AFAC9592AB26B8F8E4" SearchType="9" SearchString="HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install" RefContent="M1" Order="1" Property="PreReqSearch_C673FE9433B49AFAC9592AB26B8F8E4"/> <ROW SearchKey="C673FE9433B49AFAC9592AB26B8F8E4Install" Prereq="C673FE9433B49AFAC9592AB26B8F8E4" SearchType="9" SearchString="HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install" RefContent="M1" Order="1" Property="PreReqSearch_C673FE9433B49AFAC9592A"/>
<ROW SearchKey="CB585686_DAA3_4384_BDDF_08ABA631E9F3_Version" Prereq="CB585686_DAA3_4384_BDDF_08ABA631E9F3_" SearchType="2" SearchString="HKLM\SOFTWARE\Microsoft\DevDiv\VC\Servicing\10.0\red\x86\1033\Version" VerMin="40219.325" Order="1" Property="PreReqSearch_CB585686_DAA3_4384_BDDF_08ABA631E9F3_"/> <ROW SearchKey="CB585686_DAA3_4384_BDDF_08ABA631E9F3_Version" Prereq="CB585686_DAA3_4384_BDDF_08ABA631E9F3_" SearchType="2" SearchString="HKLM\SOFTWARE\Microsoft\DevDiv\VC\Servicing\10.0\red\x86\1033\Version" VerMin="40219.325" Order="1" Property="PreReqSearch_CB585686_DAA3_4384_BDD"/>
</COMPONENT> </COMPONENT>
</DOCUMENT> </DOCUMENT>
@@ -152,8 +152,8 @@
<Skin>Plus</Skin> <Skin>Plus</Skin>
<SkinSelected>Plus</SkinSelected> <SkinSelected>Plus</SkinSelected>
<Rect> <Rect>
<X>145</X> <X>1180</X>
<Y>1200</Y> <Y>105</Y>
<W>40</W> <W>40</W>
<H>40</H> <H>40</H>
<Z>0</Z> <Z>0</Z>
@@ -179,8 +179,8 @@
<Skin>Minus</Skin> <Skin>Minus</Skin>
<SkinSelected>Minus</SkinSelected> <SkinSelected>Minus</SkinSelected>
<Rect> <Rect>
<X>145</X> <X>1130</X>
<Y>1200</Y> <Y>105</Y>
<W>40</W> <W>40</W>
<H>40</H> <H>40</H>
<Z>0</Z> <Z>0</Z>
@@ -148,12 +148,12 @@
<Space>10</Space> <Space>10</Space>
</SelReflection> </SelReflection>
</Button> </Button>
<Button Name="ButtonIncreaseTeams"> <Button Name="ButtonIncreaseTeams">
<Skin>Plus</Skin> <Skin>Plus</Skin>
<SkinSelected>Plus</SkinSelected> <SkinSelected>Plus</SkinSelected>
<Rect> <Rect>
<X>145</X> <X>1180</X>
<Y>1200</Y> <Y>105</Y>
<W>40</W> <W>40</W>
<H>40</H> <H>40</H>
<Z>0</Z> <Z>0</Z>
@@ -179,8 +179,8 @@
<Skin>Minus</Skin> <Skin>Minus</Skin>
<SkinSelected>Minus</SkinSelected> <SkinSelected>Minus</SkinSelected>
<Rect> <Rect>
<X>145</X> <X>1130</X>
<Y>1200</Y> <Y>105</Y>
<W>40</W> <W>40</W>
<H>40</H> <H>40</H>
<Z>0</Z> <Z>0</Z>
@@ -109,6 +109,7 @@ namespace VocaluxeLib.PartyModes.Challenge
Songs, Songs,
Names, Names,
Main, Main,
SongSelection,
Singing, Singing,
MedleySinging MedleySinging
} }
@@ -205,7 +206,6 @@ namespace VocaluxeLib.PartyModes.Challenge
{ {
if (!base.Init()) if (!base.Init())
return false; return false;
_Stage = EStage.Config;
SetDefaults(); SetDefaults();
return true; return true;
@@ -232,8 +232,9 @@ namespace VocaluxeLib.PartyModes.Challenge
return _Screens["CPartyScreenChallengeNames"]; return _Screens["CPartyScreenChallengeNames"];
case EStage.Main: case EStage.Main:
return _Screens["CPartyScreenChallengeMain"]; return _Screens["CPartyScreenChallengeMain"];
case EStage.Singing: case EStage.SongSelection:
return CBase.Graphics.GetScreen(EScreen.Song); return CBase.Graphics.GetScreen(EScreen.Song);
case EStage.Singing:
case EStage.MedleySinging: case EStage.MedleySinging:
return CBase.Graphics.GetScreen(EScreen.Sing); return CBase.Graphics.GetScreen(EScreen.Sing);
default: default:
@@ -266,10 +267,18 @@ namespace VocaluxeLib.PartyModes.Challenge
break; break;
case EStage.Main: case EStage.Main:
if (GameData.GameMode == EGameMode.TR_GAMEMODE_MEDLEY) if (GameData.GameMode == EGameMode.TR_GAMEMODE_MEDLEY)
{
_Stage = EStage.MedleySinging; _Stage = EStage.MedleySinging;
_PrepareMedleyRound();
}
else else
_Stage = EStage.Singing; {
_StartNextRound(); _Stage = EStage.SongSelection;
_PrepareSongSelection();
}
break;
case EStage.SongSelection:
_Stage = EStage.Singing;
break; break;
case EStage.MedleySinging: case EStage.MedleySinging:
case EStage.Singing: case EStage.Singing:
@@ -311,7 +320,11 @@ namespace VocaluxeLib.PartyModes.Challenge
public override SScreenSongOptions GetScreenSongOptions() public override SScreenSongOptions GetScreenSongOptions()
{ {
switch(GameData.SongSource) _ScreenSongOptions.Selection.RandomOnly = true;
_ScreenSongOptions.Sorting.IgnoreArticles = CBase.Config.GetIgnoreArticles();
switch (GameData.SongSource)
{ {
case ESongSource.TR_SONGSOURCE_ALLSONGS: case ESongSource.TR_SONGSOURCE_ALLSONGS:
_ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting(); _ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting();
@@ -342,9 +355,6 @@ namespace VocaluxeLib.PartyModes.Challenge
_ScreenSongOptions.Selection.CategoryChangeAllowed = false; _ScreenSongOptions.Selection.CategoryChangeAllowed = false;
break; break;
} }
_ScreenSongOptions.Sorting.IgnoreArticles = CBase.Config.GetIgnoreArticles();
return _ScreenSongOptions; return _ScreenSongOptions;
} }
@@ -419,63 +429,76 @@ namespace VocaluxeLib.PartyModes.Challenge
public override void SongSelected(int songID) public override void SongSelected(int songID)
{ {
_PrepareGame(new int[] { songID }); _PrepareRound(new int[] { songID });
CBase.Graphics.FadeTo(EScreen.Sing); Next();
} }
public override void LeavingHighscore() public override void LeavingHighscore()
{ {
CBase.Songs.AddPartySongSung(CBase.Game.GetSong(0).ID); //Remember sung songs, so they don't will be selected a second time
for(int i = 0; i < CBase.Game.GetNumSongs(); i++)
CBase.Songs.AddPartySongSung(CBase.Game.GetSong(i).ID);
GameData.CurrentRoundNr++; GameData.CurrentRoundNr++;
Next(); Next();
} }
private void _StartNextRound() /// <summary>
/// Start a new medley round based on song configuration
/// </summary>
private void _PrepareMedleyRound()
{ {
if (GameData.GameMode == EGameMode.TR_GAMEMODE_MEDLEY) //Select songs for medley
int[] songIDs = new int[GameData.NumMedleySongs];
for (int i = 0; i < GameData.NumMedleySongs; i++)
{ {
int[] songIDs = new int[GameData.NumMedleySongs]; if (GameData.Songs.Count == 0)
for (int i = 0; i < GameData.NumMedleySongs; i++) _UpdateSongList();
{
if (GameData.Songs.Count == 0)
_UpdateSongList();
songIDs[i] = GameData.Songs[0]; songIDs[i] = GameData.Songs[0];
GameData.Songs.RemoveAt(0); GameData.Songs.RemoveAt(0);
} }
_PrepareGame(songIDs); _PrepareRound(songIDs);
}
else
{
_ScreenSongOptions.Selection.RandomOnly = _ScreenSongOptions.Sorting.Tabs != EOffOn.TR_CONFIG_ON;
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
_SetNumJokers();
_SetTeamNames();
GameData.CatSongIndices = null;
}
} }
private bool _PrepareGame(int[] songIDs) /// <summary>
/// Setup options for song selection
/// </summary>
private void _PrepareSongSelection()
{ {
_ScreenSongOptions.Selection.RandomOnly = _ScreenSongOptions.Sorting.Tabs != EOffOn.TR_CONFIG_ON;
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
_SetNumJokers();
_SetTeamNames();
GameData.CatSongIndices = null;
}
/// <summary>
/// Prepare next game and fill song queue based on configuration and given songs.
/// </summary>
/// <param name="songIDs">Array of SongIDs that are selected</param>
/// <returns>false, if something can't setup correctly</returns>
private bool _PrepareRound(int[] songIDs)
{
//Reset game
CBase.Game.Reset(); CBase.Game.Reset();
CBase.Game.ClearSongs(); CBase.Game.ClearSongs();
#region PlayerNames #region PlayerNames
CBase.Game.SetNumPlayer(GameData.NumPlayerAtOnce); CBase.Game.SetNumPlayer(GameData.NumPlayerAtOnce);
SPlayer[] players = CBase.Game.GetPlayers(); SPlayer[] players = CBase.Game.GetPlayers();
if (players == null) if (players == null || players.Length < GameData.NumPlayerAtOnce)
return false;
if (players.Length < GameData.NumPlayerAtOnce)
return false; return false;
//Get current round
CRound c = GameData.Rounds[GameData.CurrentRoundNr - 1]; CRound c = GameData.Rounds[GameData.CurrentRoundNr - 1];
for (int i = 0; i < GameData.NumPlayerAtOnce; i++) for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
{ {
//try to fill with the right data //try to fill with correct player data
if (c != null) if (c != null)
players[i].ProfileID = GameData.ProfileIDs[c.Players[i]]; players[i].ProfileID = GameData.ProfileIDs[c.Players[i]];
else else
@@ -484,6 +507,7 @@ namespace VocaluxeLib.PartyModes.Challenge
#endregion PlayerNames #endregion PlayerNames
#region SongQueue #region SongQueue
//Add all songs with configure game mode to song queue
for (int i = 0; i < songIDs.Length; i++) for (int i = 0; i < songIDs.Length; i++)
CBase.Game.AddSong(songIDs[i], GameData.GameMode); CBase.Game.AddSong(songIDs[i], GameData.GameMode);
#endregion SongQueue #endregion SongQueue
@@ -534,6 +558,10 @@ namespace VocaluxeLib.PartyModes.Challenge
_ScreenSongOptions.Selection.TeamNames[i] = CBase.Profiles.GetPlayerName(GameData.ProfileIDs[c.Players[i]]); _ScreenSongOptions.Selection.TeamNames[i] = CBase.Profiles.GetPlayerName(GameData.ProfileIDs[c.Players[i]]);
} }
/// <summary>
/// Fill song list based on song configuration. This is basically needed for singing medleys,
/// because we don't show song selection screen for these games.
/// </summary>
private void _UpdateSongList() private void _UpdateSongList()
{ {
if (GameData.Songs.Count > 0) if (GameData.Songs.Count > 0)
@@ -556,11 +584,16 @@ namespace VocaluxeLib.PartyModes.Challenge
break; break;
case ESongSource.TR_SONGSOURCE_CATEGORY: case ESongSource.TR_SONGSOURCE_CATEGORY:
//Save old sorting to roll it back after getting songs for configured category
ESongSorting oldSorting = CBase.Config.GetSongSorting();
CBase.Songs.SortSongs(GameData.Sorting, EOffOn.TR_CONFIG_ON, CBase.Config.GetIgnoreArticles() ,String.Empty, EDuetOptions.NoDuets, -1);
CBase.Songs.SetCategory(GameData.CategoryIndex); CBase.Songs.SetCategory(GameData.CategoryIndex);
avSongs = CBase.Songs.GetVisibleSongs(); avSongs = CBase.Songs.GetVisibleSongs();
GameData.Songs.AddRange(avSongs.Where(song => song.AvailableGameModes.Contains(EGameMode.TR_GAMEMODE_MEDLEY)).Select(song => song.ID)); GameData.Songs.AddRange(avSongs.Where(song => song.AvailableGameModes.Contains(EGameMode.TR_GAMEMODE_MEDLEY)).Select(song => song.ID));
CBase.Songs.SetCategory(-1); CBase.Songs.SetCategory(-1);
CBase.Songs.SortSongs(oldSorting, CBase.Config.GetTabs(), CBase.Config.GetIgnoreArticles(), String.Empty, EDuetOptions.NoDuets, -1);
break; break;
} }
GameData.Songs.Shuffle(); GameData.Songs.Shuffle();
@@ -690,8 +723,8 @@ namespace VocaluxeLib.PartyModes.Challenge
if (GameData.CatSongIndices == null && CBase.Songs.GetNumCategories() > 0 && _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON) if (GameData.CatSongIndices == null && CBase.Songs.GetNumCategories() > 0 && _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
{ {
GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()]; GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()];
for (int i = 0; i < GameData.CatSongIndices.Length; i++) for (int i = 1; i < GameData.CatSongIndices.Length; i++)
GameData.CatSongIndices[i] = -1; GameData.CatSongIndices[i] = CBase.Songs.GetNumSongsInCategory(i) + GameData.CatSongIndices[i - 1];
} }
if (CBase.Songs.GetNumCategories() == 0 || _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF) if (CBase.Songs.GetNumCategories() == 0 || _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF)
+1 -8
View File
@@ -263,7 +263,6 @@ namespace Vocaluxe.Base
if (_PreviewStartHelperTask != null && (_PreviewPlayer.Length > 0 || _PreviewStartWaitCounter++ >= _PreviewStartWaitMaxTries)) if (_PreviewStartHelperTask != null && (_PreviewPlayer.Length > 0 || _PreviewStartWaitCounter++ >= _PreviewStartWaitMaxTries))
{ {
_PreviewStartHelperTask.RunSynchronously(TaskScheduler.FromCurrentSynchronizationContext()); _PreviewStartHelperTask.RunSynchronously(TaskScheduler.FromCurrentSynchronizationContext());
_PreviewStartHelperTask.Dispose();
_PreviewStartHelperTask = null; _PreviewStartHelperTask = null;
_PreviewStartWaitCounter = 0; _PreviewStartWaitCounter = 0;
} }
@@ -323,15 +322,10 @@ namespace Vocaluxe.Base
//Change song position only if song is changed or near to end //Change song position only if song is changed or near to end
if (songChanged || _CurPlayer.Position + 30 < _CurPlayer.Length) if (songChanged || _CurPlayer.Position + 30 < _CurPlayer.Length || _PreviewStartHelperTask == null)
{ {
lock (_PreviewStartHelperTaskLock) lock (_PreviewStartHelperTaskLock)
{ {
// Check if the old _PreviewStartHelperTask needs to disposed
if (_PreviewStartHelperTask != null)
{
_PreviewStartHelperTask.Dispose();
}
_PreviewStartHelperTask = new Task(() => _PreviewStartHelperTask = new Task(() =>
{ {
float length = _PreviewPlayer.Length; float length = _PreviewPlayer.Length;
@@ -360,7 +354,6 @@ namespace Vocaluxe.Base
// Recheck the condition as it cloud have change before we got the lock // Recheck the condition as it cloud have change before we got the lock
if (_PreviewStartHelperTask != null) if (_PreviewStartHelperTask != null)
{ {
_PreviewStartHelperTask.Dispose();
_PreviewStartHelperTask = null; _PreviewStartHelperTask = null;
} }
} }
+27 -9
View File
@@ -463,10 +463,19 @@ namespace Vocaluxe.Lib.Database
if (reader != null && reader.HasRows) if (reader != null && reader.HasRows)
{ {
reader.Read(); reader.Read();
artist = reader.GetString(0);
title = reader.GetString(1); if (!reader.IsDBNull(0))
numPlayed = reader.GetInt32(2); artist = reader.GetString(0);
dateAdded = new DateTime(reader.GetInt64(3));
if (!reader.IsDBNull(1))
title = reader.GetString(1);
if (!reader.IsDBNull(2))
numPlayed = reader.GetInt32(2);
if (!reader.IsDBNull(3))
dateAdded = new DateTime(reader.GetInt64(3));
reader.Dispose(); reader.Dispose();
return true; return true;
} }
@@ -604,7 +613,7 @@ namespace Vocaluxe.Lib.Database
{ {
//Check for USDX 1.1 DB //Check for USDX 1.1 DB
_CreateHighscoreDBV1(filePath); _CreateHighscoreDBV1(filePath);
result &= !_ConvertFrom110(filePath); result &= _ConvertFrom110(filePath);
result &= _UpdateDatabase(1, connection); result &= _UpdateDatabase(1, connection);
result &= _UpdateDatabase(2, connection); result &= _UpdateDatabase(2, connection);
} }
@@ -733,13 +742,22 @@ namespace Vocaluxe.Lib.Database
transaction.Commit(); transaction.Commit();
//Delete old tables after conversion //Delete old tables after conversion
command.CommandText = "DROP TABLE US_Scores;"; command.CommandText = "DROP TABLE IF EXISTS us_scores;";
command.ExecuteNonQuery(); command.ExecuteNonQuery();
command.CommandText = "DROP TABLE US_Songs;"; command.CommandText = "DROP TABLE IF EXISTS us_songs;";
command.ExecuteNonQuery(); command.ExecuteNonQuery();
command.CommandText = "DROP TABLE us_statistics_info;"; command.CommandText = "DROP TABLE IF EXISTS us_statistics_info;";
command.ExecuteNonQuery();
command.CommandText = "DROP TABLE IF EXISTS us_users_info;";
command.ExecuteNonQuery();
command.CommandText = "DROP TABLE IF EXISTS us_webs;";
command.ExecuteNonQuery();
command.CommandText = "DROP TABLE IF EXISTS us_webs_stats;";
command.ExecuteNonQuery(); command.ExecuteNonQuery();
//This versioning is not used in Vocaluxe so reset it to 0 //This versioning is not used in Vocaluxe so reset it to 0
@@ -918,7 +936,7 @@ namespace Vocaluxe.Lib.Database
if (currentVersion < 2) if (currentVersion < 2)
updated &= _ConvertV1toV2(connection); updated &= _ConvertV1toV2(connection);
if (currentVersion < 3) else if (currentVersion < 3)
updated &= _ConvertV2toV3(connection); updated &= _ConvertV2toV3(connection);
return updated; return updated;
@@ -70,14 +70,20 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
{ {
get get
{ {
if (_Element != null)
if (_Element == null || (_Element.CurrentState == State.Paused && _Element.PendingState != State.VoidPending))
{ {
long position; return _Position;
if (!_Element.QueryPosition(Format.Time, out position))
CLog.LogError("Could not query position");
else
_Position = ((float)position / Constants.SECOND);
} }
long position;
if (!_Element.QueryPosition(Format.Time, out position))
CLog.LogError("Could not query position");
else
_Position = ((float)position / Constants.SECOND);
return _Position; return _Position;
} }
set set
+11 -3
View File
@@ -588,12 +588,15 @@ namespace VocaluxeLib.Menu
} }
else else
{ {
_NumPlayerTeams[i] = _NumPlayer; //Get average num players per teams as default player number
_NumPlayerTeams[i] = _NumPlayer / (_NumTeams - 1);
_NumPlayer += _NumPlayerTeams[i];
_TeamList[i] = new List<Guid>(); _TeamList[i] = new List<Guid>();
} }
} }
} }
_UpdateButtonState(); _UpdateButtonState();
_UpdateTeamSlide();
} }
public void DecreaseTeamNum() public void DecreaseTeamNum()
@@ -604,6 +607,7 @@ namespace VocaluxeLib.Menu
if (_NumTeams - 1 >= _PartyMode.MinTeams) if (_NumTeams - 1 >= _PartyMode.MinTeams)
_NumTeams--; _NumTeams--;
_UpdateButtonState(); _UpdateButtonState();
_UpdateTeamSlide();
} }
public void IncreasePlayerNum(int team) public void IncreasePlayerNum(int team)
@@ -692,16 +696,20 @@ namespace VocaluxeLib.Menu
private void _UpdateTeamSlide() private void _UpdateTeamSlide()
{ {
int sel = _SelectSlides[_SelectSlideTeams].Selection;
_SelectSlides[_SelectSlideTeams].Visible = _Teams; _SelectSlides[_SelectSlideTeams].Visible = _Teams;
_SelectSlides[_SelectSlideTeams].Clear(); _SelectSlides[_SelectSlideTeams].Clear();
for (int i = 1; i <= _NumTeams; i++) for (int i = 1; i <= _NumTeams; i++)
_SelectSlides[_SelectSlideTeams].AddValue("Team " + i, null, i); _SelectSlides[_SelectSlideTeams].AddValue("Team " + i, null, i);
_SelectSlides[_SelectSlideTeams].Selection = Math.Min(sel, _SelectSlides[_SelectSlideTeams].NumValues - 1);
} }
private void _UpdateButtonVisibility() private void _UpdateButtonVisibility()
{ {
_Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; _Buttons[_ButtonIncreaseTeams].Visible = _AllowChangeTeamNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams;
_Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; _Buttons[_ButtonDecreaseTeams].Visible = _AllowChangeTeamNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams;
_Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum; _Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum;
_Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum; _Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum;
} }