summaryrefslogtreecommitdiff
path: root/plugins/ZamSFZ
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ZamSFZ')
-rw-r--r--plugins/ZamSFZ/Makefile6
-rw-r--r--plugins/ZamSFZ/ZamSFZUI.cpp39
-rw-r--r--plugins/ZamSFZ/ZamSFZUI.hpp3
3 files changed, 22 insertions, 26 deletions
diff --git a/plugins/ZamSFZ/Makefile b/plugins/ZamSFZ/Makefile
index b6b4d8b..aa1ba72 100644
--- a/plugins/ZamSFZ/Makefile
+++ b/plugins/ZamSFZ/Makefile
@@ -27,6 +27,12 @@ OBJS_UI = \
include ../Makefile.mk
# --------------------------------------------------------------
+# Extra flags
+
+BASE_FLAGS += $(shell pkg-config --cflags sndfile rubberband)
+LINK_FLAGS += $(shell pkg-config --libs sndfile rubberband)
+
+# --------------------------------------------------------------
# Enable all possible plugin types
ifeq ($(LINUX),true)
diff --git a/plugins/ZamSFZ/ZamSFZUI.cpp b/plugins/ZamSFZ/ZamSFZUI.cpp
index eccdf02..3bb4d69 100644
--- a/plugins/ZamSFZ/ZamSFZUI.cpp
+++ b/plugins/ZamSFZ/ZamSFZUI.cpp
@@ -18,6 +18,8 @@
#include "ZamSFZUI.hpp"
#include "ZamSFZPlugin.hpp"
+#include "Window.hpp"
+
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
@@ -82,6 +84,13 @@ void ZamSFZUI::d_stateChanged(const char* key, const char*)
}
}
+void ZamSFZUI::d_uiFileBrowserSelected(const char* filename)
+{
+ // if a file was selected, tell DSP
+ if (filename != nullptr)
+ d_setState("filepath", filename);
+}
+
// -----------------------------------------------------------------------
// Widget Callbacks
@@ -105,33 +114,11 @@ void ZamSFZUI::imageKnobValueChanged(ImageKnob* knob, float value)
void ZamSFZUI::imageButtonClicked(ImageButton*, int)
{
-/*
- GtkWidget* dialog = gtk_file_chooser_dialog_new(
- "Load SFZ",
- NULL,
- GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
- NULL);
-
- if (filepath) {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), filepath);
- }
+ DGL::Window::FileBrowserOptions opts;
+ opts.title = "Load SFZ";
+ //opts.filters = "sfz;";
- if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_ACCEPT) {
- gtk_widget_destroy(dialog);
- return;
- }
-
- if (filepath) {
- g_free(filepath);
- }
- filepath = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
-
- gtk_widget_destroy(dialog);
-*/
-// d_setState("filepath", "/home/damien/Music/rhodes-nord/rhodes-nord.sfz");
- d_setState("filepath", "/home/damien/Music/sfz/sfz LatelyBass/TX_LatelyBass.sfz");
+ getParentWindow().openFileBrowser(opts);
}
void ZamSFZUI::onDisplay()
diff --git a/plugins/ZamSFZ/ZamSFZUI.hpp b/plugins/ZamSFZ/ZamSFZUI.hpp
index f0d1047..e82f406 100644
--- a/plugins/ZamSFZ/ZamSFZUI.hpp
+++ b/plugins/ZamSFZ/ZamSFZUI.hpp
@@ -46,6 +46,8 @@ protected:
void d_programChanged(uint32_t index) override;
void d_stateChanged(const char* key, const char* value) override;
+ void d_uiFileBrowserSelected(const char* filename) override;
+
// -------------------------------------------------------------------
// Widget Callbacks
@@ -55,6 +57,7 @@ protected:
void imageButtonClicked(ImageButton*, int) override;
void onDisplay() override;
+
private:
Image fImgBackground;
ScopedPointer<ImageKnob> fKnobGain;