Browse Source

Fix zyn amalgamated build, auto-include rtosc

tags/1.9.7
falkTX 10 years ago
parent
commit
6ce5bbdabb
9 changed files with 40 additions and 42 deletions
  1. +1
    -1
      source/native-plugins/Makefile
  2. +14
    -3
      source/native-plugins/zynaddsubfx-src.cpp
  3. +0
    -35
      source/native-plugins/zynaddsubfx-synth.cpp
  4. +17
    -0
      source/native-plugins/zynaddsubfx-ui.cpp
  5. +3
    -3
      source/native-plugins/zynaddsubfx/rtosc/cpp/ports.cpp
  6. +2
    -0
      source/native-plugins/zynaddsubfx/rtosc/cpp/thread-link.cpp
  7. +1
    -0
      source/native-plugins/zynaddsubfx/rtosc/miditable.h
  8. +1
    -0
      source/native-plugins/zynaddsubfx/rtosc/subtree-serialize.h
  9. +1
    -0
      source/native-plugins/zynaddsubfx/rtosc/typed-message.h

+ 1
- 1
source/native-plugins/Makefile View File

@@ -17,7 +17,7 @@ BUILD_CXX_FLAGS += -I.. -isystem $(CWD)/modules -I$(CWD)/modules/distrho
# Flags for ZynAddSubFX

ifeq ($(HAVE_ZYN_DEPS),true)
ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) -isystem zynaddsubfx
ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) -isystem zynaddsubfx -Izynaddsubfx/rtosc
ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml zlib)
ZYN_LD_FLAGS = $(shell pkg-config --libs liblo)
ifeq ($(HAVE_ZYN_UI_DEPS),true)


+ 14
- 3
source/native-plugins/zynaddsubfx-src.cpp View File

@@ -26,11 +26,25 @@
#define SOURCE_DIR "/usr/share/zynaddsubfx/examples"
#undef override

// base c-style headers
#include "zynaddsubfx/tlsf/tlsf.h"
#include "zynaddsubfx/rtosc/rtosc.h"

// C-code includes
extern "C" {
#include "zynaddsubfx/tlsf/tlsf.c"
#include "zynaddsubfx/rtosc/dispatch.c"
#include "zynaddsubfx/rtosc/rtosc.c"
}

// rtosc includes
#include "zynaddsubfx/rtosc/cpp/midimapper.cpp"
#include "zynaddsubfx/rtosc/cpp/miditable.cpp"
#include "zynaddsubfx/rtosc/cpp/ports.cpp"
#include "zynaddsubfx/rtosc/cpp/subtree-serialize.cpp"
#include "zynaddsubfx/rtosc/cpp/thread-link.cpp"
#include "zynaddsubfx/rtosc/cpp/undo-history.cpp"

// zynaddsubfx includes
#include "zynaddsubfx/DSP/AnalogFilter.cpp"
#include "zynaddsubfx/DSP/FFTwrapper.cpp"
@@ -81,10 +95,7 @@ extern "C" {
#include "zynaddsubfx/Synth/Resonance.cpp"
#include "zynaddsubfx/Synth/SUBnote.cpp"
#include "zynaddsubfx/Synth/SynthNote.cpp"

#ifdef NO_UI
#include "zynaddsubfx/UI/ConnectionDummy.cpp"
#endif

// Dummy variables and functions for linking purposes
// const char* instance_name = nullptr;


+ 0
- 35
source/native-plugins/zynaddsubfx-synth.cpp View File

@@ -22,16 +22,11 @@

#include "CarlaMathUtils.hpp"

#include "DSP/FFTwrapper.h"
#include "Misc/Master.h"
#include "Misc/MiddleWare.h"
#include "Misc/Part.h"
#include "Misc/Util.h"

#ifdef HAVE_ZYN_UI_DEPS
# include "UI/Connection.h"
#endif

#include <ctime>
#include <set>
#include <string>
@@ -42,36 +37,6 @@ using juce::FloatVectorOperations;

// -----------------------------------------------------------------------

#ifdef HAVE_ZYN_UI_DEPS
namespace GUI {
Fl_Osc_Interface* genOscInterface(MiddleWare*)
{
return nullptr;
}
void raiseUi(ui_handle_t, const char *)
{
}
#if 0
ui_handle_t createUi(Fl_Osc_Interface*, void *exit)
{
return nullptr;
}
void destroyUi(ui_handle_t)
{
}
void raiseUi(ui_handle_t, const char *, const char *, ...)
{
}
void tickUi(ui_handle_t)
{
//usleep(100000);
}
#endif
};
#endif

// -----------------------------------------------------------------------

class ZynAddSubFxPrograms
{
public:


+ 17
- 0
source/native-plugins/zynaddsubfx-ui.cpp View File

@@ -28,6 +28,23 @@

CarlaString gUiPixmapPath("/usr/share/carla/resources/zynaddsubfx/");

// base c-style headers
#include "zynaddsubfx/rtosc/rtosc.h"

// rtosc c includes
extern "C" {
#include "zynaddsubfx/rtosc/dispatch.c"
#include "zynaddsubfx/rtosc/rtosc.c"
}

// rtosc c++ includes
#include "zynaddsubfx/rtosc/cpp/midimapper.cpp"
#include "zynaddsubfx/rtosc/cpp/miditable.cpp"
#include "zynaddsubfx/rtosc/cpp/ports.cpp"
#include "zynaddsubfx/rtosc/cpp/subtree-serialize.cpp"
#include "zynaddsubfx/rtosc/cpp/thread-link.cpp"
#include "zynaddsubfx/rtosc/cpp/undo-history.cpp"

// zynaddsubfx ui includes
#include "zynaddsubfx/UI/NioUI.cpp"
#include "zynaddsubfx/UI/WidgetPDial.cpp"


+ 3
- 3
source/native-plugins/zynaddsubfx/rtosc/cpp/ports.cpp View File

@@ -255,7 +255,7 @@ bool has(T &t, Z&z)
return false;
}

int max(int a, int b) { return a<b?b:a;}
int rtosc_max(int a, int b) { return a<b?b:a;}

ivec_t find_pos(words_t &strs)
{
@@ -263,7 +263,7 @@ ivec_t find_pos(words_t &strs)
int current_dups = strs.size();
int N = 0;
for(auto w:strs)
N = max(N,w.length());
N = rtosc_max(N,w.length());

int pos_best = -1;
int pos_best_val = INT_MAX;
@@ -362,7 +362,7 @@ ivec_t find_remap(words_t &strs, ivec_t &pos, ivec_t &assoc)
// printf("%d) '%s'\n", hashed[i], strs[i].c_str());
int N = 0;
for(auto h:hashed)
N = max(N,h+1);
N = rtosc_max(N,h+1);
for(int i=0; i<N; ++i)
remap.push_back(0);
for(int i=0; i<(int)hashed.size(); ++i)


+ 2
- 0
source/native-plugins/zynaddsubfx/rtosc/cpp/thread-link.cpp View File

@@ -178,3 +178,5 @@ char *ThreadLink::buffer(void) {return write_buffer;}
size_t ThreadLink::buffer_size(void) const {return BufferSize;}

};

#undef static

+ 1
- 0
source/native-plugins/zynaddsubfx/rtosc/miditable.h View File

@@ -22,6 +22,7 @@
* DEALINGS IN THE SOFTWARE.
*/

#pragma once
#include "ports.h"
#include <string.h>
#include <algorithm>


+ 1
- 0
source/native-plugins/zynaddsubfx/rtosc/subtree-serialize.h View File

@@ -1,3 +1,4 @@
#pragma once
#include <cstddef>

namespace rtosc{struct Ports; struct RtData;}


+ 1
- 0
source/native-plugins/zynaddsubfx/rtosc/typed-message.h View File

@@ -1,3 +1,4 @@
#pragma once
#include "rtosc.h"
#include <type_traits>
#include <stdexcept>


Loading…
Cancel
Save