Fade also volume during screen fading

This commit is contained in:
Flamefire committed 2014-12-22 12:22:22 +01:00
1 parent 2385f672d0
commit c64d7c5bab
2 files changed
+6 -4

No files matched your search

+4 -1
View File
@@ -228,12 +228,12 @@ namespace Vocaluxe.Base
if (_Fading != null) if (_Fading != null)
{ {
Debug.Assert(NextScreen != null);
bool finished; bool finished;
float newAlpha = _Fading.GetValue(out finished); float newAlpha = _Fading.GetValue(out finished);
if (!finished) if (!finished)
{ {
GlobalAlpha = 1f;
ZOffset = CSettings.ZFar / 2; ZOffset = CSettings.ZFar / 2;
_DrawScreen(CurrentScreen); _DrawScreen(CurrentScreen);
@@ -242,6 +242,9 @@ namespace Vocaluxe.Base
_DrawScreen(NextScreen); _DrawScreen(NextScreen);
GlobalAlpha = 1f; GlobalAlpha = 1f;
int oldVol = CConfig.GetVolumeByType(CurrentScreen.CurrentMusicType);
int newVol = CConfig.GetVolumeByType(NextScreen.CurrentMusicType);
CSound.SetGlobalVolume((int)((newVol - oldVol) * newAlpha + oldVol));
} }
else else
{ {
+2 -3
View File
@@ -96,8 +96,7 @@ namespace Vocaluxe.Screens
private int _CurrentBeat; private int _CurrentBeat;
private int _CurrentStream = -1; private int _CurrentStream = -1;
private float _Length = -1f; private float _Length = -1f;
//private int _NextStream = -1;
private const int _Volume = 100;
private CVideoStream _CurrentVideo; private CVideoStream _CurrentVideo;
private EAspect _VideoAspect = EAspect.Crop; private EAspect _VideoAspect = EAspect.Crop;
private CTextureRef _CurrentWebcamFrameTexture; private CTextureRef _CurrentWebcamFrameTexture;
@@ -528,7 +527,7 @@ namespace Vocaluxe.Screens
_Texts[_TextSongName].Text = songname; _Texts[_TextSongName].Text = songname;
_CurrentStream = CSound.Load(song.GetMP3(), false, true); _CurrentStream = CSound.Load(song.GetMP3(), false, true);
CSound.SetStreamVolume(_CurrentStream, _Volume); CSound.SetStreamVolume(_CurrentStream, 100);
CSound.SetPosition(_CurrentStream, song.Start); CSound.SetPosition(_CurrentStream, song.Start);
_CurrentTime = song.Start; _CurrentTime = song.Start;
_FinishTime = song.Finish; _FinishTime = song.Finish;