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
+8 -6

No files matched your search

+6 -3
View File
@@ -228,12 +228,12 @@ namespace Vocaluxe.Base
if (_Fading != null)
{
Debug.Assert(NextScreen != null);
bool finished;
float newAlpha = _Fading.GetValue(out finished);
if (!finished)
{
GlobalAlpha = 1f;
ZOffset = CSettings.ZFar / 2;
_DrawScreen(CurrentScreen);
@@ -242,6 +242,9 @@ namespace Vocaluxe.Base
_DrawScreen(NextScreen);
GlobalAlpha = 1f;
int oldVol = CConfig.GetVolumeByType(CurrentScreen.CurrentMusicType);
int newVol = CConfig.GetVolumeByType(NextScreen.CurrentMusicType);
CSound.SetGlobalVolume((int)((newVol - oldVol) * newAlpha + oldVol));
}
else
{
@@ -305,8 +308,8 @@ namespace Vocaluxe.Base
{
if (screen == null)
throw new ArgumentNullException("screen");
Debug.Assert(NextScreen==null || NextScreen!=screen, "Don't fade to currently fading screen!");
if(screen==NextScreen)
Debug.Assert(NextScreen == null || NextScreen != screen, "Don't fade to currently fading screen!");
if (screen == NextScreen)
return;
// Make sure the last screen change is done
_FinishScreenFading();
+2 -3
View File
@@ -96,8 +96,7 @@ namespace Vocaluxe.Screens
private int _CurrentBeat;
private int _CurrentStream = -1;
private float _Length = -1f;
//private int _NextStream = -1;
private const int _Volume = 100;
private CVideoStream _CurrentVideo;
private EAspect _VideoAspect = EAspect.Crop;
private CTextureRef _CurrentWebcamFrameTexture;
@@ -528,7 +527,7 @@ namespace Vocaluxe.Screens
_Texts[_TextSongName].Text = songname;
_CurrentStream = CSound.Load(song.GetMP3(), false, true);
CSound.SetStreamVolume(_CurrentStream, _Volume);
CSound.SetStreamVolume(_CurrentStream, 100);
CSound.SetPosition(_CurrentStream, song.Start);
_CurrentTime = song.Start;
_FinishTime = song.Finish;