if (Track::init ()) {
return -1;
}
+
+ if (connect ()) {
+ return -1;
+ }
+
+ _output->changed.connect_same_thread (*this, boost::bind (&Auditioner::output_changed, this, _1, _2));
+
+ return 0;
+}
+
+Auditioner::~Auditioner ()
+{
+}
+int
+Auditioner::connect ()
+{
string left = Config->get_auditioner_output_left();
string right = Config->get_auditioner_output_right();
vector<string> outputs;
_session.engine().get_physical_outputs (DataType::AUDIO, outputs);
+ via_monitor = false;
+
if (left.empty() || left == "default") {
if (_session.monitor_out()) {
left = _session.monitor_out()->input()->audio (0)->name();
}
}
+ _output->disconnect (this);
+
if (left.empty() && right.empty()) {
- warning << _("no outputs available for auditioner - manual connection required") << endmsg;
+ if (_output->n_ports().n_audio() == 0) {
+ /* ports not set up, so must be during startup */
+ warning << _("no outputs available for auditioner - manual connection required") << endmsg;
+ }
} else {
- _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 ();
- }
+ if (_output->n_ports().n_audio() == 0) {
- _output->changed.connect_same_thread (*this, boost::bind (&Auditioner::output_changed, this, _1, _2));
+ /* create (and connect) new ports */
- return 0;
-}
+ _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 ();
-Auditioner::~Auditioner ()
-{
+ } else {
+
+ /* reconnect existing ports */
+
+ boost::shared_ptr<Port> oleft (_output->nth (0));
+ boost::shared_ptr<Port> oright (_output->nth (1));
+ if (oleft) {
+ oleft->connect (left);
+ }
+ if (oright) {
+ oright->connect (right);
+ }
+ }
+
+ }
+
+ return 0;
}
AudioPlaylist&
/* force reversion to Solo-In-Place */
Config->set_solo_control_is_listen_control (false);
+ /* if we are auditioning, cancel it ... this is a workaround
+ to a problem (auditioning does not execute the process graph,
+ which is needed to remove routes when using >1 core for processing)
+ */
+ cancel_audition ();
+
{
/* Hold process lock while doing this so that we don't hear bits and
* pieces of audio as we work on each route.
remove_route (_monitor_out);
auto_connect_master_bus ();
+
+ if (auditioner) {
+ auditioner->connect ();
+ }
}
void
(*x)->enable_monitor_send ();
}
}
+
+ if (auditioner) {
+ auditioner->connect ();
+ }
}
void
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ArdourMIDIBindings version="1.0.0" name="M-Audio Oxygen25 (factory default)">
+ <Binding msg="bf 71 7f" function="loop-toggle"/>
+ <Binding msg="bf 72 7f" function="transport-start"/>
+ <Binding msg="bf 73 7f" function="transport-end"/>
+ <Binding msg="bf 74 7f" function="transport-stop"/>
+ <Binding msg="bf 75 7f" function="transport-roll"/>
+ <Binding msg="bf 76 7f" action="Transport/record-roll"/>
+</ArdourMIDIBindings>
+