+ if (_output->n_ports().n_audio() == 0) {
+
+ /* 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));
+ boost::shared_ptr<Port> oright (_output->nth (1));
+ if (oleft) {
+ oleft->connect (left);
+ }
+ if (oright) {
+ oright->connect (right);
+ }
+ }
+
+ }
+
+ return 0;
+}
+
+AudioPlaylist&
+Auditioner::prepare_playlist ()
+{
+ // FIXME auditioner is still audio-only
+ boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(_diskstream->playlist());
+ assert(apl);
+
+ apl->clear ();
+ return *apl;