Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/MP1-4379-BUG-'Flickering…
Browse files Browse the repository at this point in the history
…'_visualisation_when_switching_sections'
  • Loading branch information
Sebastiii committed May 3, 2014
2 parents 2cc79ed + 3405433 commit 55167ae
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 20 deletions.
15 changes: 9 additions & 6 deletions mediaportal/Core/MusicPlayer/BASS/BassAudioEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2497,8 +2497,9 @@ public override void Process()
VizPluginInfo.VisualizationType != VisualizationInfo.PluginType.None)
{
NeedUpdate = true;
SetVideoWindow();
VizWindow.Visible = true;
SetVideoWindow();
if (_IsFullScreen)
VizWindow.Visible = true;
}

if (NotifyPlaying && CurrentPosition >= 10.0)
Expand Down Expand Up @@ -2544,17 +2545,19 @@ public override void SetVideoWindow()
return;
}
else
{
VizWindow.Size = new Size(_VideoWidth, _VideoHeight);
{
// bad idea use VideoWindow Size for VisualizationWindow Size, is not visible 1 pixel is enough
VizWindow.Size = new Size(1, 1);

VizWindow.Location = new Point(_VideoPositionX, _VideoPositionY);
_videoRectangle = new Rectangle(_VideoPositionX, _VideoPositionY, VizWindow.Size.Width, VizWindow.Size.Height);
_sourceRectangle = _videoRectangle;
}

if (!GUIWindowManager.IsRouted && VizPluginInfo.VisualizationType != VisualizationInfo.PluginType.None)
{
VizWindow.Visible = _state == PlayState.Playing;
{
if (_IsFullScreen)
VizWindow.Visible = _state == PlayState.Playing;
}
else
{
Expand Down
8 changes: 6 additions & 2 deletions mediaportal/Core/MusicPlayer/Visualization/BassboxViz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class BassboxViz : VisualizationBase, IDisposable

private bool RenderStarted = false;
private bool firstRun = true;

private bool VizVisible = false;
private MusicTag trackTag = null;
private string _OldCurrentFile = " ";
private string _songTitle = " "; // Title of the song played
Expand Down Expand Up @@ -293,9 +293,13 @@ public override bool WindowSizeChanged(Size newSize)
// Do a move of the Bassbox Viz
if (_visParam.VisHandle != 0)
{
// Visible State hold
VizVisible = VisualizationWindow.Visible;
// Hide the Viswindow, so that we don't see it, while moving
Win32API.ShowWindow(VisualizationWindow.Handle, Win32API.ShowWindowFlags.Hide);
VisualizationWindow.Visible = false;
BassVis.BASSVIS_Resize(_visParam, 0, 0, newSize.Width, newSize.Height);
// reactivate old Visible state
VisualizationWindow.Visible = VizVisible;
}
return true;
}
Expand Down
12 changes: 7 additions & 5 deletions mediaportal/Core/MusicPlayer/Visualization/SoniqueViz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class SoniqueViz : VisualizationBase, IDisposable
private MusicTag trackTag = null;
private string _OldCurrentFile = " ";
private string _songTitle = " "; // Title of the song played

private bool VizVisible = false;
#endregion

#region Constructors/Destructors
Expand Down Expand Up @@ -288,10 +288,14 @@ public override bool WindowSizeChanged(Size newSize)
// Do a move of the Sonique Viz
if (_visParam.VisHandle != 0)
{
GUIGraphicsContext.form.Refresh();
// Visible State hold
VizVisible = VisualizationWindow.Visible;
// Hide the Viswindow, so that we don't see it, while moving
GUIGraphicsContext.form.Refresh();
Win32API.ShowWindow(VisualizationWindow.Handle, Win32API.ShowWindowFlags.Hide);
VisualizationWindow.Visible = false;
BassVis.BASSVIS_Resize(_visParam, 0, 0, newSize.Width, newSize.Height);
// reactivate old Visible state
VisualizationWindow.Visible = VizVisible;
}
return true;
}
Expand Down Expand Up @@ -373,8 +377,6 @@ public override bool SetOutputContext(OutputContextType outputType)
BassVis.BASSVIS_SetOption(_visParam, BASSVIS_CONFIGFLAGS.BASSVIS_SONIQUEVIS_CONFIG_USESLOWFADE, 1);
BassVis.BASSVIS_SetOption(_visParam, BASSVIS_CONFIGFLAGS.BASSVIS_SONIQUEVIS_CONFIG_SLOWFADE, 5);
BassVis.BASSVIS_SetOption(_visParam, BASSVIS_CONFIGFLAGS.BASSVIS_CONFIG_FFTAMP, 5);

Win32API.ShowWindow(VisualizationWindow.Handle, Win32API.ShowWindowFlags.Hide);

// SetForegroundWindow
GUIGraphicsContext.form.Activate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1796,8 +1796,11 @@ internal void StartVisualization()
return;
}

Visible = true;
Refresh();
if (FullScreen)
{
Visible = true;
Refresh();
}
Application.DoEvents();

// Soundspectrum Viz need special handling on Render
Expand Down
8 changes: 5 additions & 3 deletions mediaportal/Core/MusicPlayer/Visualization/WMPViz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,11 @@ public override bool SetOutputContext(OutputContextType outputType)
{
return false;
}

VisualizationWindow.Width = GUIGraphicsContext.form.ClientRectangle.Width;
VisualizationWindow.Height = GUIGraphicsContext.form.ClientRectangle.Height;
if (GUIGraphicsContext.IsFullScreenVideo)
{
VisualizationWindow.Width = GUIGraphicsContext.form.ClientRectangle.Width;
VisualizationWindow.Height = GUIGraphicsContext.form.ClientRectangle.Height;
}

bool result = WMPInterop.SetOutputWMP(outputType, VisualizationWindow.Handle);
return result;
Expand Down
8 changes: 6 additions & 2 deletions mediaportal/Core/MusicPlayer/Visualization/WinampViz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class WinampViz : VisualizationBase, IDisposable
private string _songTitle = " "; // Title of the song played
private string _OldCurrentFile = " ";
private int _playlistTitlePos;

private bool VizVisible = false;
#endregion

#region Constructors/Destructors
Expand Down Expand Up @@ -345,11 +345,15 @@ public override bool WindowSizeChanged(Size newSize)
// Do a move of the Winamp Viz
if (_visParam.VisHandle != 0)
{
// Visible State hold
VizVisible = VisualizationWindow.Visible;
// Hide the Viswindow, so that we don't see it, while moving
Win32API.ShowWindow(VisualizationWindow.Handle, Win32API.ShowWindowFlags.Hide);
VisualizationWindow.Visible = false;
_tmpVisParam = new BASSVIS_PARAM(BASSVISKind.BASSVISKIND_WINAMP);
_tmpVisParam.VisGenWinHandle = VisualizationWindow.Handle;
BassVis.BASSVIS_Resize(_tmpVisParam, 0, 0, newSize.Width, newSize.Height);
// reactivate old Visible state
VisualizationWindow.Visible = VizVisible;
}
return true;
}
Expand Down

0 comments on commit 55167ae

Please sign in to comment.