Merge branch 'master' into windows+cc
[ardour.git] / libs / ardour / session_vst.cc
index 9ba3864383a6bd5cc13e0abf69ab61c0d1146642..06a6b80e99b39c34ce1f2836af803eb9d2c5729a 100644 (file)
@@ -17,7 +17,9 @@
 
 */
 
+#ifndef COMPILER_MSVC
 #include <stdbool.h>
+#endif
 #include <cstdio>
 
 #include "ardour/session.h"
@@ -59,11 +61,19 @@ 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
        } 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
        }
 
        switch(opcode){
@@ -132,7 +142,7 @@ intptr_t Session::vst_callback (
                        }
                        if (value & (kVstBarsValid)) {
                                const Meter& m (session->tempo_map().meter_at (session->transport_frame()));
-                               _timeInfo.timeSigNumerator = m.beats_per_bar ();
+                               _timeInfo.timeSigNumerator = m.divisions_per_bar ();
                                _timeInfo.timeSigDenominator = m.note_divisor ();
                                _timeInfo.flags |= (kVstBarsValid);
                        }
@@ -247,6 +257,8 @@ intptr_t Session::vst_callback (
 
        case audioMasterOfflineStart:
                SHOW_CALLBACK ("amc: audioMasterOfflineStart\n");
+               return 0;
+               
        case audioMasterOfflineRead:
                SHOW_CALLBACK ("amc: audioMasterOfflineRead\n");
               // ptr points to offline structure, see below. return 0: error, 1 ok
@@ -259,6 +271,8 @@ intptr_t Session::vst_callback (
 
        case audioMasterOfflineGetCurrentPass:
                SHOW_CALLBACK ("amc: audioMasterOfflineGetCurrentPass\n");
+               return 0;
+               
        case audioMasterOfflineGetCurrentMetaPass:
                SHOW_CALLBACK ("amc: audioMasterOfflineGetCurrentMetaPass\n");
                return 0;
@@ -282,7 +296,7 @@ intptr_t Session::vst_callback (
        case audioMasterGetProductString:
                SHOW_CALLBACK ("amc: audioMasterGetProductString\n");
                // fills <ptr> with a string with product name (max 64 char)
-               strcpy ((char*) ptr, "Ardour");
+               strcpy ((char*) ptr, PROGRAM_NAME);
                return 0;
 
        case audioMasterGetVendorVersion: