Remove duplicate header include from libardour source file
[ardour.git] / libs / ardour / vst_plugin.cc
index a395582f8fad08d60e2042014fb791883ddaffd9..8188354062c4b6adfeb3b79952008d18818c84ab 100644 (file)
@@ -33,7 +33,7 @@
 #include "ardour/filesystem_paths.h"
 #include "ardour/audio_buffer.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace PBD;
@@ -46,8 +46,10 @@ VSTPlugin::VSTPlugin (AudioEngine& engine, Session& session, VSTHandle* handle)
        , _plugin (0)
        , _pi (0)
        , _num (0)
+       , _transport_frame (0)
+       , _transport_speed (0.f)
 {
-
+       memset (&_timeInfo, 0, sizeof(_timeInfo));
 }
 
 VSTPlugin::~VSTPlugin ()
@@ -89,9 +91,9 @@ VSTPlugin::set_block_size (pframes_t nframes)
 }
 
 float
-VSTPlugin::default_value (uint32_t)
+VSTPlugin::default_value (uint32_t which)
 {
-       return 0;
+       return _parameter_defaults[which];
 }
 
 float
@@ -160,7 +162,7 @@ VSTPlugin::set_chunk (gchar const * data, bool single)
 void
 VSTPlugin::add_state (XMLNode* root) const
 {
-       LocaleGuard lg ();
+       LocaleGuard lg;
 
        if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
 
@@ -197,7 +199,7 @@ VSTPlugin::add_state (XMLNode* root) const
 int
 VSTPlugin::set_state (const XMLNode& node, int version)
 {
-       LocaleGuard lg ();
+       LocaleGuard lg;
        int ret = -1;
 
        if (node.name() != state_node_name()) {
@@ -321,6 +323,9 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
                desc.sr_dependent = false;
        }
 
+       desc.normal = get_parameter (which);
+       _parameter_defaults[which] = desc.normal;
+
        return 0;
 }
 
@@ -533,10 +538,14 @@ VSTPlugin::automatable () const
 
 int
 VSTPlugin::connect_and_run (BufferSet& bufs,
+               framepos_t start, framepos_t end, double speed,
                ChanMapping in_map, ChanMapping out_map,
                pframes_t nframes, framecnt_t offset)
 {
-       Plugin::connect_and_run (bufs, in_map, out_map, nframes, offset);
+       Plugin::connect_and_run(bufs, start, end, speed, in_map, out_map, nframes, offset);
+
+       _transport_frame = start;
+       _transport_speed = speed;
 
        ChanCount bufs_count;
        bufs_count.set(DataType::AUDIO, 1);