-
-int
-Auditioner::roll_audio (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler) {
- Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
- if (!lm.locked()) {
- return 0;
- }
-
- assert(n_outputs().n_total() > 0);
- assert(_active);
-
- int dret;
- framecnt_t playback_distance;
- framepos_t transport_frame = _session.transport_frame();
- boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
- BufferSet& bufs = _session.get_route_buffers (n_process_buffers ());
-
- _silent = false;
- _amp->apply_gain_automation(false);
-
- if ((dret = diskstream->process (bufs, transport_frame, nframes, playback_distance, (monitoring_state() == MonitoringDisk))) != 0) {
- need_butler = diskstream->commit (playback_distance);
- silence (nframes);
- return dret;
- }
-
- process_output_buffers (bufs, start_frame, end_frame, nframes, declick, (!diskstream->record_enabled() && _session.transport_rolling()));
- need_butler = diskstream->commit (playback_distance);
- return 0;
-}
-
-void
-Auditioner::set_diskstream (boost::shared_ptr<Diskstream> ds)
-{
- Track::set_diskstream (ds);
-
- _diskstream->set_track (this);
- 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);
-
- DiskstreamChanged (); /* EMIT SIGNAL */
-}
-
-AudioPlaylist&
-Auditioner::prepare_playlist ()
-{
- // used by CrossfadeEditor::audition()
-
- _midi_audition = false;
- set_diskstream(_diskstream_audio);
- if (_synth_added) {
- remove_processor(asynth);
- _synth_added = false;
- }
-
- // FIXME auditioner is still audio-only
- boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(_diskstream->playlist());
- assert(apl);
-
- apl->clear ();
- return *apl;
-}
-