More improvements and fixes (nearly stable now)
This commit is contained in:
1 parent
6c4fe011bf
commit
74654d7fcf
4 files changed
+23
-41
No files matched your search
@@ -67,11 +67,10 @@ namespace Vocaluxe.Base
|
|||||||
get { return _Disabled; }
|
get { return _Disabled; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (Disabled == value)
|
||||||
|
return;
|
||||||
_Disabled = value;
|
_Disabled = value;
|
||||||
if (_Disabled)
|
Pause();
|
||||||
Pause();
|
|
||||||
else
|
|
||||||
Play();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +190,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
_PreviewPlayer.Stop();
|
_PreviewPlayer.Stop();
|
||||||
_PlaysPreview = false;
|
_PlaysPreview = false;
|
||||||
Play();
|
Pause();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -202,13 +201,17 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void Pause()
|
public static void Pause()
|
||||||
{
|
{
|
||||||
if (!IsPlaying)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_PlaysPreview)
|
if (_PlaysPreview)
|
||||||
|
{
|
||||||
|
if (!_PreviewPlayer.SongLoaded)
|
||||||
|
return;
|
||||||
_PreviewPlayer.TogglePause();
|
_PreviewPlayer.TogglePause();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_SongPlayer.TogglePause();
|
if (!_SongPlayer.SongLoaded)
|
||||||
|
Next();
|
||||||
|
else
|
||||||
|
_SongPlayer.TogglePause();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Next()
|
public static void Next()
|
||||||
@@ -305,7 +308,10 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void LoadPreview(CSong song, float start = 0f)
|
public static void LoadPreview(CSong song, float start = 0f)
|
||||||
{
|
{
|
||||||
Stop();
|
if (!_PlaysPreview)
|
||||||
|
Pause();
|
||||||
|
else
|
||||||
|
StopPreview();
|
||||||
|
|
||||||
if (song == null)
|
if (song == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ namespace Vocaluxe.Screens
|
|||||||
if (_Buttons[_ButtonPrevious].Selected)
|
if (_Buttons[_ButtonPrevious].Selected)
|
||||||
CBackgroundMusic.Previous();
|
CBackgroundMusic.Previous();
|
||||||
if (_Buttons[_ButtonPlay].Selected)
|
if (_Buttons[_ButtonPlay].Selected)
|
||||||
CBackgroundMusic.Play();
|
CBackgroundMusic.Pause();
|
||||||
if (_Buttons[_ButtonPause].Selected)
|
if (_Buttons[_ButtonPause].Selected)
|
||||||
CBackgroundMusic.Pause();
|
CBackgroundMusic.Pause();
|
||||||
if (_Buttons[_ButtonRepeat].Selected)
|
if (_Buttons[_ButtonRepeat].Selected)
|
||||||
@@ -143,7 +143,7 @@ namespace Vocaluxe.Screens
|
|||||||
if (_Buttons[_ButtonPrevious].Selected)
|
if (_Buttons[_ButtonPrevious].Selected)
|
||||||
CBackgroundMusic.Previous();
|
CBackgroundMusic.Previous();
|
||||||
if (_Buttons[_ButtonPlay].Selected)
|
if (_Buttons[_ButtonPlay].Selected)
|
||||||
CBackgroundMusic.Play();
|
CBackgroundMusic.Pause();
|
||||||
if (_Buttons[_ButtonPause].Selected)
|
if (_Buttons[_ButtonPause].Selected)
|
||||||
CBackgroundMusic.Pause();
|
CBackgroundMusic.Pause();
|
||||||
if (_Buttons[_ButtonRepeat].Selected)
|
if (_Buttons[_ButtonRepeat].Selected)
|
||||||
|
|||||||
@@ -714,7 +714,7 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
_SongMenu.OnHide();
|
_SongMenu.OnHide();
|
||||||
|
|
||||||
if (CGraphics.NextScreen != EScreens.ScreenNames || CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_OFF)
|
if (CGraphics.NextScreen != EScreens.ScreenNames)
|
||||||
{
|
{
|
||||||
CBackgroundMusic.Disabled = false;
|
CBackgroundMusic.Disabled = false;
|
||||||
CSound.SetGlobalVolume(CConfig.BackgroundMusicVolume);
|
CSound.SetGlobalVolume(CConfig.BackgroundMusicVolume);
|
||||||
|
|||||||
@@ -349,40 +349,13 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
if (!_Initialized)
|
if (!_Initialized)
|
||||||
return;
|
return;
|
||||||
/*
|
|
||||||
if (_PreviewSongStream == -1 || _PreviewVideoStream == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (CBase.Video.IsFinished(_PreviewVideoStream) || CBase.Sound.IsFinished(_PreviewSongStream))
|
|
||||||
{
|
|
||||||
CBase.Video.Close(_PreviewVideoStream);
|
|
||||||
_PreviewVideoStream = -1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
float time = CBase.Sound.GetPosition(_PreviewSongStream);
|
|
||||||
|
|
||||||
float vtime;
|
|
||||||
if (CBase.Video.GetFrame(_PreviewVideoStream, ref _Vidtex, time, out vtime))
|
|
||||||
{
|
|
||||||
if (_Vidtex != null)
|
|
||||||
{
|
|
||||||
if (_VideoFading != null)
|
|
||||||
{
|
|
||||||
bool finished;
|
|
||||||
_Vidtex.Color.A = _VideoFading.GetValue(out finished);
|
|
||||||
if (finished)
|
|
||||||
_VideoFading = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnShow() {}
|
public virtual void OnShow() {}
|
||||||
|
|
||||||
public virtual void OnHide()
|
public virtual void OnHide()
|
||||||
{
|
{
|
||||||
if(CBase.Graphics.GetNextScreen() != EScreens.ScreenNames || CBase.Config.GetBackgroundMusicStatus() == EBackgroundMusicOffOn.TR_CONFIG_OFF)
|
if(CBase.Graphics.GetNextScreen() != EScreens.ScreenNames)
|
||||||
_ResetPreview();
|
_ResetPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,6 +486,9 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
|
|
||||||
protected void _ResetPreview(bool playBGagain = true)
|
protected void _ResetPreview(bool playBGagain = true)
|
||||||
{
|
{
|
||||||
|
if (_PreviewNrInternal == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
CBase.BackgroundMusic.StopPreview();
|
CBase.BackgroundMusic.StopPreview();
|
||||||
|
|
||||||
if (playBGagain)
|
if (playBGagain)
|
||||||
|
|||||||
Reference in new issue
Block a user