Browse Source

Zyn UI builds now, but doesn't work yet

tags/1.9.7
falkTX 9 years ago
parent
commit
b13f2263f8
14 changed files with 78 additions and 80 deletions
  1. +0
    -3
      source/Makefile.mk
  2. +1
    -0
      source/native-plugins/zynaddsubfx-fx.cpp
  3. +2
    -0
      source/native-plugins/zynaddsubfx-src.cpp
  4. +1
    -47
      source/native-plugins/zynaddsubfx-synth.cpp
  5. +45
    -18
      source/native-plugins/zynaddsubfx-ui.cpp
  6. +15
    -0
      source/native-plugins/zynaddsubfx/UI/Connection.cpp
  7. +1
    -0
      source/native-plugins/zynaddsubfx/UI/EnvelopeFreeEdit.h
  8. +2
    -2
      source/native-plugins/zynaddsubfx/UI/Fl_Osc_Choice.cpp
  9. +2
    -2
      source/native-plugins/zynaddsubfx/UI/Fl_Osc_Counter.cpp
  10. +2
    -2
      source/native-plugins/zynaddsubfx/UI/Fl_Osc_Dial.cpp
  11. +2
    -2
      source/native-plugins/zynaddsubfx/UI/Fl_Osc_DialF.cpp
  12. +2
    -2
      source/native-plugins/zynaddsubfx/UI/Fl_Osc_Output.cpp
  13. +2
    -2
      source/native-plugins/zynaddsubfx/UI/Fl_Osc_Roller.cpp
  14. +1
    -0
      source/native-plugins/zynaddsubfx/UI/Fl_Osc_Value.H

+ 0
- 3
source/Makefile.mk View File

@@ -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)


+ 1
- 0
source/native-plugins/zynaddsubfx-fx.cpp View File

@@ -221,6 +221,7 @@ protected:
float* efxoutl;
float* efxoutr;

// FIXME - is this thread-safe?
SharedResourcePointer<Allocator> fAllocator;

CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxAbstractPlugin)


+ 2
- 0
source/native-plugins/zynaddsubfx-src.cpp View File

@@ -23,6 +23,8 @@
#endif

#define PLUGINVERSION
#define SOURCE_DIR "/usr/share/zynaddsubfx/examples"
#undef override

#include "zynaddsubfx/tlsf/tlsf.h"
extern "C" {


+ 1
- 47
source/native-plugins/zynaddsubfx-synth.cpp View File

@@ -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
}



+ 45
- 18
source/native-plugins/zynaddsubfx-ui.cpp View File

@@ -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"

+ 15
- 0
source/native-plugins/zynaddsubfx/UI/Connection.cpp View File

@@ -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


+ 1
- 0
source/native-plugins/zynaddsubfx/UI/EnvelopeFreeEdit.h View File

@@ -1,3 +1,4 @@
#pragma once
#include <FL/Fl_Box.H>
#include "../Params/EnvelopeParams.h"
#include "Fl_Osc_Widget.H"


+ 2
- 2
source/native-plugins/zynaddsubfx/UI/Fl_Osc_Choice.cpp View File

@@ -7,7 +7,7 @@
#include <cassert>
#include <sstream>

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)


+ 2
- 2
source/native-plugins/zynaddsubfx/UI/Fl_Osc_Counter.cpp View File

@@ -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)


+ 2
- 2
source/native-plugins/zynaddsubfx/UI/Fl_Osc_Dial.cpp View File

@@ -8,7 +8,7 @@
#include <cassert>
#include <sstream>

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);
}




+ 2
- 2
source/native-plugins/zynaddsubfx/UI/Fl_Osc_DialF.cpp View File

@@ -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);
}




+ 2
- 2
source/native-plugins/zynaddsubfx/UI/Fl_Osc_Output.cpp View File

@@ -5,7 +5,7 @@
#include <cassert>
#include <sstream>

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);
}




+ 2
- 2
source/native-plugins/zynaddsubfx/UI/Fl_Osc_Roller.cpp View File

@@ -5,7 +5,7 @@
#include <cassert>
#include <sstream>

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);
}



+ 1
- 0
source/native-plugins/zynaddsubfx/UI/Fl_Osc_Value.H View File

@@ -1,3 +1,4 @@
#pragma once
#include <FL/Fl_Value_Input.H>
#include "Fl_Osc_Widget.H"



Loading…
Cancel
Save