Warning Sound Effect (#837)
* Better Highscore and ProgressBar Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound, Update Highscore & Elevating Sound * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Renamed _HasPlayedSound to _HasPlayedHighscoreSound for clarity. * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect * Add Warning Sound Effect
This commit is contained in:
1 parent
20c6898baa
commit
320082414a
12 files changed
+209
-11
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,6 +2,7 @@
|
|||||||
APPLAUSE SOUNDS
|
APPLAUSE SOUNDS
|
||||||
HIGHSCORE SOUND
|
HIGHSCORE SOUND
|
||||||
ELEVATING SOUND
|
ELEVATING SOUND
|
||||||
|
WARNING SOUND
|
||||||
-----
|
-----
|
||||||
for free without attribution (check pixabay content license)
|
for free without attribution (check pixabay content license)
|
||||||
enjoy
|
enjoy
|
||||||
@@ -10,5 +11,6 @@ enjoy
|
|||||||
https://pixabay.com/de/sound-effects/small-applause-6695/
|
https://pixabay.com/de/sound-effects/small-applause-6695/
|
||||||
https://pixabay.com/de/sound-effects/short-crowd-cheer-6713/
|
https://pixabay.com/de/sound-effects/short-crowd-cheer-6713/
|
||||||
https://pixabay.com/de/sound-effects/cheering-and-clapping-crowd-1-5995/
|
https://pixabay.com/de/sound-effects/cheering-and-clapping-crowd-1-5995/
|
||||||
https://pixabay.com/de/sound-effects/achive-sound-132273/
|
https://pixabay.com/sound-effects/film-special-effects-arcade-ui-6-229503/
|
||||||
https://pixabay.com/sound-effects/stuttering-climax-31002/
|
https://pixabay.com/sound-effects/film-special-effects-047747-high-score-fill-75680/
|
||||||
|
https://pixabay.com/sound-effects/film-special-effects-error-call-to-attention-129258/
|
||||||
@@ -126,6 +126,7 @@ namespace Vocaluxe.Base
|
|||||||
public const string FileNameSoundApplauseHigh = "ApplauseHigh.mp3";
|
public const string FileNameSoundApplauseHigh = "ApplauseHigh.mp3";
|
||||||
public const string FileNameSoundHighscore = "Highscore.mp3";
|
public const string FileNameSoundHighscore = "Highscore.mp3";
|
||||||
public const string FileNameSoundProgressBar = "ProgressBar.mp3";
|
public const string FileNameSoundProgressBar = "ProgressBar.mp3";
|
||||||
|
public const string FileNameSoundWarning = "Warning.mp3";
|
||||||
|
|
||||||
public const string FolderNameSongs = "Songs";
|
public const string FolderNameSongs = "Songs";
|
||||||
public const string FolderNameProfiles = "Profiles";
|
public const string FolderNameProfiles = "Profiles";
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ namespace Vocaluxe.Base
|
|||||||
ApplauseMid,
|
ApplauseMid,
|
||||||
ApplauseHigh,
|
ApplauseHigh,
|
||||||
Highscore,
|
Highscore,
|
||||||
ProgressBar
|
ProgressBar,
|
||||||
|
Warning
|
||||||
}
|
}
|
||||||
|
|
||||||
static class CSound
|
static class CSound
|
||||||
@@ -206,6 +207,9 @@ namespace Vocaluxe.Base
|
|||||||
case ESounds.ProgressBar:
|
case ESounds.ProgressBar:
|
||||||
file = Path.Combine(file, CSettings.FileNameSoundProgressBar);
|
file = Path.Combine(file, CSettings.FileNameSoundProgressBar);
|
||||||
break;
|
break;
|
||||||
|
case ESounds.Warning:
|
||||||
|
file = Path.Combine(file, CSettings.FileNameSoundWarning);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace Vocaluxe.Screens
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int _HighscoreStream = -1;
|
private int _HighscoreStream = -1;
|
||||||
private bool _HasPlayedSound = false;
|
private bool _HasPlayedHighscoreSound = false;
|
||||||
|
|
||||||
private static int PlaySound(ESounds sound, int volume)
|
private static int PlaySound(ESounds sound, int volume)
|
||||||
{
|
{
|
||||||
@@ -197,10 +197,10 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
_ParticleEffects[_ParticleEffectNew[p]].Visible = _IsNewEntry(_Scores[_Round][_Pos + p].ID);
|
_ParticleEffects[_ParticleEffectNew[p]].Visible = _IsNewEntry(_Scores[_Round][_Pos + p].ID);
|
||||||
|
|
||||||
if (_ParticleEffects[_ParticleEffectNew[p]].Visible && !_HasPlayedSound)
|
if (_ParticleEffects[_ParticleEffectNew[p]].Visible && !_HasPlayedHighscoreSound)
|
||||||
{
|
{
|
||||||
_HighscoreStream = CScreenHighscore.PlaySound(ESounds.Highscore, CConfig.SoundEffectVolume);
|
_HighscoreStream = CScreenHighscore.PlaySound(ESounds.Highscore, CConfig.SoundEffectVolume);
|
||||||
_HasPlayedSound = true;
|
_HasPlayedHighscoreSound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -218,7 +218,7 @@ namespace Vocaluxe.Screens
|
|||||||
public override void OnShow()
|
public override void OnShow()
|
||||||
{
|
{
|
||||||
base.OnShow();
|
base.OnShow();
|
||||||
_HasPlayedSound = false;
|
_HasPlayedHighscoreSound = false;
|
||||||
_Round = 0;
|
_Round = 0;
|
||||||
_Pos = 0;
|
_Pos = 0;
|
||||||
_NewEntryIDs.Clear();
|
_NewEntryIDs.Clear();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ using System.Windows.Forms;
|
|||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using VocaluxeLib;
|
using VocaluxeLib;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
using Vocaluxe.Lib.Sound;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
@@ -39,6 +40,17 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _TextWarningProfiles = "TextWarningProfiles";
|
private const string _TextWarningProfiles = "TextWarningProfiles";
|
||||||
private const string _TextRelease = "TextRelease";
|
private const string _TextRelease = "TextRelease";
|
||||||
|
|
||||||
|
private int _WarningStream = -1;
|
||||||
|
private bool _HasPlayedWarningSound = false;
|
||||||
|
|
||||||
|
private static int PlaySound(ESounds sound, int volume)
|
||||||
|
{
|
||||||
|
int streamId = CSound.PlaySound(sound, false);
|
||||||
|
CSound.SetStreamVolume(streamId, volume);
|
||||||
|
|
||||||
|
return streamId;
|
||||||
|
}
|
||||||
|
|
||||||
//CParticleEffect Snowflakes;
|
//CParticleEffect Snowflakes;
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
@@ -71,19 +83,23 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
case Keys.O:
|
case Keys.O:
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.S:
|
case Keys.S:
|
||||||
if (CProfiles.NumProfiles > 0)
|
if (CProfiles.NumProfiles > 0)
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.C:
|
case Keys.C:
|
||||||
CGraphics.FadeTo(EScreen.Credits);
|
CGraphics.FadeTo(EScreen.Credits);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.T:
|
case Keys.T:
|
||||||
CGraphics.FadeTo(EScreen.Test);
|
CGraphics.FadeTo(EScreen.Test);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
@@ -91,16 +107,26 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
CParty.SetNormalGameMode();
|
CParty.SetNormalGameMode();
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonParty].Selected)
|
if (_Buttons[_ButtonParty].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Party);
|
CGraphics.FadeTo(EScreen.Party);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonOptions].Selected)
|
if (_Buttons[_ButtonOptions].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonProfiles].Selected)
|
if (_Buttons[_ButtonProfiles].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Profiles);
|
CGraphics.FadeTo(EScreen.Profiles);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonExit].Selected)
|
if (_Buttons[_ButtonExit].Selected)
|
||||||
return false;
|
return false;
|
||||||
@@ -125,16 +151,26 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
CParty.SetNormalGameMode();
|
CParty.SetNormalGameMode();
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonParty].Selected)
|
if (_Buttons[_ButtonParty].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Party);
|
CGraphics.FadeTo(EScreen.Party);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonOptions].Selected)
|
if (_Buttons[_ButtonOptions].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonProfiles].Selected)
|
if (_Buttons[_ButtonProfiles].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Profiles);
|
CGraphics.FadeTo(EScreen.Profiles);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonExit].Selected)
|
if (_Buttons[_ButtonExit].Selected)
|
||||||
return false;
|
return false;
|
||||||
@@ -150,7 +186,22 @@ namespace Vocaluxe.Screens
|
|||||||
_Texts[_TextWarningProfiles].Visible = !profileOK;
|
_Texts[_TextWarningProfiles].Visible = !profileOK;
|
||||||
_Buttons[_ButtonSing].Selectable = profileOK;
|
_Buttons[_ButtonSing].Selectable = profileOK;
|
||||||
_Buttons[_ButtonParty].Selectable = profileOK;
|
_Buttons[_ButtonParty].Selectable = profileOK;
|
||||||
|
|
||||||
|
if (_Texts[_TextWarningProfiles].Visible && !_HasPlayedWarningSound)
|
||||||
|
{
|
||||||
|
_WarningStream = CScreenMain.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
|
||||||
|
_HasPlayedWarningSound = true;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _LeaveScreen()
|
||||||
|
{
|
||||||
|
if (_WarningStream != -1)
|
||||||
|
{
|
||||||
|
CSound.Close(_WarningStream);
|
||||||
|
_WarningStream = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,6 +24,7 @@ using VocaluxeLib.Draw;
|
|||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Songs;
|
using VocaluxeLib.Songs;
|
||||||
using VocaluxeLib.Profile;
|
using VocaluxeLib.Profile;
|
||||||
|
using Vocaluxe.Lib.Sound;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
@@ -70,6 +71,17 @@ namespace Vocaluxe.Screens
|
|||||||
get { return EMusicType.BackgroundPreview; }
|
get { return EMusicType.BackgroundPreview; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int _WarningStream = -1;
|
||||||
|
private bool _HasPlayedWarningSound = false;
|
||||||
|
|
||||||
|
private static int PlaySound(ESounds sound, int volume)
|
||||||
|
{
|
||||||
|
int streamId = CSound.PlaySound(sound, false);
|
||||||
|
CSound.SetStreamVolume(streamId, volume);
|
||||||
|
|
||||||
|
return streamId;
|
||||||
|
}
|
||||||
|
|
||||||
#region public methods
|
#region public methods
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
@@ -286,15 +298,21 @@ namespace Vocaluxe.Screens
|
|||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
|
|
||||||
if (_Buttons[_ButtonBack].Selected)
|
if (_Buttons[_ButtonBack].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
else if (_Buttons[_ButtonStart].Selected)
|
else if (_Buttons[_ButtonStart].Selected)
|
||||||
|
{
|
||||||
_StartSong();
|
_StartSong();
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.D1:
|
case Keys.D1:
|
||||||
@@ -469,9 +487,15 @@ namespace Vocaluxe.Screens
|
|||||||
else if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
else if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
||||||
{
|
{
|
||||||
if (_Buttons[_ButtonBack].Selected)
|
if (_Buttons[_ButtonBack].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
else if (_Buttons[_ButtonStart].Selected)
|
else if (_Buttons[_ButtonStart].Selected)
|
||||||
|
{
|
||||||
_StartSong();
|
_StartSong();
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_UpdatePlayerNumber();
|
_UpdatePlayerNumber();
|
||||||
//Update Tiles-List
|
//Update Tiles-List
|
||||||
@@ -512,7 +536,10 @@ namespace Vocaluxe.Screens
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (exit)
|
if (exit)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouseEvent.MB && _SelectingFast)
|
if (mouseEvent.MB && _SelectingFast)
|
||||||
@@ -562,6 +589,13 @@ namespace Vocaluxe.Screens
|
|||||||
CRecord.AnalyzeBuffer(i - 1);
|
CRecord.AnalyzeBuffer(i - 1);
|
||||||
_Equalizers["EqualizerPlayer" + i].Update(CRecord.ToneWeigth(i - 1), CRecord.GetMaxVolume(i - 1));
|
_Equalizers["EqualizerPlayer" + i].Update(CRecord.ToneWeigth(i - 1), CRecord.GetMaxVolume(i - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((_Texts[_TextWarningMics].Visible || _Texts[_TextWarningProfiles].Visible) && !_HasPlayedWarningSound)
|
||||||
|
{
|
||||||
|
_WarningStream = CScreenNames.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
|
||||||
|
_HasPlayedWarningSound = true;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -803,6 +837,15 @@ namespace Vocaluxe.Screens
|
|||||||
_Texts[_TextWarningProfiles].Visible = false;
|
_Texts[_TextWarningProfiles].Visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _LeaveScreen()
|
||||||
|
{
|
||||||
|
if (_WarningStream != -1)
|
||||||
|
{
|
||||||
|
CSound.Close(_WarningStream);
|
||||||
|
_WarningStream = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion private methods
|
#endregion private methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,7 @@ using System.Collections.Generic;
|
|||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using VocaluxeLib;
|
using VocaluxeLib;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
using Vocaluxe.Lib.Sound;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
@@ -48,6 +49,17 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _TextWarningRestart = "TextWarningRestart";
|
private const string _TextWarningRestart = "TextWarningRestart";
|
||||||
private const string _StaticWarningRestart = "StaticWarningRestart";
|
private const string _StaticWarningRestart = "StaticWarningRestart";
|
||||||
|
|
||||||
|
private int _WarningStream = -1;
|
||||||
|
private bool _HasPlayedWarningSound = false;
|
||||||
|
|
||||||
|
private static int PlaySound(ESounds sound, int volume)
|
||||||
|
{
|
||||||
|
int streamId = CSound.PlaySound(sound, false);
|
||||||
|
CSound.SetStreamVolume(streamId, volume);
|
||||||
|
|
||||||
|
return streamId;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
@@ -89,12 +101,14 @@ namespace Vocaluxe.Screens
|
|||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.S:
|
case Keys.S:
|
||||||
CParty.SetNormalGameMode();
|
CParty.SetNormalGameMode();
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
@@ -102,6 +116,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
else if (_Buttons[_ButtonServer].Selected)
|
else if (_Buttons[_ButtonServer].Selected)
|
||||||
{
|
{
|
||||||
@@ -134,6 +149,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
||||||
@@ -142,6 +158,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
else if (_Buttons[_ButtonServer].Selected)
|
else if (_Buttons[_ButtonServer].Selected)
|
||||||
{
|
{
|
||||||
@@ -158,6 +175,12 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
public override bool UpdateGame()
|
public override bool UpdateGame()
|
||||||
{
|
{
|
||||||
|
if (_Texts[_TextWarningRestart].Visible && !_HasPlayedWarningSound)
|
||||||
|
{
|
||||||
|
_WarningStream = CScreenOptionsGame.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
|
||||||
|
_HasPlayedWarningSound = true;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,5 +223,14 @@ namespace Vocaluxe.Screens
|
|||||||
CSongs.Sorter.SongSorting = CConfig.Config.Game.SongSorting;
|
CSongs.Sorter.SongSorting = CConfig.Config.Game.SongSorting;
|
||||||
CSongs.Categorizer.Tabs = CConfig.Config.Game.Tabs;
|
CSongs.Categorizer.Tabs = CConfig.Config.Game.Tabs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _LeaveScreen()
|
||||||
|
{
|
||||||
|
if (_WarningStream != -1)
|
||||||
|
{
|
||||||
|
CSound.Close(_WarningStream);
|
||||||
|
_WarningStream = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,7 @@ using System.IO;
|
|||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using VocaluxeLib;
|
using VocaluxeLib;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
using Vocaluxe.Lib.Sound;
|
||||||
|
|
||||||
namespace Vocaluxe.Screens
|
namespace Vocaluxe.Screens
|
||||||
{
|
{
|
||||||
@@ -43,6 +44,17 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _ButtonExit = "ButtonExit";
|
private const string _ButtonExit = "ButtonExit";
|
||||||
private static readonly string[] CoverSizes = { "32", "64", "128", "256", "512", "1024" };
|
private static readonly string[] CoverSizes = { "32", "64", "128", "256", "512", "1024" };
|
||||||
|
|
||||||
|
private int _WarningStream = -1;
|
||||||
|
private bool _HasPlayedWarningSound = false;
|
||||||
|
|
||||||
|
private static int PlaySound(ESounds sound, int volume)
|
||||||
|
{
|
||||||
|
int streamId = CSound.PlaySound(sound, false);
|
||||||
|
CSound.SetStreamVolume(streamId, volume);
|
||||||
|
|
||||||
|
return streamId;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
@@ -89,12 +101,14 @@ namespace Vocaluxe.Screens
|
|||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.S:
|
case Keys.S:
|
||||||
CParty.SetNormalGameMode();
|
CParty.SetNormalGameMode();
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
@@ -102,6 +116,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -125,18 +140,27 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
||||||
{
|
{
|
||||||
_SaveConfig();
|
_SaveConfig();
|
||||||
if (_Buttons[_ButtonExit].Selected)
|
if (_Buttons[_ButtonExit].Selected)
|
||||||
|
{
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool UpdateGame()
|
public override bool UpdateGame()
|
||||||
{
|
{
|
||||||
|
if (_Texts[_TextWarningRestart].Visible && !_HasPlayedWarningSound)
|
||||||
|
{
|
||||||
|
_WarningStream = CScreenOptionsLyrics.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
|
||||||
|
_HasPlayedWarningSound = true;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,5 +205,14 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
CConfig.SaveConfig();
|
CConfig.SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _LeaveScreen()
|
||||||
|
{
|
||||||
|
if (_WarningStream != -1)
|
||||||
|
{
|
||||||
|
CSound.Close(_WarningStream);
|
||||||
|
_WarningStream = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ using System.Collections.ObjectModel;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
using Vocaluxe.Base.ThemeSystem;
|
using Vocaluxe.Base.ThemeSystem;
|
||||||
|
using Vocaluxe.Lib.Sound;
|
||||||
using Vocaluxe.Lib.Sound.Record;
|
using Vocaluxe.Lib.Sound.Record;
|
||||||
using VocaluxeLib;
|
using VocaluxeLib;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
@@ -65,6 +66,17 @@ namespace Vocaluxe.Screens
|
|||||||
get { return EMusicType.Game; }
|
get { return EMusicType.Game; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int _WarningStream = -1;
|
||||||
|
private bool _HasPlayedWarningSound = false;
|
||||||
|
|
||||||
|
private static int PlaySound(ESounds sound, int volume)
|
||||||
|
{
|
||||||
|
int streamId = CSound.PlaySound(sound, false);
|
||||||
|
CSound.SetStreamVolume(streamId, volume);
|
||||||
|
|
||||||
|
return streamId;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
@@ -108,12 +120,14 @@ namespace Vocaluxe.Screens
|
|||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
_SaveMicConfig();
|
_SaveMicConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.S:
|
case Keys.S:
|
||||||
CParty.SetNormalGameMode();
|
CParty.SetNormalGameMode();
|
||||||
_SaveMicConfig();
|
_SaveMicConfig();
|
||||||
CGraphics.FadeTo(EScreen.Song);
|
CGraphics.FadeTo(EScreen.Song);
|
||||||
|
_LeaveScreen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Enter:
|
case Keys.Enter:
|
||||||
@@ -121,6 +135,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_SaveMicConfig();
|
_SaveMicConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonDelayTest].Selected)
|
if (_Buttons[_ButtonDelayTest].Selected)
|
||||||
@@ -152,6 +167,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_SaveMicConfig();
|
_SaveMicConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
|
||||||
@@ -162,6 +178,7 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_SaveMicConfig();
|
_SaveMicConfig();
|
||||||
CGraphics.FadeTo(EScreen.Options);
|
CGraphics.FadeTo(EScreen.Options);
|
||||||
|
_LeaveScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_Buttons[_ButtonDelayTest].Selected)
|
if (_Buttons[_ButtonDelayTest].Selected)
|
||||||
@@ -210,6 +227,12 @@ namespace Vocaluxe.Screens
|
|||||||
_Statics[_StaticWarning].Visible = showWarning;
|
_Statics[_StaticWarning].Visible = showWarning;
|
||||||
_Texts[_TextWarning].Visible = showWarning;
|
_Texts[_TextWarning].Visible = showWarning;
|
||||||
|
|
||||||
|
if (_Texts[_TextWarning].Visible && !_HasPlayedWarningSound)
|
||||||
|
{
|
||||||
|
_WarningStream = CScreenOptionsRecord.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
|
||||||
|
_HasPlayedWarningSound = true;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,5 +458,14 @@ namespace Vocaluxe.Screens
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _LeaveScreen()
|
||||||
|
{
|
||||||
|
if (_WarningStream != -1)
|
||||||
|
{
|
||||||
|
CSound.Close(_WarningStream);
|
||||||
|
_WarningStream = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user