The iTunes artwork path is now relative to the current skin's ini folder.

This commit is contained in:
Kimmo Pekkola 2009-08-04 09:20:22 +00:00
parent 8d43999ca4
commit 428669287a

View File

@ -314,16 +314,20 @@ static bool updateCurrentTrack()
SUCCEEDED(artwork->get_Format(&artworkFormat)))
{
_bstr_t path;
wsprintf(CurrentTrackArtworkPath, L"%s\\iTunesArtwork", BaseDir);
CreateDirectory(CurrentTrackArtworkPath, NULL);
switch (artworkFormat)
{
case ITArtworkFormatJPEG:
wsprintf(CurrentTrackArtworkPath, L"%s\\Skins\\iTunes\\img\\artwork.jpg", BaseDir);
wcscat(CurrentTrackArtworkPath, L"\\artwork.jpg");
break;
case ITArtworkFormatPNG :
wsprintf(CurrentTrackArtworkPath, L"%s\\Skins\\iTunes\\img\\artwork.png", BaseDir);
wcscat(CurrentTrackArtworkPath, L"\\artwork.png");
break;
case ITArtworkFormatBMP:
wsprintf(CurrentTrackArtworkPath, L"%s\\Skins\\iTunes\\img\\artwork.bmp", BaseDir);
wcscat(CurrentTrackArtworkPath, L"\\artwork.bmp");
break;
}
path = CurrentTrackArtworkPath;
@ -354,8 +358,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
if (!CoInitialized)
{
::CoInitialize(NULL);
::GetCurrentDirectory(MAX_PATH - 1, BaseDir);
::GetModuleFileName(NULL, BaseDir, MAX_PATH);
wcsncpy(BaseDir, iniFile, MAX_PATH);
BaseDir[MAX_PATH - 1] = 0;
wchar_t* lastBackslash = wcsrchr(BaseDir, L'\\');
if (lastBackslash)