properly handle integer steps in plugin controls
[ardour.git] / libs / ardour / session_vst.cc
index 508f11df138ccbc09dec97aae87ebd259ccecd9e..46814ac4f19564d5673a406c46bdab8474489783 100644 (file)
@@ -32,6 +32,8 @@
 #include <fst.h>
 #endif
 
+#include "pbd/debug.h"
+
 #include "i18n.h"
 
 #define DEBUG_CALLBACKS
@@ -79,19 +81,11 @@ intptr_t Session::vst_callback (
        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){
@@ -136,7 +130,7 @@ intptr_t Session::vst_callback (
        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;