Skip to content

Commit

Permalink
Continue systray work, get more stuff to work
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Oct 4, 2023
1 parent b507fda commit d7ae97a
Show file tree
Hide file tree
Showing 6 changed files with 300 additions and 79 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/build/
*.dll
*.exe
*.o
*.tar.gz
*.zip
qrc_*.hpp
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ TARGETS += build/libjackserver64.dll
TARGETS += build/libpython3.8.dll
TARGETS += build/jack/jack_portaudio.dll
TARGETS += build/jack/jack_winmme.dll
TARGETS += build/mod-app.exe
TARGETS += build/Qt5Core.dll
TARGETS += build/Qt5Gui.dll
TARGETS += build/Qt5Svg.dll
TARGETS += build/Qt5Widgets.dll
else
TARGETS += build/libjack.so.0
TARGETS += build/libjackserver.so.0
Expand Down Expand Up @@ -201,6 +206,10 @@ build/jackd$(APP_EXT): $(PAWPAW_PREFIX)/bin/jackd$(APP_EXT)
@mkdir -p build
ln -sf $(abspath $<) $@

build/Qt5%.dll: $(PAWPAW_PREFIX)/bin/Qt5%.dll
@mkdir -p build
ln -sf $(abspath $<) $@

build/libjack%: $(PAWPAW_PREFIX)/lib/libjack%
@mkdir -p build
ln -sf $(abspath $<) $@
Expand Down Expand Up @@ -229,6 +238,10 @@ build/lib/libmod_utils$(SO_EXT): mod-ui/utils/libmod_utils.so
@mkdir -p build/lib
ln -sf $(abspath $<) $@

build/mod-app$(APP_EXT): systray/mod-app$(APP_EXT)
@mkdir -p build
ln -sf $(abspath $<) $@

build/default.pedalboard: mod-ui/default.pedalboard
@mkdir -p build
ln -sf $(abspath $<) $@
Expand Down Expand Up @@ -277,6 +290,9 @@ mod-midi-merger/build/Makefile: $(BOOTSTRAP_FILES)
mod-ui/utils/libmod_utils.so: $(BOOTSTRAP_FILES)
./utils/run.sh $(PAWPAW_TARGET) $(MAKE) -C mod-ui/utils

systray/mod-app$(APP_EXT): systray/main.cpp systray/mod-app.hpp
./utils/run.sh $(PAWPAW_TARGET) $(MAKE) -C systray

# ---------------------------------------------------------------------------------------------------------------------

build/plugins/%: $(PAWPAW_PREFIX)/lib/lv2/%
Expand Down
26 changes: 23 additions & 3 deletions systray/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include "mod-app.hpp"
#include "qrc_mod-app.hpp"

#ifndef _WIN32
#include <dlfcn.h>
#endif

int main(int argc, char* argv[])
{
// TODO set branding here
Expand All @@ -18,10 +22,26 @@ int main(int argc, char* argv[])
return 1;
}

app.setQuitOnLastWindowClosed(false);
#ifdef _WIN32
WCHAR wc[MAX_PATH + 256] = {};
GetModuleFileNameW(GetModuleHandleW(nullptr), wc, sizeof(wc)/sizeof(wc[0]));

if (wchar_t* const wcc = wcsrchr(wc, '\\'))
*wcc = 0;

SetCurrentDirectoryW(wc);

AppWindow window;
window.show();
const QString cwd(QString::fromWCharArray(wc));

std::wcscat(wc, L"\\plugins");
SetEnvironmentVariableW(L"LV2_PATH", wc);
#else
// TODO
const QString cwd;
#endif

app.setQuitOnLastWindowClosed(false);

AppWindow window(cwd);
return app.exec();
}
Loading

0 comments on commit d7ae97a

Please sign in to comment.