diff options
Diffstat (limited to 'plugins/BASS_interface/src')
-rw-r--r-- | plugins/BASS_interface/src/Bass_interface.h | 2 | ||||
-rw-r--r-- | plugins/BASS_interface/src/Main.cpp | 23 |
2 files changed, 18 insertions, 7 deletions
diff --git a/plugins/BASS_interface/src/Bass_interface.h b/plugins/BASS_interface/src/Bass_interface.h index 443aa3c5c2..d33ca22ab4 100644 --- a/plugins/BASS_interface/src/Bass_interface.h +++ b/plugins/BASS_interface/src/Bass_interface.h @@ -21,6 +21,8 @@ Copyright (C) 2010, 2011 tico-tico #include <m_button_int.h>
#include <m_icolib.h>
+#include <m_folders.h>
+
#include "resource.h"
#include "version.h"
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 17dac6ec6e..ace833783b 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -479,16 +479,25 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv = {0};
- if (db_get_ts(NULL, ModuleName, OPT_BASSPATH, &dbv))
+ if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
{
- db_set_ts(NULL, ModuleName, OPT_BASSPATH, _T("Plugins\\Bass\\Bass.dll"));
- lstrcpy(tmp, _T("Plugins\\Bass\\Bass.dll"));
+ HANDLE hBASSFolder = FoldersRegisterCustomPathT("Bass Interface", "Bass library", PLUGINS_PATHT _T("\\Bass"));
+ FoldersGetCustomPathT(hBASSFolder, CurrBassPath, MAX_PATH, _T(""));
+ _tcscat(CurrBassPath, _T("\\bass.dll"));
+ }
+ else
+ {
+ if (db_get_ts(NULL, ModuleName, OPT_BASSPATH, &dbv))
+ {
+ TCHAR* tszFolder = Utils_ReplaceVarsT(_T("%miranda_path%\\plugins\\Bass\\bass.dll"));
+ lstrcpyn(CurrBassPath, tszFolder, SIZEOF(CurrBassPath));
+ mir_free(tszFolder);
+ db_set_ts(NULL, ModuleName, OPT_BASSPATH, CurrBassPath);
+ }
+ else lstrcpy(CurrBassPath, dbv.ptszVal);
+ DBFreeVariant(&dbv);
}
- else lstrcpy(tmp, dbv.ptszVal);
-
- DBFreeVariant(&dbv);
- CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)tmp, (LPARAM)CurrBassPath);
hBass = LoadLibrary(CurrBassPath);
if (hBass != NULL) {
if (LOADBASSFUNCTION(BASS_Init) != NULL && LOADBASSFUNCTION(BASS_SetConfig) != NULL &&
|