Skip to content

Commit

Permalink
minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kmatheussen committed Aug 22, 2020
1 parent f7f2aa8 commit 37f8d10
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion check_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ fi

if [[ ! -f ~/SDKs/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h && ! -f ~/SDKs/"VST3 SDK"/pluginterfaces/vst2.x/aeffect.h && ! -f ~/SDKs/VST_SDK/VST2_SDK/pluginterfaces/vst2.x/aeffect.h ]] ; then
echo 'Steinberg VST headers not found. (Missing "~/SDKs/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h or "~/SDKs/VST3 SDK/pluginterfaces/vst2.x/aeffect.h" or "~/SDKs/VST_SDK/VST2_SDK/pluginterfaces/vst2.x/aeffect.h")'
echo 'You should find these files in the "VST Audio Plug-Ins SDK" from http://www.steinberg.net/en/company/developers.html . Unless Steinberg have changed the directory structure again, it should enough to unzip the file into your ~/SDKs directory.'
echo 'You should find these files in the "VST Audio Plug-Ins SDK" from http://www.steinberg.net/en/company/developers.html . Unless Steinberg has changed the directory structure again, it should enough to unzip the file into your ~/SDKs directory.'
exit 5
fi

Expand Down
30 changes: 17 additions & 13 deletions windows/find_jack_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
#include "find_jack_library_proc.h"


# ifdef __x86_64__
#define LIBJACKNAME "libjack64.dll"
# else
#define LIBJACKNAME "libjack.dll"
# endif


static wchar_t *get_wchar_t(const QString s){
int size = (int)sizeof(wchar_t)*(s.length()+1);
wchar_t *array = (wchar_t*)malloc(size);
Expand All @@ -19,7 +26,7 @@ static wchar_t *get_wchar_t(const QString s){
}

static QString find_libjack_dir2(void){
return QCoreApplication::applicationDirPath() + QDir::separator() + "jack_local"; // "bin" + QDir::separator() +
return QCoreApplication::applicationDirPath() + QDir::separator() + "jack_local";
}

wchar_t *find_libjack_dir(void){
Expand All @@ -31,11 +38,7 @@ bool jack_is_installed_globally(void){
static bool is_installed_globally = false;

if (has_found_value == false) {
# ifdef __x86_64__
HMODULE lib = LoadLibraryA("libjack64.dll");
# else
HMODULE lib = LoadLibraryA("libjack.dll");
# endif
HMODULE lib = LoadLibraryA(LIBJACKNAME);

if (lib != NULL){
FreeLibrary(lib);
Expand All @@ -51,19 +54,20 @@ bool jack_is_installed_globally(void){
}

wchar_t *find_libjack_library(bool jack_is_installed_globally){
#ifdef _WIN64
if (jack_is_installed_globally) {
return get_wchar_t("libjack64.dll");

return get_wchar_t(LIBJACKNAME);

} else {

#ifdef _WIN64
return get_wchar_t(find_libjack_dir2() + QDir::separator() + "libjack64.dll");
}
#else
if (jack_is_installed_globally) {
return get_wchar_t("libjack.dll");
} else {
return get_wchar_t(find_libjack_dir2() + QDir::separator() + "win32libs" + QDir::separator() + "libjack.dll");
}
#endif

}

}

#endif // _WIN32
Expand Down

0 comments on commit 37f8d10

Please sign in to comment.