From: <sag...@us...> - 2011-01-16 21:41:16
|
Revision: 789 http://modplug.svn.sourceforge.net/modplug/?rev=789&view=rev Author: saga-games Date: 2011-01-16 21:41:10 +0000 (Sun, 16 Jan 2011) Log Message: ----------- [Imp] Paths to VST plugins in mptrack.ini and plugin.cache are now also relative in portable mode. [Mod] OpenMPT: Version is now 1.19.00.20 Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/version.h Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-01-16 21:39:44 UTC (rev 788) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-01-16 21:41:10 UTC (rev 789) @@ -3048,7 +3048,7 @@ BOOL CTrackApp::InitializeDXPlugins() //----------------------------------- { - CHAR s[_MAX_PATH], tmp[32]; + TCHAR s[_MAX_PATH], tmp[32]; LONG nPlugins; m_pPluginManager = new CVstPluginManager; @@ -3071,7 +3071,11 @@ s[0] = 0; wsprintf(tmp, "Plugin%d", iPlug); GetPrivateProfileString("VST Plugins", tmp, "", s, sizeof(s), m_szConfigFileName); - if (s[0]) m_pPluginManager->AddPlugin(s, TRUE, true, &nonFoundPlugs); + if (s[0]) + { + CMainFrame::RelativePathToAbsolute(s); + m_pPluginManager->AddPlugin(s, TRUE, true, &nonFoundPlugs); + } } if(nonFoundPlugs.GetLength() > 0) { @@ -3085,7 +3089,7 @@ BOOL CTrackApp::UninitializeDXPlugins() //------------------------------------- { - CHAR s[_MAX_PATH], tmp[32]; + TCHAR s[_MAX_PATH], tmp[32]; PVSTPLUGINLIB pPlug; UINT iPlug; @@ -3099,6 +3103,10 @@ s[0] = 0; wsprintf(tmp, "Plugin%d", iPlug); strcpy(s, pPlug->szDllPath); + if(theApp.IsPortableMode()) + { + CMainFrame::AbsolutePathToRelative(s); + } WritePrivateProfileString("VST Plugins", tmp, s, m_szConfigFileName); iPlug++; } Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-01-16 21:39:44 UTC (rev 788) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-01-16 21:41:10 UTC (rev 789) @@ -189,6 +189,8 @@ PVSTPLUGINLIB CVstPluginManager::AddPlugin(LPCSTR pszDllPath, BOOL bCache, const bool checkFileExistence, CString* const errStr) //------------------------------------------------------------------------------------------------------------------------------ { + TCHAR szPath[_MAX_PATH]; + if(checkFileExistence && (PathFileExists(pszDllPath) == FALSE)) { if(errStr) @@ -207,8 +209,8 @@ // Look if the plugin info is stored in the PluginCache if (bCache) { - CString cacheSection = "PluginCache"; - CString cacheFile = theApp.GetPluginCacheFileName(); + const CString cacheSection = "PluginCache"; + const CString cacheFile = theApp.GetPluginCacheFileName(); char fileName[_MAX_PATH]; _splitpath(pszDllPath, NULL, NULL, fileName, NULL); @@ -216,8 +218,12 @@ if (IDs.GetLength() >= 16) { - CString fullPath = CMainFrame::GetPrivateProfileCString(cacheSection, IDs, "", cacheFile); - if ((fullPath) && (fullPath[0]) && (!lstrcmpi(fullPath, pszDllPath))) + // Get path from cache file + GetPrivateProfileString(cacheSection, IDs, "", szPath, CountOf(szPath) - 1, cacheFile); + SetNullTerminator(szPath); + CMainFrame::RelativePathToAbsolute(szPath); + + if ((szPath[0]) && (!lstrcmpi(szPath, pszDllPath))) { PVSTPLUGINLIB p = new VSTPLUGINLIB; if (!p) return NULL; @@ -352,6 +358,15 @@ CString IDs, flagsKey; IDs.Format("%08X%08X", p->dwPluginId1, p->dwPluginId2); flagsKey.Format("%s.Flags", IDs); + + _tcsncpy(szPath, pszDllPath, CountOf(szPath) - 1); + if(theApp.IsPortableMode()) + { + CMainFrame::AbsolutePathToRelative(szPath); + } + SetNullTerminator(szPath); + + WritePrivateProfileString(cacheSection, IDs, szPath, cacheFile); CMainFrame::WritePrivateProfileCString(cacheSection, IDs, pszDllPath, cacheFile); CMainFrame::WritePrivateProfileCString(cacheSection, p->szLibraryName, IDs, cacheFile); CMainFrame::WritePrivateProfileLong(cacheSection, flagsKey, p->bIsInstrument, cacheFile); Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-01-16 21:39:44 UTC (rev 788) +++ trunk/OpenMPT/mptrack/version.h 2011-01-16 21:41:10 UTC (rev 789) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 19 +#define VER_MINORMINOR 20 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |