Skip to content

Commit

Permalink
Fix 0002299: WMP Visualisations were not working
Browse files Browse the repository at this point in the history
  • Loading branch information
hwahrmann committed Jun 26, 2009
1 parent 7117406 commit b50fd30
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
Expand Up @@ -34,6 +34,7 @@ public interface IVisualization
bool PreRenderRequired { get; }
bool IsEngineInstalled();
bool IsWinampVis();
bool IsWmpVis();
bool Initialize();
bool InitializePreview(); // Used for visualization previews
bool Config();
Expand Down
Expand Up @@ -151,6 +151,11 @@ public virtual bool IsWinampVis()
return false;
}

public virtual bool IsWmpVis()
{
return false;
}

public virtual bool Initialize()
{
return false;
Expand Down
Expand Up @@ -1573,7 +1573,7 @@ private void DoResize()

try
{
if (_EnableStatusOverlays)
if (_EnableStatusOverlays && !Viz.IsWmpVis())
{
// Make sure we're using the original defaults...
TrackInfoImageWidth = DefaultTrackInfoImageWidth;
Expand Down Expand Up @@ -2009,7 +2009,7 @@ private int RenderVisualization(Graphics g)

try
{
if (_EnableStatusOverlays || !FullScreen)
if ((_EnableStatusOverlays || !FullScreen) && !Viz.IsWmpVis())
{
if (DialogWindowIsActive)
{
Expand Down
15 changes: 10 additions & 5 deletions mediaportal/Core/MusicPlayer/Visualization/WMPViz.cs
Expand Up @@ -111,8 +111,8 @@ public override bool Initialize()
rect.bottom = VisualizationWindow.Height;

OutputContextType outputType = VisualizationWindow.OutputContextType;
result = WMPInterop.InitWMPEngine(VizPluginInfo.CLSID, VizPluginInfo.PresetIndex, outputType, IntPtr.Zero,
VisualizationWindow.CompatibleDC, ref rect);
result = WMPInterop.InitWMPEngine(VizPluginInfo.CLSID, VizPluginInfo.PresetIndex, OutputContextType.WindowHandle, IntPtr.Zero,
VisualizationWindow.Handle, ref rect);
_Initialized = result;
Log.Info(" Visualization Manager: WMP visualization initialization {0}", (result ? "succeeded." : "failed!"));
}
Expand Down Expand Up @@ -165,6 +165,11 @@ public override int RenderVisualization()
return result;
}

public override bool IsWmpVis()
{
return true;
}

public override bool Close()
{
try
Expand All @@ -183,7 +188,7 @@ public override bool Close()

public override bool WindowSizeChanged(Size newSize)
{
bool result = SetOutputContext(VisualizationWindow.OutputContextType);
bool result = SetOutputContext(OutputContextType.WindowHandle);
return result;
}

Expand All @@ -196,7 +201,7 @@ public override bool WindowChanged(VisualizationWindow vizWindow)
return false;
}

bool result = SetOutputContext(VisualizationWindow.OutputContextType);
bool result = SetOutputContext(OutputContextType.WindowHandle);
return result;
}

Expand All @@ -213,7 +218,7 @@ public override bool SetOutputContext(OutputContextType outputType)
return false;
}

bool result = WMPInterop.SetOutputWMP(outputType, VisualizationWindow.CompatibleDC);
bool result = WMPInterop.SetOutputWMP(outputType, VisualizationWindow.Handle);
return result;
}

Expand Down

0 comments on commit b50fd30

Please sign in to comment.