Removed medley branch from jukebox branch

This commit is contained in:
Stephan Sundermann committed 2012-03-12 21:58:33 +01:00
1 parent 0bcb8804b7
commit 1b27e15106
2 files changed
+51 -52

No files matched your search

+22 -16
View File
@@ -42,9 +42,15 @@ namespace Vocaluxe.Base
} }
set set
{ {
_VideoEnabled = value; if (_VideoEnabled && value)
if (!_VideoEnabled) return;
if (!_VideoEnabled && !value)
return;
if(_VideoEnabled && !value)
ToggleVideo(); ToggleVideo();
if (!_VideoEnabled && value)
ToggleVideo();
_VideoEnabled = value;
} }
} }
@@ -129,7 +135,7 @@ namespace Vocaluxe.Base
if(CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC) if(CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC)
AddBackgroundMusic(); AddBackgroundMusic();
if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON) if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
VideoEnabled = true; _VideoEnabled = true;
_Playing = false; _Playing = false;
} }
@@ -144,7 +150,7 @@ namespace Vocaluxe.Base
{ {
CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime); CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime);
CSound.Play(_CurrentMusicStream); CSound.Play(_CurrentMusicStream);
if (VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
CVideo.VdResume(_Video); CVideo.VdResume(_Video);
_Playing = true; _Playing = true;
} }
@@ -156,7 +162,7 @@ namespace Vocaluxe.Base
public static void Stop() public static void Stop()
{ {
if (VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
{ {
CVideo.VdClose(_Video); CVideo.VdClose(_Video);
CDraw.RemoveTexture(ref _CurrentVideoTexture); CDraw.RemoveTexture(ref _CurrentVideoTexture);
@@ -170,7 +176,7 @@ namespace Vocaluxe.Base
public static void Pause() public static void Pause()
{ {
if (VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
{ {
CVideo.VdPause(_Video); CVideo.VdPause(_Video);
CVideo.VdSkip(_Video, CSound.GetPosition(_CurrentMusicStream) + CSettings.BackgroundMusicFadeTime, _CurrentPlaylistElement.VideoGap); CVideo.VdSkip(_Video, CSound.GetPosition(_CurrentMusicStream) + CSettings.BackgroundMusicFadeTime, _CurrentPlaylistElement.VideoGap);
@@ -214,7 +220,7 @@ namespace Vocaluxe.Base
_CurrentPlaylistElement = _PreviousFileNames[_PreviousMusicIndex]; _CurrentPlaylistElement = _PreviousFileNames[_PreviousMusicIndex];
} }
_CurrentMusicStream = CSound.Load(_CurrentPlaylistElement.MusicFilePath); _CurrentMusicStream = CSound.Load(_CurrentPlaylistElement.MusicFilePath);
if (VideoEnabled) if (_VideoEnabled)
LoadVideo(); LoadVideo();
CSound.SetStreamVolume(_CurrentMusicStream, 0f); CSound.SetStreamVolume(_CurrentMusicStream, 0f);
Play(); Play();
@@ -236,7 +242,7 @@ namespace Vocaluxe.Base
_CurrentPlaylistElement = _PreviousFileNames[_PreviousMusicIndex]; _CurrentPlaylistElement = _PreviousFileNames[_PreviousMusicIndex];
_CurrentMusicStream = CSound.Load(_CurrentPlaylistElement.MusicFilePath); _CurrentMusicStream = CSound.Load(_CurrentPlaylistElement.MusicFilePath);
if (VideoEnabled) if (_VideoEnabled)
LoadVideo(); LoadVideo();
CSound.SetStreamVolume(_CurrentMusicStream, 0f); CSound.SetStreamVolume(_CurrentMusicStream, 0f);
Play(); Play();
@@ -248,7 +254,7 @@ namespace Vocaluxe.Base
if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1) if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1)
{ {
CSound.SetPosition(_CurrentMusicStream, 0); CSound.SetPosition(_CurrentMusicStream, 0);
if (VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap); CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
} }
} }
@@ -365,9 +371,9 @@ namespace Vocaluxe.Base
{ {
if (_Video != -1) if (_Video != -1)
{ {
if (VideoEnabled) if (_VideoEnabled)
{ {
VideoEnabled = false; _VideoEnabled = false;
CVideo.VdClose(_Video); CVideo.VdClose(_Video);
_Video = -1; _Video = -1;
CDraw.RemoveTexture(ref _CurrentVideoTexture); CDraw.RemoveTexture(ref _CurrentVideoTexture);
@@ -421,7 +427,7 @@ namespace Vocaluxe.Base
{ {
_Video = CVideo.VdLoad(_CurrentPlaylistElement.VideoFilePath); _Video = CVideo.VdLoad(_CurrentPlaylistElement.VideoFilePath);
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap); CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
VideoEnabled = true; _VideoEnabled = true;
_FadeTimer.Reset(); _FadeTimer.Reset();
_FadeTimer.Start(); _FadeTimer.Start();
} }
@@ -454,7 +460,7 @@ class PlaylistElement
set set
{ {
MusicFilePath = value; _MusicFilePath = value;
} }
} }
@@ -574,19 +580,19 @@ class PlaylistElement
public PlaylistElement(CSong song) public PlaylistElement(CSong song)
{ {
//MusicFilePath = string.Empty; MusicFilePath = string.Empty;
_SongID = song.ID; _SongID = song.ID;
} }
public PlaylistElement(string FilePath) public PlaylistElement(string FilePath)
{ {
//MusicFilePath = FilePath; MusicFilePath = FilePath;
_SongID = -1; _SongID = -1;
} }
public PlaylistElement() public PlaylistElement()
{ {
//MusicFilePath = string.Empty; MusicFilePath = string.Empty;
_SongID = -1; _SongID = -1;
} }
} }
+29 -36
View File
@@ -29,9 +29,24 @@ namespace Vocaluxe.Screens
private const string ButtonToBackgroundVideo = "ButtonToBackgroundVideo"; private const string ButtonToBackgroundVideo = "ButtonToBackgroundVideo";
private const string TextCurrentSong = "TextCurrentSong"; private const string TextCurrentSong = "TextCurrentSong";
private bool _VideoPreview = false; private bool _VideoPreview = false;
private bool _VideoBackground
private bool VideoPreview
{
get
{
return _VideoPreview;
}
set
{
_VideoPreview = value;
if (!_VideoPreview && !VideoBackground)
CBackgroundMusic.VideoEnabled = false;
else
CBackgroundMusic.VideoEnabled = true;
}
}
private bool VideoBackground
{ {
get get
{ {
@@ -39,11 +54,14 @@ namespace Vocaluxe.Screens
} }
set set
{ {
if (CConfig.VideosToBackground == EOffOn.TR_CONFIG_ON) if (!value)
{ {
CConfig.VideosToBackground = EOffOn.TR_CONFIG_OFF; if (CConfig.VideosToBackground == EOffOn.TR_CONFIG_ON)
if (!_VideoPreview) //No videos are enabled so we should call ToggleVideo() to close {
CBackgroundMusic.ToggleVideo(); CConfig.VideosToBackground = EOffOn.TR_CONFIG_OFF;
if (!_VideoPreview)
CBackgroundMusic.VideoEnabled = false;
}
} }
else else
{ {
@@ -116,11 +134,11 @@ namespace Vocaluxe.Screens
if (Buttons[htButtons(ButtonRepeat)].Selected) if (Buttons[htButtons(ButtonRepeat)].Selected)
CBackgroundMusic.Repeat(); CBackgroundMusic.Repeat();
if (Buttons[htButtons(ButtonShowVideo)].Selected) if (Buttons[htButtons(ButtonShowVideo)].Selected)
TogglePreviewVideo(); VideoPreview = !VideoPreview;
if (Buttons[htButtons(ButtonSing)].Selected) if (Buttons[htButtons(ButtonSing)].Selected)
StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet); StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet);
if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected) if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected)
ToggleBackgroundVideo(); VideoBackground = !VideoBackground;
break; break;
} }
} }
@@ -144,11 +162,11 @@ namespace Vocaluxe.Screens
if (Buttons[htButtons(ButtonRepeat)].Selected) if (Buttons[htButtons(ButtonRepeat)].Selected)
CBackgroundMusic.Repeat(); CBackgroundMusic.Repeat();
if (Buttons[htButtons(ButtonShowVideo)].Selected) if (Buttons[htButtons(ButtonShowVideo)].Selected)
TogglePreviewVideo(); VideoPreview = !VideoPreview;
if (Buttons[htButtons(ButtonSing)].Selected) if (Buttons[htButtons(ButtonSing)].Selected)
StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet); StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet);
if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected) if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected)
ToggleBackgroundVideo(); VideoBackground = !VideoBackground;
} else if (MouseEvent.LB) } else if (MouseEvent.LB)
{ {
CGraphics.HidePopup(EPopupScreens.PopupPlayerControl); CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
@@ -164,7 +182,7 @@ namespace Vocaluxe.Screens
public override bool UpdateGame() public override bool UpdateGame()
{ {
Statics[htStatics(StaticCover)].Visible = !_VideoPreview; Statics[htStatics(StaticCover)].Visible = !_VideoPreview;
Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = _VideoBackground; Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = VideoBackground;
Buttons[htButtons(ButtonShowVideo)].Pressed = _VideoPreview; Buttons[htButtons(ButtonShowVideo)].Pressed = _VideoPreview;
return true; return true;
} }
@@ -206,30 +224,5 @@ namespace Vocaluxe.Screens
CGraphics.FadeTo(EScreens.ScreenNames); CGraphics.FadeTo(EScreens.ScreenNames);
} }
} }
private void ToggleBackgroundVideo()
{
if (_VideoBackground)
{
CConfig.VideosToBackground = EOffOn.TR_CONFIG_OFF;
if (!_VideoPreview) //No videos are enabled so we should call ToggleVideo() to close
CBackgroundMusic.ToggleVideo();
}
else
{
CConfig.VideosToBackground = EOffOn.TR_CONFIG_ON;
CBackgroundMusic.VideoEnabled = true;
}
CConfig.SaveConfig();
}
private void TogglePreviewVideo()
{
_VideoPreview = !_VideoPreview;
if (!_VideoPreview && !_VideoBackground)
CBackgroundMusic.ToggleVideo();
else
CBackgroundMusic.VideoEnabled = true;
}
} }
} }