#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
+#include <glibmm/convert.h>
#include "pbd/floating.h"
#include "pbd/locale_guard.h"
int r = 0;
guchar* raw_data = g_base64_decode (data, &size);
{
- Glib::Threads::Mutex::Lock lm (_lock);
+ pthread_mutex_lock (&_state->state_lock);
r = _plugin->dispatcher (_plugin, 24 /* effSetChunk */, single ? 1 : 0, size, raw_data, 0);
+ pthread_mutex_unlock (&_state->state_lock);
}
g_free (raw_data);
return r;
}
desc.normal = get_parameter (which);
- _parameter_defaults[which] = desc.normal;
+ if (_parameter_defaults.find (which) == _parameter_defaults.end ()) {
+ _parameter_defaults[which] = desc.normal;
+ }
return 0;
}
sscanf (r.uri.c_str(), "VST:%d:%d", &id, &index);
#endif
_state->want_program = index;
+ LoadPresetProgram (); /* EMIT SIGNAL */ /* used for macvst */
return true;
}
_state->wanted_chunk = raw_data;
_state->wanted_chunk_size = size;
_state->want_chunk = 1;
+ LoadPresetProgram (); /* EMIT SIGNAL */ /* used for macvst */
return true;
}
}
{
Plugin::connect_and_run(bufs, start, end, speed, in_map, out_map, nframes, offset);
- Glib::Threads::Mutex::Lock lm (_state_lock, Glib::Threads::TRY_LOCK);
- if (!lm.locked()) {
+ if (pthread_mutex_trylock (&_state->state_lock)) {
/* by convention 'effSetChunk' should not be called while processing
* http://www.reaper.fm/sdk/vst/vst_ext.php
*
_plugin->processReplacing (_plugin, &ins[0], &outs[0], nframes);
_midi_out_buf = 0;
+ pthread_mutex_unlock (&_state->state_lock);
return 0;
}