#include <sys/stat.h>
#include <cerrno>
-#include <glibmm/ustring.h>
#include <glibmm/miscutils.h>
#include <lrdf.h>
#include "ardour/vst_plugin.h"
#include "ardour/buffer_set.h"
#include "ardour/audio_buffer.h"
+#include "ardour/midi_buffer.h"
#include "pbd/stl_delete.h"
#include "i18n.h"
#include <locale.h>
+using namespace std;
using namespace ARDOUR;
using namespace PBD;
using std::min;
fst_close (_fst);
}
-void
+int
VSTPlugin::set_block_size (nframes_t nframes)
{
deactivate ();
_plugin->dispatcher (_plugin, effSetBlockSize, 0, nframes, NULL, 0.0f);
activate ();
+ return 0;
}
float
/* fetch the current chunk */
guchar* data;
- long data_size;
+ int32_t data_size;
if ((data_size = _plugin->dispatcher (_plugin, 23 /* effGetChunk */, 0, 0, &data, false)) == 0) {
return *root;
XMLNode* parameters = new XMLNode ("parameters");
- for (long n = 0; n < _plugin->numParams; ++n) {
+ for (int32_t n = 0; n < _plugin->numParams; ++n) {
char index[64];
char val[32];
snprintf (index, sizeof (index), "param_%ld", n);
}
int
-VSTPlugin::set_state(const XMLNode& node)
+VSTPlugin::set_state(const XMLNode& node, int)
{
LocaleGuard lg (X_("POSIX"));
const XMLProperty* prop;
if ((prop = node.property ("current-program")) != 0) {
- _fst->current_program = atoi (prop->value());
+ _fst->current_program = atoi (prop->value().c_str());
}
XMLNode* child;
XMLPropertyList::const_iterator i;
for (i = child->properties().begin(); i != child->properties().end(); ++i) {
- long param;
+ int32_t param;
float val;
- sscanf ((*i)->name().c_str(), "param_%ld", ¶m);
+ sscanf ((*i)->name().c_str(), "param_%d", ¶m);
sscanf ((*i)->value().c_str(), "%f", &val);
_plugin->setParameter (_plugin, param, val);
const uint32_t nbufs = bufs.count().n_audio();
+ int in_index = 0;
for (i = 0; i < (int32_t) _plugin->numInputs; ++i) {
ins[i] = bufs.get_audio(min((uint32_t) in_index, nbufs - 1)).data() + offset;
in_index++;
}
+ int out_index = 0;
for (i = 0; i < (int32_t) _plugin->numOutputs; ++i) {
outs[i] = bufs.get_audio(min((uint32_t) out_index, nbufs - 1)).data() + offset;
}
+ if (bufs.count().n_midi() > 0) {
+ VstEvents* v = bufs.get_vst_midi (0);
+ _plugin->dispatcher (_plugin, effProcessEvents, 0, 0, v, 0);
+ }
+
/* we already know it can support processReplacing */
_plugin->processReplacing (_plugin, ins, outs, nframes);