diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-24 13:41:07 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-24 13:41:07 +0000 |
commit | 935c5c2df5e74f2847dac8917a3132494f2b936f (patch) | |
tree | f30cd1e895bd509e5dea448e1a82b63b505ff051 /plugins/BASS_interface/src/Main.cpp | |
parent | 94203b25fb2d62f8435ddb0d0be9b83a30aa2e5a (diff) |
added folders plugin support
git-svn-id: http://svn.miranda-ng.org/main/trunk@3264 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BASS_interface/src/Main.cpp')
-rw-r--r-- | plugins/BASS_interface/src/Main.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
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 &&
|