Match request in function names to the eventual call to jack_port_request_monitor.
[ardour.git] / libs / ardour / audio_diskstream.cc
index 77c0ac94324cac3318d6462f410cf6873987f1e2..f096a463efe421d2538c4b90124523319777f857 100644 (file)
@@ -281,7 +281,6 @@ AudioDiskstream::use_new_playlist ()
 
        if ((playlist = boost::dynamic_pointer_cast<AudioPlaylist> (PlaylistFactory::create (DataType::AUDIO, _session, newname, hidden()))) != 0) {
 
-               playlist->set_orig_diskstream_id (id());
                return use_playlist (playlist);
 
        } else {
@@ -309,7 +308,6 @@ AudioDiskstream::use_copy_playlist ()
        newname = Playlist::bump_name (_playlist->name(), _session);
 
        if ((playlist = boost::dynamic_pointer_cast<AudioPlaylist>(PlaylistFactory::create (audio_playlist(), newname))) != 0) {
-               playlist->set_orig_diskstream_id (id());
                return use_playlist (playlist);
        } else {
                return -1;
@@ -415,18 +413,17 @@ AudioDiskstream::prepare_record_status(framepos_t capture_start_frame)
  *      that someone can read playback_distance worth of data from.
  */
 int
-AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& need_butler)
+AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecnt_t& playback_distance)
 {
        uint32_t n;
        boost::shared_ptr<ChannelList> c = channels.reader();
        ChannelList::iterator chan;
-       int ret = -1;
        framecnt_t rec_offset = 0;
        framecnt_t rec_nframes = 0;
        bool collect_playback = false;
        bool can_record = _session.actively_recording ();
 
-       framecnt_t playback_distance = 0;
+       playback_distance = 0;
 
        if (!_io || !_io->active()) {
                return 0;
@@ -511,7 +508,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n
 
                                if (rec_nframes > total) {
                                        DiskOverrun ();
-                                       goto out;
+                                       return -1;
                                }
 
                                boost::shared_ptr<AudioPort> const ap = _io->audio (n);
@@ -617,7 +614,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n
                                        cerr << _name << " Need " << necessary_samples << " total = " << total << endl;
                                        cerr << "underrun for " << _name << endl;
                                        DiskUnderrun ();
-                                       goto out;
+                                       return -1;
 
                                } else {
 
@@ -663,16 +660,13 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n
                _speed = _target_speed;
        }
 
-       ret = 0;
-
-       if (commit (playback_distance)) {
-               need_butler = true;
-       }
-
-  out:
-       return ret;
+       return 0;
 }
 
+/** Update various things including playback_sample, read pointer on each channel's playback_buf
+ *  and write pointer on each channel's capture_buf.  Also wout whether the butler is needed.
+ *  @return true if the butler is required.
+ */
 bool
 AudioDiskstream::commit (framecnt_t playback_distance)
 {
@@ -1692,7 +1686,7 @@ AudioDiskstream::engage_record_enable ()
        if (Config->get_monitoring_model() == HardwareMonitoring) {
 
                for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
-                       (*chan)->source.ensure_monitor_input (!(_session.config.get_auto_input() && rolling));
+                       (*chan)->source.request_jack_monitors_input (!(_session.config.get_auto_input() && rolling));
                        capturing_sources.push_back ((*chan)->write_source);
                        (*chan)->write_source->mark_streaming_write_started ();
                }
@@ -1714,7 +1708,7 @@ AudioDiskstream::disengage_record_enable ()
        boost::shared_ptr<ChannelList> c = channels.reader();
        if (Config->get_monitoring_model() == HardwareMonitoring) {
                for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
-                       (*chan)->source.ensure_monitor_input (false);
+                       (*chan)->source.request_jack_monitors_input (false);
                }
        }
        capturing_sources.clear ();
@@ -1984,7 +1978,7 @@ AudioDiskstream::monitor_input (bool yn)
        boost::shared_ptr<ChannelList> c = channels.reader();
 
        for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
-               (*chan)->source.ensure_monitor_input (yn);
+               (*chan)->source.request_jack_monitors_input (yn);
        }
 }
 
@@ -2307,13 +2301,13 @@ AudioDiskstream::ChannelSource::is_physical () const
 }
 
 void
-AudioDiskstream::ChannelSource::ensure_monitor_input (bool yn) const
+AudioDiskstream::ChannelSource::request_jack_monitors_input (bool yn) const
 {
        if (name.empty()) {
                return;
        }
 
-       return AudioEngine::instance()->ensure_monitor_input (name, yn);
+       return AudioEngine::instance()->request_jack_monitors_input (name, yn);
 }
 
 AudioDiskstream::ChannelInfo::ChannelInfo (framecnt_t playback_bufsize, framecnt_t capture_bufsize, framecnt_t speed_size, framecnt_t wrap_size)