diff --git a/source/Makefile.mk b/source/Makefile.mk index f1f53935d..c23ea1a33 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -419,9 +419,6 @@ ifeq ($(HAVE_NTK),true) HAVE_ZYN_UI_DEPS = true endif -# TESTING -HAVE_ZYN_UI_DEPS = false - ifeq ($(HAVE_DGL),true) NATIVE_PLUGINS_LIBS += $(DGL_LIBS) ifeq ($(HAVE_PROJECTM),true) diff --git a/source/native-plugins/zynaddsubfx-fx.cpp b/source/native-plugins/zynaddsubfx-fx.cpp index ab4b15de2..9044a7ef5 100644 --- a/source/native-plugins/zynaddsubfx-fx.cpp +++ b/source/native-plugins/zynaddsubfx-fx.cpp @@ -221,6 +221,7 @@ protected: float* efxoutl; float* efxoutr; + // FIXME - is this thread-safe? SharedResourcePointer fAllocator; CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxAbstractPlugin) diff --git a/source/native-plugins/zynaddsubfx-src.cpp b/source/native-plugins/zynaddsubfx-src.cpp index ac525207a..fc8c51913 100644 --- a/source/native-plugins/zynaddsubfx-src.cpp +++ b/source/native-plugins/zynaddsubfx-src.cpp @@ -23,6 +23,8 @@ #endif #define PLUGINVERSION +#define SOURCE_DIR "/usr/share/zynaddsubfx/examples" +#undef override #include "zynaddsubfx/tlsf/tlsf.h" extern "C" { diff --git a/source/native-plugins/zynaddsubfx-synth.cpp b/source/native-plugins/zynaddsubfx-synth.cpp index 2d47fd102..fa4e4e7cd 100644 --- a/source/native-plugins/zynaddsubfx-synth.cpp +++ b/source/native-plugins/zynaddsubfx-synth.cpp @@ -59,24 +59,7 @@ using juce::roundToIntAccurate; using juce::FloatVectorOperations; #ifdef WANT_ZYNADDSUBFX_UI -static CarlaString gPixmapPath; extern CarlaString gUiPixmapPath; -# ifdef NTK_GUI -static Fl_Tiled_Image* gModuleBackdrop = nullptr; -# endif - -void set_module_parameters(Fl_Widget* o) -{ - o->box(FL_DOWN_FRAME); - o->align(o->align() | FL_ALIGN_IMAGE_BACKDROP); - o->color(FL_BLACK); - o->labeltype(FL_SHADOW_LABEL); - -# ifdef NTK_GUI - CARLA_SAFE_ASSERT_RETURN(gModuleBackdrop != nullptr,); - o->image(gModuleBackdrop); -# endif -} #endif // ----------------------------------------------------------------------- @@ -333,33 +316,6 @@ protected: } else if (fNextUiAction == 1) // init/show { - static bool initialized = false; - - if (! initialized) - { - initialized = true; - fl_register_images(); - -# ifdef NTK_GUI - Fl_Dial::default_style(Fl_Dial::PIXMAP_DIAL); - - if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "knob.png")) - Fl_Dial::default_image(img); - - if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "window_backdrop.png")) - Fl::scheme_bg(new Fl_Tiled_Image(img)); - - if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "module_backdrop.png")) - gModuleBackdrop = new Fl_Tiled_Image(img); - - Fl::background(50, 50, 50); - Fl::background2(70, 70, 70); - Fl::foreground(255, 255, 255); - - Fl_Theme::set("Cairo"); -# endif - } - if (fUi == nullptr) { fUiClosed = 0; @@ -885,9 +841,7 @@ public: denormalkillbuf[i] = (RND - 0.5f) * 1e-16f; #ifdef WANT_ZYNADDSUBFX_UI - gPixmapPath = host->resourceDir; - gPixmapPath += "/zynaddsubfx/"; - gUiPixmapPath = gPixmapPath; + gUiPixmapPath = CarlaString(host->resourceDir) + CARLA_OS_SEP_STR "zynaddsubfx" CARLA_OS_SEP_STR; #endif } diff --git a/source/native-plugins/zynaddsubfx-ui.cpp b/source/native-plugins/zynaddsubfx-ui.cpp index 35ecf5174..1c1cdae95 100644 --- a/source/native-plugins/zynaddsubfx-ui.cpp +++ b/source/native-plugins/zynaddsubfx-ui.cpp @@ -17,6 +17,11 @@ #include "CarlaString.hpp" +#ifdef CARLA_OS_WIN +#define errx(...) +#define warnx(...) +#endif + #define PLUGINVERSION #define SOURCE_DIR "/usr/share/zynaddsubfx/examples" #undef override @@ -24,21 +29,43 @@ CarlaString gUiPixmapPath; // zynaddsubfx ui includes -// #include "zynaddsubfx/UI/NioUI.cpp" -// #include "zynaddsubfx/UI/WidgetPDial.cpp" -// #include "zynaddsubfx/UI/ADnoteUI.cpp" -// #include "zynaddsubfx/UI/BankUI.cpp" -// #include "zynaddsubfx/UI/ConfigUI.cpp" -// #include "zynaddsubfx/UI/EffUI.cpp" -// #include "zynaddsubfx/UI/EnvelopeUI.cpp" -// #include "zynaddsubfx/UI/FilterUI.cpp" -// #include "zynaddsubfx/UI/LFOUI.cpp" -// #include "zynaddsubfx/UI/MasterUI.cpp" -// #include "zynaddsubfx/UI/MicrotonalUI.cpp" -// #include "zynaddsubfx/UI/OscilGenUI.cpp" -// #include "zynaddsubfx/UI/PADnoteUI.cpp" -// #include "zynaddsubfx/UI/PartUI.cpp" -// #include "zynaddsubfx/UI/PresetsUI.cpp" -// #include "zynaddsubfx/UI/ResonanceUI.cpp" -// #include "zynaddsubfx/UI/SUBnoteUI.cpp" -// #include "zynaddsubfx/UI/VirKeyboard.cpp" +#include "zynaddsubfx/UI/NioUI.cpp" +#include "zynaddsubfx/UI/WidgetPDial.cpp" +#include "zynaddsubfx/UI/ADnoteUI.cpp" +#include "zynaddsubfx/UI/BankUI.cpp" +#include "zynaddsubfx/UI/BankView.cpp" +#include "zynaddsubfx/UI/ConfigUI.cpp" +#include "zynaddsubfx/UI/Connection.cpp" +#include "zynaddsubfx/UI/EffUI.cpp" +#include "zynaddsubfx/UI/EnvelopeFreeEdit.cpp" +#include "zynaddsubfx/UI/EnvelopeUI.cpp" +#include "zynaddsubfx/UI/FilterUI.cpp" +#include "zynaddsubfx/UI/Fl_EQGraph.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Button.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Check.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Choice.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Counter.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Dial.cpp" +#include "zynaddsubfx/UI/Fl_Osc_DialF.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Input.cpp" +#include "zynaddsubfx/UI/Fl_Osc_ListView.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Output.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Pane.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Roller.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Slider.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Value.cpp" +#include "zynaddsubfx/UI/Fl_Osc_VSlider.cpp" +#include "zynaddsubfx/UI/Fl_Osc_Widget.cpp" +#include "zynaddsubfx/UI/Fl_Resonance_Graph.cpp" +#include "zynaddsubfx/UI/FormantFilterGraph.cpp" +#include "zynaddsubfx/UI/LFOUI.cpp" +#include "zynaddsubfx/UI/MasterUI.cpp" +#include "zynaddsubfx/UI/MicrotonalUI.cpp" +#include "zynaddsubfx/UI/OscilGenUI.cpp" +#include "zynaddsubfx/UI/PADnoteUI.cpp" +#include "zynaddsubfx/UI/PartNameButton.cpp" +#include "zynaddsubfx/UI/PartUI.cpp" +#include "zynaddsubfx/UI/PresetsUI.cpp" +#include "zynaddsubfx/UI/ResonanceUI.cpp" +#include "zynaddsubfx/UI/SUBnoteUI.cpp" +#include "zynaddsubfx/UI/VirKeyboard.cpp" diff --git a/source/native-plugins/zynaddsubfx/UI/Connection.cpp b/source/native-plugins/zynaddsubfx/UI/Connection.cpp index 2528405f1..9f6bb5cba 100644 --- a/source/native-plugins/zynaddsubfx/UI/Connection.cpp +++ b/source/native-plugins/zynaddsubfx/UI/Connection.cpp @@ -69,23 +69,38 @@ ui_handle_t GUI::createUi(Fl_Osc_Interface *osc, void *exit) Fl_Dial::default_style(Fl_Dial::PIXMAP_DIAL); +#ifdef CARLA_VERSION_STRING + if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "knob.png")) + Fl_Dial::default_image(img); +#else if(Fl_Shared_Image *img = Fl_Shared_Image::get(PIXMAP_PATH "/knob.png")) Fl_Dial::default_image(img); +#endif else if(Fl_Shared_Image *img = Fl_Shared_Image::get(SOURCE_DIR "/pixmaps/knob.png")) Fl_Dial::default_image(img); else errx(1, "ERROR: Cannot find pixmaps/knob.png"); +#ifdef CARLA_VERSION_STRING + if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "window_backdrop.png")) + Fl::scheme_bg(new Fl_Tiled_Image(img)); +#else if(Fl_Shared_Image *img = Fl_Shared_Image::get(PIXMAP_PATH "/window_backdrop.png")) Fl::scheme_bg(new Fl_Tiled_Image(img)); +#endif else if(Fl_Shared_Image *img = Fl_Shared_Image::get(SOURCE_DIR "/pixmaps/window_backdrop.png")) Fl::scheme_bg(new Fl_Tiled_Image(img)); else errx(1, "ERROR: Cannot find pixmaps/window_backdrop.png"); +#ifdef CARLA_VERSION_STRING + if(Fl_Shared_Image *img = Fl_Shared_Image::get(gUiPixmapPath + "module_backdrop.png")) + module_backdrop = new Fl_Tiled_Image(img); +#else if(Fl_Shared_Image *img = Fl_Shared_Image::get(PIXMAP_PATH "/module_backdrop.png")) module_backdrop = new Fl_Tiled_Image(img); +#endif else if(Fl_Shared_Image *img = Fl_Shared_Image::get(SOURCE_DIR "/pixmaps/module_backdrop.png")) module_backdrop = new Fl_Tiled_Image(img); else diff --git a/source/native-plugins/zynaddsubfx/UI/EnvelopeFreeEdit.h b/source/native-plugins/zynaddsubfx/UI/EnvelopeFreeEdit.h index b4c705474..e8106481b 100644 --- a/source/native-plugins/zynaddsubfx/UI/EnvelopeFreeEdit.h +++ b/source/native-plugins/zynaddsubfx/UI/EnvelopeFreeEdit.h @@ -1,3 +1,4 @@ +#pragma once #include #include "../Params/EnvelopeParams.h" #include "Fl_Osc_Widget.H" diff --git a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Choice.cpp b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Choice.cpp index 665186fd7..abf505adf 100644 --- a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Choice.cpp +++ b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Choice.cpp @@ -7,7 +7,7 @@ #include #include -static void callback_fn(Fl_Widget *w, void *) +static void callback_fn_choice(Fl_Widget *w, void *) { ((Fl_Osc_Choice*)w)->cb(); } @@ -16,7 +16,7 @@ Fl_Osc_Choice::Fl_Osc_Choice(int X, int Y, int W, int H, const char *label) :Fl_Choice(X,Y,W,H, label), Fl_Osc_Widget(this), cb_data(NULL, NULL) { min = 0; - Fl_Choice::callback(callback_fn, NULL); + Fl_Choice::callback(callback_fn_choice, NULL); } void Fl_Osc_Choice::init(std::string path_, int base) diff --git a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Counter.cpp b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Counter.cpp index b5278f4ae..2b264a8bc 100644 --- a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Counter.cpp +++ b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Counter.cpp @@ -1,6 +1,6 @@ #include "Fl_Osc_Counter.H" -static void callback_fn(Fl_Widget *w, void *) +static void callback_fn_counter(Fl_Widget *w, void *) { ((Fl_Osc_Counter*)w)->cb(); } @@ -8,7 +8,7 @@ static void callback_fn(Fl_Widget *w, void *) Fl_Osc_Counter::Fl_Osc_Counter(int x, int y, int w, int h, const char *label) :Fl_Counter(x,y,w,h,label), Fl_Osc_Widget(this), offset(0) { - Fl_Counter::callback(callback_fn); + Fl_Counter::callback(callback_fn_counter); } void Fl_Osc_Counter::update(void) diff --git a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Dial.cpp b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Dial.cpp index cdf46af15..64eaab7f3 100644 --- a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Dial.cpp +++ b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Dial.cpp @@ -8,7 +8,7 @@ #include #include -static void callback_fn(Fl_Widget *w, void *) +static void callback_fn_dial(Fl_Widget *w, void *) { ((Fl_Osc_Dial*)w)->cb(); } @@ -28,7 +28,7 @@ Fl_Osc_Dial::Fl_Osc_Dial(int X, int Y, int W, int H, const char *label) :WidgetPDial(X,Y,W,H, label), Fl_Osc_Widget(this), alt_style(false), dead(false) { bounds(0.0, 127.0f); - WidgetPDial::callback(callback_fn); + WidgetPDial::callback(callback_fn_dial); } diff --git a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_DialF.cpp b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_DialF.cpp index 72500a3f8..ccc656dc2 100644 --- a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_DialF.cpp +++ b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_DialF.cpp @@ -18,7 +18,7 @@ B string_cast(const A &a) return b; } -static void callback_fn(Fl_Widget *w, void *) +static void callback_fn_dialf(Fl_Widget *w, void *) { ((Fl_Osc_DialF*)w)->cb(); } @@ -27,7 +27,7 @@ Fl_Osc_DialF::Fl_Osc_DialF(int X, int Y, int W, int H, const char *label) :WidgetPDial(X,Y,W,H, label), Fl_Osc_Widget() { //bounds(0.0, 127.0f); - WidgetPDial::callback(callback_fn); + WidgetPDial::callback(callback_fn_dialf); } diff --git a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Output.cpp b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Output.cpp index dbd44f300..9ee7afbe3 100644 --- a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Output.cpp +++ b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Output.cpp @@ -5,7 +5,7 @@ #include #include -static void callback_fn(Fl_Widget *w, void *) +static void callback_fn_output(Fl_Widget *w, void *) { ((Fl_Osc_Output*)w)->cb(); } @@ -13,7 +13,7 @@ static void callback_fn(Fl_Widget *w, void *) Fl_Osc_Output::Fl_Osc_Output(int X, int Y, int W, int H, const char *label) :Fl_Value_Output(X,Y,W,H, label), Fl_Osc_Widget(this) { - Fl_Value_Output::callback(callback_fn); + Fl_Value_Output::callback(callback_fn_output); } diff --git a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Roller.cpp b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Roller.cpp index 18bb86004..acff7ba0a 100644 --- a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Roller.cpp +++ b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Roller.cpp @@ -5,7 +5,7 @@ #include #include -static void callback_fn(Fl_Widget *w, void *) +static void callback_fn_roller(Fl_Widget *w, void *) { ((Fl_Osc_Roller*)w)->cb(); } @@ -13,7 +13,7 @@ static void callback_fn(Fl_Widget *w, void *) Fl_Osc_Roller::Fl_Osc_Roller(int X, int Y, int W, int H, const char *label) :Fl_Roller(X,Y,W,H, label), Fl_Osc_Widget(this) { - Fl_Roller::callback(callback_fn); + Fl_Roller::callback(callback_fn_roller); bounds(0.0, 127.0f); } diff --git a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Value.H b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Value.H index 6555d79dd..1a42df36c 100644 --- a/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Value.H +++ b/source/native-plugins/zynaddsubfx/UI/Fl_Osc_Value.H @@ -1,3 +1,4 @@ +#pragma once #include #include "Fl_Osc_Widget.H"