From: <sag...@us...> - 2015-06-24 21:52:37
|
Revision: 5350 http://sourceforge.net/p/modplug/code/5350 Author: saga-games Date: 2015-06-24 21:52:32 +0000 (Wed, 24 Jun 2015) Log Message: ----------- [Mod] VST: Project path can now be customized further: %1 is the module path, %2 the module filename. Modified Paths: -------------- trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/mptrack/Vstplug.cpp Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-24 19:55:47 UTC (rev 5349) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-24 21:52:32 UTC (rev 5350) @@ -306,7 +306,7 @@ // Plugins , bridgeAllPlugins(conf, "VST Plugins", "BridgeAllPlugins", false) , enableAutoSuspend(conf, "VST Plugins", "EnableAutoSuspend", false) - , pluginProjectPath(conf, "VST Plugins", "ProjectPath", mpt::PathString()) + , pluginProjectPath(conf, "VST Plugins", "ProjectPath", std::wstring()) // Update , UpdateLastUpdateCheck(conf, "Update", "LastUpdateCheck", mpt::Date::Unix(time_t())) , UpdateUpdateCheckPeriod(conf, "Update", "UpdateCheckPeriod", CUpdateCheck::GetUpdateCheckPeriod()) Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2015-06-24 19:55:47 UTC (rev 5349) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2015-06-24 21:52:32 UTC (rev 5350) @@ -677,7 +677,7 @@ Setting<bool> bridgeAllPlugins; Setting<bool> enableAutoSuspend; - Setting<mpt::PathString> pluginProjectPath; + Setting<std::wstring> pluginProjectPath; // Update Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2015-06-24 19:55:47 UTC (rev 5349) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2015-06-24 21:52:32 UTC (rev 5350) @@ -461,21 +461,18 @@ #ifdef MODPLUG_TRACKER if(pVstPlugin && pVstPlugin->GetModDoc()) { - mpt::PathString path = pVstPlugin->GetModDoc()->GetPathNameMpt(); + std::wstring formatStr = TrackerSettings::Instance().pluginProjectPath; + if(formatStr.empty()) formatStr = L"%1"; + const mpt::PathString projectPath = pVstPlugin->GetModDoc()->GetPathNameMpt(); + const mpt::PathString projectFile = projectPath.GetFullFileName(); + mpt::PathString path = mpt::PathString::FromWide(mpt::String::Print(formatStr, projectPath.GetPath().ToWide(), projectFile.ToWide())); if(path.empty()) { return 0; } - mpt::PathString projectPath = TrackerSettings::Instance().pluginProjectPath; - if(!projectPath.empty()) - { - // Project files should be stored in a sub directory. - // Sub directory name is original filename + custom addition. - path += projectPath; - path.EnsureTrailingSlash(); - ::CreateDirectoryW(path.AsNative().c_str(), nullptr); - path += pVstPlugin->GetModDoc()->GetPathNameMpt().GetFullFileName(); - } + path.EnsureTrailingSlash(); + ::SHCreateDirectoryExW(NULL, path.AsNative().c_str(), nullptr); + path += projectFile; strcpy(ptr, path.ToLocale().c_str()); return 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |