INTERACT FORUM
Windows => Plug-in Development => Topic started by: SteveV on July 24, 2005, 12:26:43 pm
-
I'm writing a screensaver display plugin the orbits lyrics and cover art when in full screen mode. I've run into a strange problem where GetTrackInfo(TRACK_INFO_FIELDS::FIELD_IMAGEFILE) returns the correct cover art image on the 1st, 3rd, 5th, ... tracks played but returns the default MC Logo.png image every other track.
In other words: GetTrackInfo(TRACK_INFO_FIELDS::FIELD_IMAGEFILE) is returning the following values:
First Track Played:
C:\DOCUME~1\STEVEV~1\LOCALS~1\Temp\APE Decompressed Cover Art (temp).jpg
(contains correct image)
Second Track Played:
C:\Program Files\J River\Media Center\Data\Default Art\Logo.png
Third Track Played:
C:\DOCUME~1\STEVEV~1\LOCALS~1\Temp\APE Decompressed Cover Art (temp).jpg
(contains correct image)
Forth Track Played:
C:\Program Files\J River\Media Center\Data\Default Art\Logo.png
(contains correct image)
etc.
Here's a very simplified snippet of what I'm doing:
HRESULT CScreenSaverControl::OnDrawAdvanced(ATL_DRAWINFO& di)
{
m_pVisData->GetData();
if(m_pVisData->GetVisInfo(VIS_INFO_FIELDS::VIS_DATA_TRACK_CHANGED)
{
CString sImageFile = m_pVisData->GetTrackInfo(TRACK_INFO_FIELDS::FIELD_IMAGEFILE);
TRACE(sImageFile + "\r\n");
CString sLyrics = m_pVisData->GetTrackInfo(TRACK_INFO_FIELDS::FIELD_LYRICS);
DrawCoverArtImage(di.hdcDraw)
DrawLyrics(di.hdcDraw)
}
}
Any thoughts?
Steve
-
Steve, I had a simular problem with my aTagger plugin. I had to make sure that I closed the temp image file (to remove the file lock) so that the temp image file could be updated by MC for the subsequent files.
The documentation isnt clear, but MC reuses the same temp image file for each request. If you are holding a lock on the temp image file after processing song 1, MC cant populate the temp image file (because it is locked) for song 2.
I hope this helps... @l@n
-
Thanks, Alan.
I have run int this a number of times with GDI+. I should have remembered this was the culprit.
Regards,
Steve