From 428669287ad80f5990fc95455441703859e5965e Mon Sep 17 00:00:00 2001 From: Kimmo Pekkola Date: Tue, 4 Aug 2009 09:20:22 +0000 Subject: [PATCH] The iTunes artwork path is now relative to the current skin's ini folder. --- Plugins/PluginiTunes/iTunesPlugin.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Plugins/PluginiTunes/iTunesPlugin.cpp b/Plugins/PluginiTunes/iTunesPlugin.cpp index f6aa6bf9..8d3f0227 100644 --- a/Plugins/PluginiTunes/iTunesPlugin.cpp +++ b/Plugins/PluginiTunes/iTunesPlugin.cpp @@ -314,16 +314,20 @@ static bool updateCurrentTrack() SUCCEEDED(artwork->get_Format(&artworkFormat))) { _bstr_t path; - switch (artworkFormat) + + 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)