#include <fst.h>
#endif
+#include "pbd/debug.h"
+
#include "i18n.h"
#define DEBUG_CALLBACKS
const char* Session::vst_can_do_strings[] = {
X_("supplyIdle"),
X_("sendVstTimeInfo"),
+ X_("sendVstEvents"),
+ X_("sendVstMidiEvent"),
+ X_("receiveVstEvents"),
+ X_("receiveVstMidiEvent"),
X_("supportShell"),
- X_("shellCategory")
+ X_("shellCategory"),
+ X_("shellCategorycurID")
};
const int Session::vst_can_do_string_count = sizeof (vst_can_do_strings) / sizeof (char*);
if (effect && effect->user) {
plug = (VSTPlugin *) (effect->user);
session = &plug->session();
-#ifdef COMPILER_MSVC
- SHOW_CALLBACK ("am callback 0x%x, opcode = %d, plugin = \"%s\" ", (int) pthread_self().p, opcode, plug->name());
-#else
- SHOW_CALLBACK ("am callback 0x%x, opcode = %d, plugin = \"%s\" ", (int) pthread_self(), opcode, plug->name());
-#endif
+ SHOW_CALLBACK ("am callback 0x%p, opcode = %d, plugin = \"%s\" ", (void*) DEBUG_THREAD_SELF, opcode, plug->name());
} else {
plug = 0;
session = 0;
-#ifdef COMPILER_MSVC
- SHOW_CALLBACK ("am callback 0x%x, opcode = %d", (int) pthread_self().p, opcode);
-#else
- SHOW_CALLBACK ("am callback 0x%x, opcode = %d", (int) pthread_self(), opcode);
-#endif
+ SHOW_CALLBACK ("am callback 0x%p, opcode = %d", (void*) DEBUG_THREAD_SELF, opcode);
}
switch(opcode){
case audioMasterWantMidi:
SHOW_CALLBACK ("amc: audioMasterWantMidi\n");
// <value> is a filter which is currently ignored
- if (plug) {
+ if (plug && plug->get_info() != NULL) {
plug->get_info()->n_inputs.set_midi (1);
}
return 0;
case audioMasterProcessEvents:
SHOW_CALLBACK ("amc: audioMasterProcessEvents\n");
// VstEvents* in <ptr>
+ if (plug && plug->midi_buffer()) {
+ VstEvents* v = (VstEvents*)ptr;
+ for (int n = 0 ; n < v->numEvents; ++n) {
+ VstMidiEvent *vme = (VstMidiEvent*) (v->events[n]->dump);
+ if (vme->type == kVstMidiType) {
+ plug->midi_buffer()->push_back(vme->deltaFrames, 3, (uint8_t*)vme->midiData);
+ }
+ }
+ }
return 0;
case audioMasterSetTime: