Video modes are now handled separately

PortAudio.dll library update
This commit is contained in:
Stephan Sundermann committed 2012-03-08 19:16:49 +01:00
1 parent 817066ee45
commit 4a37ca024e
3 files changed
+24 -7

No files matched your search

Binary file not shown.
+18 -2
View File
@@ -28,6 +28,7 @@ namespace Vocaluxe.Base
private static bool _BackgroundMusicAdded; private static bool _BackgroundMusicAdded;
private static bool _Playing; private static bool _Playing;
private static bool _VideoEnabled; private static bool _VideoEnabled;
private static bool _SmallVideoIsEnabled;
private static int _Video = -1; private static int _Video = -1;
private static STexture _CurrentVideoTexture = new STexture(-1); private static STexture _CurrentVideoTexture = new STexture(-1);
@@ -71,7 +72,7 @@ namespace Vocaluxe.Base
} }
else else
Next(); Next();
if (_VideoEnabled) if ((_VideoEnabled && _SmallVideoIsEnabled) || (_VideoEnabled && VideoToBackgroundIsEnabled()))
LoadVideo(); LoadVideo();
} }
} }
@@ -356,6 +357,17 @@ namespace Vocaluxe.Base
return CConfig.VideosToBackground == EOffOn.TR_CONFIG_ON; return CConfig.VideosToBackground == EOffOn.TR_CONFIG_ON;
} }
public static bool SmallVideoIsEnabled()
{
return _SmallVideoIsEnabled;
}
public static void ToggleSmallVideo()
{
_SmallVideoIsEnabled = !_SmallVideoIsEnabled;
ApplyBackgroundVideo();
}
public static bool HasVideo() public static bool HasVideo()
{ {
return File.Exists(_CurrentPlaylistElement.GetVideoFilePath()); return File.Exists(_CurrentPlaylistElement.GetVideoFilePath());
@@ -386,7 +398,11 @@ namespace Vocaluxe.Base
public static void ToggleVideoToBackground() public static void ToggleVideoToBackground()
{ {
if (VideoToBackgroundIsEnabled()) if (VideoToBackgroundIsEnabled())
{
CConfig.VideosToBackground = EOffOn.TR_CONFIG_OFF; CConfig.VideosToBackground = EOffOn.TR_CONFIG_OFF;
if (!_SmallVideoIsEnabled) //No videos are enabled so we should call ToggleVideo() to close
ToggleVideo();
}
else else
{ {
CConfig.VideosToBackground = EOffOn.TR_CONFIG_ON; CConfig.VideosToBackground = EOffOn.TR_CONFIG_ON;
@@ -397,7 +413,7 @@ namespace Vocaluxe.Base
public static void ApplyBackgroundVideo() public static void ApplyBackgroundVideo()
{ {
if (!_VideoEnabled) if (!_VideoEnabled && (!_SmallVideoIsEnabled || !VideoToBackgroundIsEnabled()) || (!_SmallVideoIsEnabled && !VideoToBackgroundIsEnabled())) //No videos are enabled so we should call ToggleVideo() to close
ToggleVideo(); ToggleVideo();
} }
} }
@@ -92,7 +92,7 @@ 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)
CBackgroundMusic.ToggleVideo(); CBackgroundMusic.ToggleSmallVideo();
if (Buttons[htButtons(ButtonSing)].Selected) if (Buttons[htButtons(ButtonSing)].Selected)
StartSong(CBackgroundMusic.GetSongNr(), CBackgroundMusic.IsDuet()); StartSong(CBackgroundMusic.GetSongNr(), CBackgroundMusic.IsDuet());
if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected) if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected)
@@ -120,7 +120,7 @@ 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)
CBackgroundMusic.ToggleVideo(); CBackgroundMusic.ToggleSmallVideo();
if (Buttons[htButtons(ButtonSing)].Selected) if (Buttons[htButtons(ButtonSing)].Selected)
StartSong(CBackgroundMusic.GetSongNr(), CBackgroundMusic.IsDuet()); StartSong(CBackgroundMusic.GetSongNr(), CBackgroundMusic.IsDuet());
if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected) if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected)
@@ -139,8 +139,9 @@ namespace Vocaluxe.Screens
public override bool UpdateGame() public override bool UpdateGame()
{ {
Statics[htStatics(StaticCover)].Visible = !CBackgroundMusic.SmallVideoIsEnabled();
Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = CBackgroundMusic.VideoToBackgroundIsEnabled(); Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = CBackgroundMusic.VideoToBackgroundIsEnabled();
Buttons[htButtons(ButtonShowVideo)].Pressed = CBackgroundMusic.IsVideoEnabled(); Buttons[htButtons(ButtonShowVideo)].Pressed = CBackgroundMusic.SmallVideoIsEnabled();
return true; return true;
} }
@@ -157,12 +158,12 @@ namespace Vocaluxe.Screens
if (CBackgroundMusic.IsVideoEnabled() && CBackgroundMusic.HasVideo()) if (CBackgroundMusic.IsVideoEnabled() && CBackgroundMusic.HasVideo())
{ {
Statics[htStatics(StaticCover)].Texture = CBackgroundMusic.GetCover(); Statics[htStatics(StaticCover)].Texture = CBackgroundMusic.GetCover();
Statics[htStatics(StaticCover)].Visible = false; //Statics[htStatics(StaticCover)].Visible = false;
CDraw.DrawTexture(Statics[htStatics(StaticCover)], CBackgroundMusic.GetVideoTexture(), EAspect.Crop); CDraw.DrawTexture(Statics[htStatics(StaticCover)], CBackgroundMusic.GetVideoTexture(), EAspect.Crop);
} }
else else
{ {
Statics[htStatics(StaticCover)].Visible = true; //Statics[htStatics(StaticCover)].Visible = true;
Statics[htStatics(StaticCover)].Texture = CBackgroundMusic.GetCover(); Statics[htStatics(StaticCover)].Texture = CBackgroundMusic.GetCover();
} }
Buttons[htButtons(ButtonPause)].Visible = CBackgroundMusic.IsPlaying(); Buttons[htButtons(ButtonPause)].Visible = CBackgroundMusic.IsPlaying();