#include "ardour/midi_region.h"
#include "ardour/plugin.h"
#include "ardour/plugin_insert.h"
+#include "ardour/profile.h"
#include "ardour/region_factory.h"
#include "ardour/route.h"
#include "ardour/session.h"
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);
/* 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));
oright->connect (right);
}
}
-
+
}
return 0;
Track::set_diskstream (ds);
_diskstream->set_track (this);
- _diskstream->set_destructive (_mode == Destructive);
+ if (Profile->get_trx()) {
+ _diskstream->set_destructive (false);
+ } else {
+ _diskstream->set_destructive (_mode == Destructive);
+ }
_diskstream->set_non_layered (_mode == NonLayered);
_diskstream->set_record_enabled (false);
_diskstream->request_input_monitoring (false);
if (!_synth_added && asynth) {
- int rv = add_processor_by_index(asynth, PreFader, &ps, true);
+ int rv = add_processor (asynth, PreFader, &ps, true);
if (rv) {
error << _("Failed to load synth for MIDI-Audition.") << endmsg;
} else {
offset = 0;
}
- _diskstream->seek (offset);
+ _diskstream->seek (offset, true);
current_frame = offset;
g_atomic_int_set (&_auditioning, 1);