fix merge with master
[ardour.git] / libs / ardour / session_vst.cc
index 3e3a6d36d21c2330bed06689a2e684041ba1121a..06a6b80e99b39c34ce1f2836af803eb9d2c5729a 100644 (file)
 
 */
 
+#ifndef COMPILER_MSVC
 #include <stdbool.h>
+#endif
 #include <cstdio>
 
-#include <fst.h>
-#include <fst/vestige/aeffectx.h>
-
 #include "ardour/session.h"
 #include "ardour/tempo.h"
 #include "ardour/windows_vst_plugin.h"
+#include "ardour/vestige/aeffectx.h"
+#include "ardour/vst_types.h"
 
 #include "i18n.h"
 
@@ -50,7 +51,7 @@ intptr_t Session::vst_callback (
        )
 {
        static VstTimeInfo _timeInfo;
-       WindowsVSTPlugin* plug;
+       VSTPlugin* plug;
        Session* session;
 
        if (debug_callbacks < 0) {
@@ -58,13 +59,21 @@ intptr_t Session::vst_callback (
        }
 
        if (effect && effect->user) {
-               plug = (WindowsVSTPlugin*) (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){
@@ -133,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);
                        }
@@ -185,7 +194,7 @@ intptr_t Session::vst_callback (
                SHOW_CALLBACK ("amc: audioMasterNeedIdle\n");
                // plug needs idle calls (outside its editor window)
                if (plug) {
-                       plug->fst()->wantIdle = 1;
+                       plug->state()->wantIdle = 1;
                }
                return 0;
 
@@ -248,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
@@ -260,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;
@@ -283,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: