first vaguely working version using PresentationInfo
[ardour.git] / libs / ardour / auditioner.cc
index 3242346e96d094db54ef11a80d07b531c8f83408..0c7ba0bc1c15b81c4c335ad2430df2a9d5c3485f 100644 (file)
@@ -46,7 +46,7 @@ using namespace PBD;
 #include "i18n.h"
 
 Auditioner::Auditioner (Session& s)
-       : Track (s, "auditioner", Route::Auditioner)
+       : Track (s, "auditioner", PresentationInfo::Auditioner)
        , current_frame (0)
        , _auditioning (0)
        , length (0)
@@ -85,13 +85,17 @@ Auditioner::init ()
 
 Auditioner::~Auditioner ()
 {
+       if (asynth) {
+               asynth->drop_references ();
+       }
+       asynth.reset ();
 }
 
 void
 Auditioner::lookup_synth ()
 {
        string plugin_id = Config->get_midi_audition_synth_uri();
-       asynth = boost::shared_ptr<Processor>();
+       asynth.reset ();
        if (!plugin_id.empty()) {
                boost::shared_ptr<Plugin> p;
                p = find_plugin (_session, plugin_id, ARDOUR::LV2);
@@ -165,20 +169,20 @@ Auditioner::connect ()
                        /* create (and connect) new ports */
 
                        _main_outs->defer_pan_reset ();
-                       
+
                        if (left.length()) {
                                _output->add_port (left, this, DataType::AUDIO);
                        }
-                       
+
                        if (right.length()) {
                                _output->add_port (right, this, DataType::AUDIO);
                        }
-                       
+
                        _main_outs->allow_pan_reset ();
                        _main_outs->reset_panner ();
 
                } else {
-                       
+
                        /* reconnect existing ports */
 
                        boost::shared_ptr<Port> oleft (_output->nth (0));
@@ -190,7 +194,7 @@ Auditioner::connect ()
                                oright->connect (right);
                        }
                }
-                       
+
        }
 
        return 0;
@@ -482,7 +486,7 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
                offset = 0;
        }
 
-       _diskstream->seek (offset);
+       _diskstream->seek (offset, true);
        current_frame = offset;
 
        g_atomic_int_set (&_auditioning, 1);