summaryrefslogtreecommitdiff
path: root/plugins/BASS_interface
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-01-24 13:41:07 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-01-24 13:41:07 +0000
commit935c5c2df5e74f2847dac8917a3132494f2b936f (patch)
treef30cd1e895bd509e5dea448e1a82b63b505ff051 /plugins/BASS_interface
parent94203b25fb2d62f8435ddb0d0be9b83a30aa2e5a (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')
-rw-r--r--plugins/BASS_interface/src/Bass_interface.h2
-rw-r--r--plugins/BASS_interface/src/Main.cpp23
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 &&