commit fce3eae6b1a7f7cfcbb0607d89278a4f7a969c9e
parent fb60889c6a7e41ec4e88805370c97efdb51398ce
Author: falkTX <falktx@gmail.com>
Date: Sun, 17 May 2015 00:30:18 +0200
Disable some static code in plugin version
Diffstat:
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp
@@ -230,9 +230,11 @@ static const Ports master_ports = {
};
const Ports &Master::ports = master_ports;
+#ifndef PLUGINVERSION
//XXX HACKS
Master *the_master;
rtosc::ThreadLink *the_bToU;
+#endif
class DataObj:public rtosc::RtData
{
@@ -290,12 +292,14 @@ Master::Master(const SYNTH_T &synth_)
bToU = NULL;
uToB = NULL;
memory = new Allocator();
- the_master = this;
swaplr = 0;
off = 0;
smps = 0;
bufl = new float[synth.buffersize];
bufr = new float[synth.buffersize];
+#ifndef PLUGINVERSION
+ the_master = this;
+#endif
fft = new FFTwrapper(synth.oscilsize);
@@ -319,6 +323,7 @@ Master::Master(const SYNTH_T &synth_)
defaults();
+#ifndef PLUGINVERSION
midi.event_cb = [](const char *m)
{
char loc_buf[1024];
@@ -327,6 +332,9 @@ Master::Master(const SYNTH_T &synth_)
//printf("sending an event to the owner of '%s'\n", m);
Master::ports.dispatch(m+1, d);
};
+#else
+ midi.event_cb = [](const char *) {};
+#endif
midi.error_cb = [](const char *a, const char *b)
{
diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp
@@ -37,7 +37,9 @@
#include <err.h>
using std::string;
+#ifndef PLUGINVERSION
extern rtosc::ThreadLink *the_bToU;//XXX
+#endif
/******************************************************************************
* LIBLO And Reflection Code *
@@ -846,7 +848,7 @@ MiddleWareImpl::MiddleWareImpl(MiddleWare *mw, SYNTH_T synth_, int prefered_port
lo_server_add_method(server, NULL, NULL, handler_function, mw);
fprintf(stderr, "lo server running on %d\n", lo_server_get_port(server));
-#ifndef CARLA_VERSION_STRING
+#ifndef PLUGINVERSION
clean_up_tmp_nams();
create_tmp_file((unsigned)lo_server_get_port(server));
#endif
@@ -856,7 +858,9 @@ MiddleWareImpl::MiddleWareImpl(MiddleWare *mw, SYNTH_T synth_, int prefered_port
idle = 0;
idle_ptr = 0;
+#ifndef PLUGINVERSION
the_bToU = bToU;
+#endif
master = new Master(synth);
master->bToU = bToU;
master->uToB = uToB;
@@ -999,7 +1003,7 @@ void MiddleWareImpl::bToUhandle(const char *rtmsg, bool dummy)
broadcast = true;
} else if(broadcast) {
broadcast = false;
-#ifdef CARLA_VERSION_STRING
+#ifdef PLUGINVERSION
if (!curr_url.empty()) // falktx: check added
cb(ui, rtmsg);