From b8fb0d754946ef63187ba03c03aca1286005eab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Wed, 22 Nov 2017 20:12:22 +0100 Subject: [PATCH 01/11] Make reading HighscoreDB more robust if song entries are incomplete --- Vocaluxe/Lib/Database/CHighscoreDB.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/Lib/Database/CHighscoreDB.cs b/Vocaluxe/Lib/Database/CHighscoreDB.cs index 35e9fe87..1e0026b5 100644 --- a/Vocaluxe/Lib/Database/CHighscoreDB.cs +++ b/Vocaluxe/Lib/Database/CHighscoreDB.cs @@ -463,10 +463,19 @@ namespace Vocaluxe.Lib.Database if (reader != null && reader.HasRows) { reader.Read(); - artist = reader.GetString(0); - title = reader.GetString(1); - numPlayed = reader.GetInt32(2); - dateAdded = new DateTime(reader.GetInt64(3)); + + if (!reader.IsDBNull(0)) + artist = reader.GetString(0); + + 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(); return true; } From d7e924b72bd1d7dc171bdde2aca00e445935d187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Thu, 23 Nov 2017 16:50:07 +0100 Subject: [PATCH 02/11] Fixed installer file names --- Installer/setup.aip | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Installer/setup.aip b/Installer/setup.aip index 1309ecc0..cf17cbd8 100644 --- a/Installer/setup.aip +++ b/Installer/setup.aip @@ -3765,8 +3765,8 @@ - - + + From 1baed149afc4987d395f1fb3f0b46f5fcfbfab6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Thu, 23 Nov 2017 16:54:30 +0100 Subject: [PATCH 03/11] Updated AdvancedInstaller version --- Installer/setup.aip | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Installer/setup.aip b/Installer/setup.aip index cf17cbd8..afe22b95 100644 --- a/Installer/setup.aip +++ b/Installer/setup.aip @@ -1,5 +1,5 @@ - + @@ -18,7 +18,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -4032,8 +4032,8 @@ - - - + + + From feb5c1eaed39d5c0c8414fbad1028e170f0a3380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Fri, 1 Dec 2017 16:41:21 +0100 Subject: [PATCH 04/11] Fix: PartyNameSelection visibility of team increase/decrease button --- VocaluxeLib/Menu/CMenuPartyNameSelection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs index cc01f135..b4953cde 100644 --- a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs +++ b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs @@ -699,8 +699,8 @@ namespace VocaluxeLib.Menu private void _UpdateButtonVisibility() { - _Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; - _Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; + _Buttons[_ButtonIncreaseTeams].Visible = _AllowChangeTeamNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; + _Buttons[_ButtonDecreaseTeams].Visible = _AllowChangeTeamNum && _Teams && _PartyMode.MinTeams != _PartyMode.MaxTeams; _Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum; _Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum; } From 7fdbd8780bb0d9670add94a4ece1079cd54b5ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Fri, 1 Dec 2017 17:14:28 +0100 Subject: [PATCH 05/11] Fixed updating team-slide in PartyNameSelection --- VocaluxeLib/Menu/CMenuPartyNameSelection.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs index b4953cde..2fb514ef 100644 --- a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs +++ b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs @@ -593,6 +593,7 @@ namespace VocaluxeLib.Menu } } _UpdateButtonState(); + _UpdateTeamSlide(); } public void DecreaseTeamNum() @@ -603,6 +604,7 @@ namespace VocaluxeLib.Menu if (_NumTeams - 1 >= _PartyMode.MinTeams) _NumTeams--; _UpdateButtonState(); + _UpdateTeamSlide(); } public void IncreasePlayerNum(int team) From 5296627f8dab6da96cfb4d3908605e904e476e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sat, 2 Dec 2017 16:45:41 +0100 Subject: [PATCH 06/11] Fixed converting Ultrastar.db --- Vocaluxe/Lib/Database/CHighscoreDB.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Lib/Database/CHighscoreDB.cs b/Vocaluxe/Lib/Database/CHighscoreDB.cs index 1e0026b5..981bce4b 100644 --- a/Vocaluxe/Lib/Database/CHighscoreDB.cs +++ b/Vocaluxe/Lib/Database/CHighscoreDB.cs @@ -613,7 +613,7 @@ namespace Vocaluxe.Lib.Database { //Check for USDX 1.1 DB _CreateHighscoreDBV1(filePath); - result &= !_ConvertFrom110(filePath); + result &= _ConvertFrom110(filePath); result &= _UpdateDatabase(1, connection); result &= _UpdateDatabase(2, connection); } @@ -927,7 +927,7 @@ namespace Vocaluxe.Lib.Database if (currentVersion < 2) updated &= _ConvertV1toV2(connection); - if (currentVersion < 3) + else if (currentVersion < 3) updated &= _ConvertV2toV3(connection); return updated; From e9abec565d8f171ad4b32776d864946c4ca87dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sat, 2 Dec 2017 21:57:22 +0100 Subject: [PATCH 07/11] Removed unused tables after converting Ultrastar.db --- Vocaluxe/Lib/Database/CHighscoreDB.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Lib/Database/CHighscoreDB.cs b/Vocaluxe/Lib/Database/CHighscoreDB.cs index 981bce4b..c6683788 100644 --- a/Vocaluxe/Lib/Database/CHighscoreDB.cs +++ b/Vocaluxe/Lib/Database/CHighscoreDB.cs @@ -742,13 +742,22 @@ namespace Vocaluxe.Lib.Database transaction.Commit(); //Delete old tables after conversion - command.CommandText = "DROP TABLE US_Scores;"; + command.CommandText = "DROP TABLE IF EXISTS us_scores;"; command.ExecuteNonQuery(); - command.CommandText = "DROP TABLE US_Songs;"; + command.CommandText = "DROP TABLE IF EXISTS us_songs;"; 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(); //This versioning is not used in Vocaluxe so reset it to 0 From 7f3d9c5f411e84821824f9fdf9601b38aa60830f Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Sat, 2 Dec 2017 15:46:24 +0100 Subject: [PATCH 08/11] Fix: Button SelColor Correctly set Selcolor when creating one based on an existing button. --- VocaluxeLib/Menu/CButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VocaluxeLib/Menu/CButton.cs b/VocaluxeLib/Menu/CButton.cs index b0ca4a48..ee77d7aa 100644 --- a/VocaluxeLib/Menu/CButton.cs +++ b/VocaluxeLib/Menu/CButton.cs @@ -135,7 +135,7 @@ namespace VocaluxeLib.Menu MaxRect = button.MaxRect; Color = button.Color; - SelColor = button.Color; + SelColor = button.SelColor; Texture = button.Texture; SelTexture = button.SelTexture; From 064b5412a6fc0c750bfff970772c7353b8f392ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 3 Dec 2017 12:38:50 +0100 Subject: [PATCH 09/11] Fix: Increase team number in PartyNameSelction --- VocaluxeLib/Menu/CMenuPartyNameSelection.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs index 2fb514ef..063d3b12 100644 --- a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs +++ b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs @@ -15,6 +15,7 @@ // along with Vocaluxe. If not, see . #endregion +using System; using System.Collections.Generic; using System.Windows.Forms; using VocaluxeLib.Draw; @@ -587,7 +588,9 @@ namespace VocaluxeLib.Menu } 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(); } } @@ -693,10 +696,14 @@ namespace VocaluxeLib.Menu private void _UpdateTeamSlide() { + int sel = _SelectSlides[_SelectSlideTeams].Selection; + _SelectSlides[_SelectSlideTeams].Visible = _Teams; _SelectSlides[_SelectSlideTeams].Clear(); for (int i = 1; i <= _NumTeams; i++) _SelectSlides[_SelectSlideTeams].AddValue("Team " + i, null, i); + + _SelectSlides[_SelectSlideTeams].Selection = Math.Min(sel, _SelectSlides[_SelectSlideTeams].NumValues - 1); } private void _UpdateButtonVisibility() From 60a6f8d3476c34e1fe31ce3a7e37afe1d27fb01e Mon Sep 17 00:00:00 2001 From: Pr3di Date: Fri, 17 Nov 2017 19:26:36 +0100 Subject: [PATCH 10/11] NullPointerException abgefangen (cherry picked from commit 6782f5104a25c0f346f7f913762de36c071c8a9f) --- Vocaluxe/Base/CBackgroundMusic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index f9146f12..b8768aa7 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -323,7 +323,7 @@ namespace Vocaluxe.Base //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) { From 9599c1a616a942e3dbab883637d7f833c19e7aa0 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Thu, 21 Dec 2017 15:08:12 +0100 Subject: [PATCH 11/11] Fix: meaningless "Could not query position" messages in the log --- .../CGstreamerSharpAudioStream.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Lib/Sound/Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs b/Vocaluxe/Lib/Sound/Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs index 0808b506..452056d0 100644 --- a/Vocaluxe/Lib/Sound/Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs +++ b/Vocaluxe/Lib/Sound/Playback/GstreamerSharp/CGstreamerSharpAudioStream.cs @@ -70,14 +70,20 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp { get { - if (_Element != null) + + if (_Element == null || (_Element.CurrentState == State.Paused && _Element.PendingState != State.VoidPending)) { - long position; - if (!_Element.QueryPosition(Format.Time, out position)) - CLog.LogError("Could not query position"); - else - _Position = ((float)position / Constants.SECOND); + return _Position; } + + + long position; + if (!_Element.QueryPosition(Format.Time, out position)) + CLog.LogError("Could not query position"); + else + _Position = ((float)position / Constants.SECOND); + + return _Position; } set