2 Copyright (C) 2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 #include "pbd/error.h"
20 #include "ardour/amp.h"
21 #include "ardour/debug.h"
22 #include "ardour/delivery.h"
23 #include "ardour/diskstream.h"
24 #include "ardour/io_processor.h"
25 #include "ardour/meter.h"
26 #include "ardour/playlist.h"
27 #include "ardour/port.h"
28 #include "ardour/processor.h"
29 #include "ardour/route_group_specialized.h"
30 #include "ardour/session.h"
31 #include "ardour/session_playlists.h"
32 #include "ardour/track.h"
33 #include "ardour/utils.h"
38 using namespace ARDOUR;
41 Track::Track (Session& sess, string name, Route::Flag flag, TrackMode mode, DataType default_type)
42 : Route (sess, name, flag, default_type)
43 , _saved_meter_point (_meter_point)
45 , _monitoring (MonitorAuto)
47 _freeze_record.state = NoFreeze;
53 DEBUG_TRACE (DEBUG::Destruction, string_compose ("track %1 destructor\n", _name));
63 boost::shared_ptr<Route> rp (shared_from_this());
64 boost::shared_ptr<Track> rt = boost::dynamic_pointer_cast<Track> (rp);
65 _rec_enable_control = boost::shared_ptr<RecEnableControl> (new RecEnableControl(rt));
66 _rec_enable_control->set_flags (Controllable::Toggle);
67 _monitoring_control.reset (new MonitoringControllable (X_("monitoring"), rt));
69 /* don't add rec_enable_control to controls because we don't want it to
70 * appear as an automatable parameter
72 track_number_changed.connect_same_thread (*this, boost::bind (&Track::resync_track_name, this));
73 _session.config.ParameterChanged.connect_same_thread (*this, boost::bind (&Track::parameter_changed, this, _1));
79 Track::use_new_diskstream ()
81 boost::shared_ptr<Diskstream> ds = create_diskstream ();
83 ds->do_refill_with_alloc ();
84 ds->set_block_size (_session.get_block_size ());
85 ds->playlist()->set_orig_track_id (id());
97 Track::state (bool full)
99 XMLNode& root (Route::state (full));
100 root.add_property (X_("monitoring"), enum_2_string (_monitoring));
101 root.add_property (X_("saved-meter-point"), enum_2_string (_saved_meter_point));
102 root.add_child_nocopy (_rec_enable_control->get_state());
103 root.add_child_nocopy (_diskstream->get_state ());
109 Track::set_state (const XMLNode& node, int version)
111 if (Route::set_state (node, version)) {
117 if (version >= 3000) {
118 if ((child = find_named_node (node, X_("Diskstream"))) != 0) {
119 boost::shared_ptr<Diskstream> ds = diskstream_factory (*child);
120 ds->do_refill_with_alloc ();
126 _diskstream->playlist()->set_orig_track_id (id());
129 /* set rec-enable control *AFTER* setting up diskstream, because it may
130 want to operate on the diskstream as it sets its own state
133 XMLNodeList nlist = node.children();
134 for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
138 if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
139 if (prop->value() == X_("recenable")) {
140 _rec_enable_control->set_state (*child, version);
145 const XMLProperty* prop;
147 if ((prop = node.property (X_("monitoring"))) != 0) {
148 _monitoring = MonitorChoice (string_2_enum (prop->value(), _monitoring));
150 _monitoring = MonitorAuto;
153 if ((prop = node.property (X_("saved-meter-point"))) != 0) {
154 _saved_meter_point = MeterPoint (string_2_enum (prop->value(), _saved_meter_point));
156 _saved_meter_point = _meter_point;
163 Track::get_template ()
165 return state (false);
168 Track::FreezeRecord::~FreezeRecord ()
170 for (vector<FreezeRecordProcessorInfo*>::iterator i = processor_info.begin(); i != processor_info.end(); ++i) {
176 Track::freeze_state() const
178 return _freeze_record.state;
181 Track::RecEnableControl::RecEnableControl (boost::shared_ptr<Track> t)
182 : AutomationControl (t->session(),
184 ParameterDescriptor(Evoral::Parameter(RecEnableAutomation)),
185 boost::shared_ptr<AutomationList>(),
189 boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(RecEnableAutomation)));
194 Track::RecEnableControl::set_value (double val, Controllable::GroupControlDisposition group_override)
197 _set_value (val, group_override);
202 Track::RecEnableControl::set_value_unchecked (double val)
205 _set_value (val, Controllable::NoGroup);
210 Track::RecEnableControl::_set_value (double val, Controllable::GroupControlDisposition group_override)
212 boost::shared_ptr<Track> t = track.lock ();
217 t->set_record_enabled (val >= 0.5 ? true : false, group_override);
221 Track::RecEnableControl::get_value () const
223 boost::shared_ptr<Track> t = track.lock ();
228 return (t->record_enabled() ? 1.0 : 0.0);
232 Track::record_enabled () const
234 return _diskstream && _diskstream->record_enabled ();
240 bool will_record = true;
241 for (PortSet::iterator i = _input->ports().begin(); i != _input->ports().end() && will_record; ++i) {
250 Track::prep_record_enabled (bool yn, Controllable::GroupControlDisposition group_override)
252 if (yn && record_safe ()) {
256 if (!_session.writable()) {
260 if (_freeze_record.state == Frozen) {
264 if (use_group (group_override, &RouteGroup::is_recenable)) {
265 _route_group->apply (&Track::prep_record_enabled, yn, Controllable::NoGroup);
269 /* keep track of the meter point as it was before we rec-enabled */
270 if (!_diskstream->record_enabled()) {
271 _saved_meter_point = _meter_point;
277 will_follow = _diskstream->prep_record_enable ();
279 will_follow = _diskstream->prep_record_disable ();
284 if (_meter_point != MeterCustom) {
285 set_meter_point (MeterInput);
288 set_meter_point (_saved_meter_point);
294 Track::set_record_enabled (bool yn, Controllable::GroupControlDisposition group_override)
296 if (_diskstream->record_safe ()) {
300 if (!_session.writable()) {
304 if (_freeze_record.state == Frozen) {
308 if (use_group (group_override, &RouteGroup::is_recenable)) {
309 _route_group->apply (&Track::set_record_enabled, yn, Controllable::NoGroup);
313 _diskstream->set_record_enabled (yn);
315 _rec_enable_control->Changed ();
319 Track::record_safe () const
321 return _diskstream && _diskstream->record_safe ();
325 Track::set_record_safe (bool yn, Controllable::GroupControlDisposition group_override)
327 if (!_session.writable()) {
331 if (_freeze_record.state == Frozen) {
335 if (use_group (group_override, &RouteGroup::is_recenable)) {
336 _route_group->apply (&Track::set_record_safe, yn, Controllable::NoGroup);
340 _diskstream->set_record_safe (yn);
344 Track::parameter_changed (string const & p)
346 if (p == "track-name-number") {
347 resync_track_name ();
349 else if (p == "track-name-take") {
350 resync_track_name ();
352 else if (p == "take-name") {
353 if (_session.config.get_track_name_take()) {
354 resync_track_name ();
360 Track::resync_track_name ()
366 Track::set_name (const string& str)
370 if (record_enabled() && _session.actively_recording()) {
371 /* this messes things up if done while recording */
375 string diskstream_name = "";
376 if (_session.config.get_track_name_take () && !_session.config.get_take_name ().empty()) {
377 // Note: any text is fine, legalize_for_path() fixes this later
378 diskstream_name += _session.config.get_take_name ();
379 diskstream_name += "_";
381 const int64_t tracknumber = track_number();
382 if (tracknumber > 0 && _session.config.get_track_name_number()) {
383 char num[64], fmt[10];
384 snprintf(fmt, sizeof(fmt), "%%0%d" PRId64, _session.track_number_decimals());
385 snprintf(num, sizeof(num), fmt, tracknumber);
386 diskstream_name += num;
387 diskstream_name += "_";
389 diskstream_name += str;
391 if (diskstream_name == _diskstream_name) {
394 _diskstream_name = diskstream_name;
396 _diskstream->set_write_source_name (diskstream_name);
398 boost::shared_ptr<Track> me = boost::dynamic_pointer_cast<Track> (shared_from_this ());
399 if (_diskstream->playlist()->all_regions_empty () && _session.playlists->playlists_for_track (me).size() == 1) {
400 /* Only rename the diskstream (and therefore the playlist) if
401 a) the playlist has never had a region added to it and
402 b) there is only one playlist for this track.
404 If (a) is not followed, people can get confused if, say,
405 they have notes about a playlist with a given name and then
406 it changes (see mantis #4759).
408 If (b) is not followed, we rename the current playlist and not
409 the other ones, which is a bit confusing (see mantis #4977).
411 _diskstream->set_name (str);
414 /* save state so that the statefile fully reflects any filename changes */
416 if ((ret = Route::set_name (str)) == 0) {
417 _session.save_state ("");
424 Track::set_latency_compensation (framecnt_t longest_session_latency)
426 Route::set_latency_compensation (longest_session_latency);
427 _diskstream->set_roll_delay (_roll_delay);
431 Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool session_state_changing)
433 Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
439 bool can_record = _session.actively_recording ();
441 /* no outputs? nothing to do ... what happens if we have sends etc. ? */
443 if (n_outputs().n_total() == 0) {
447 /* not active ... do the minimum possible by just outputting silence */
451 if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
457 if (session_state_changing) {
458 if (_session.transport_speed() != 0.0f) {
459 /* we're rolling but some state is changing (e.g. our diskstream contents)
460 so we cannot use them. Be silent till this is over. Don't declick.
462 XXX note the absurdity of ::no_roll() being called when we ARE rolling!
464 passthru_silence (start_frame, end_frame, nframes, 0);
467 /* we're really not rolling, so we're either delivery silence or actually
468 monitoring, both of which are safe to do while session_state_changing is true.
472 _diskstream->check_record_status (start_frame, can_record);
476 MonitorState const s = monitoring_state ();
477 /* we are not rolling, so be silent even if we are monitoring disk, as there
478 will be no disk data coming in.
481 case MonitoringSilence:
487 case MonitoringInput:
495 //if we have an internal generator, let it play regardless of monitoring state
496 if (_have_internal_generator) {
500 _amp->apply_gain_automation (false);
502 /* if have_internal_generator, or .. */
506 if (_meter_point == MeterInput) {
507 /* still need input monitoring and metering */
509 bool const track_rec = _diskstream->record_enabled ();
510 bool const auto_input = _session.config.get_auto_input ();
511 bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring;
512 bool const tape_machine_mode = Config->get_tape_machine_mode ();
513 bool no_meter = false;
515 /* this needs a proper K-map
516 * and should be separated into a function similar to monitoring_state()
517 * that also handles roll() states in audio_track.cc, midi_track.cc and route.cc
519 * see http://www.oofus.co.uk/ardour/Ardour3MonitorModesV3.pdf
521 if (!auto_input && !track_rec) {
524 else if (tape_machine_mode && !track_rec && auto_input) {
527 else if (!software_monitor && tape_machine_mode && !track_rec) {
530 else if (!software_monitor && !tape_machine_mode && !track_rec && !auto_input) {
535 BufferSet& bufs (_session.get_silent_buffers (n_process_buffers()));
536 _meter->run (bufs, 0, 0, nframes, true);
537 _input->process_input (boost::shared_ptr<Processor>(), start_frame, end_frame, nframes);
539 _input->process_input (_meter, start_frame, end_frame, nframes);
543 passthru_silence (start_frame, end_frame, nframes, 0);
547 BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
549 fill_buffers_with_input (bufs, _input, nframes);
551 if (_meter_point == MeterInput) {
552 _meter->run (bufs, start_frame, end_frame, nframes, true);
555 passthru (bufs, start_frame, end_frame, nframes, false);
558 for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
559 boost::shared_ptr<Delivery> d = boost::dynamic_pointer_cast<Delivery> (*i);
561 d->flush_buffers (nframes);
569 Track::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/, bool& need_butler)
571 Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
573 framecnt_t playback_distance = _diskstream->calculate_playback_distance(nframes);
574 if (can_internal_playback_seek(playback_distance)) {
575 internal_playback_seek(playback_distance);
580 if (n_outputs().n_total() == 0 && _processors.empty()) {
590 _amp->apply_gain_automation(false);
594 framecnt_t playback_distance;
596 BufferSet& bufs (_session.get_route_buffers (n_process_buffers(), true));
598 int const dret = _diskstream->process (bufs, _session.transport_frame(), nframes, playback_distance, false);
599 need_butler = _diskstream->commit (playback_distance);
604 Track::set_diskstream (boost::shared_ptr<Diskstream> ds)
608 ds->PlaylistChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_playlist_changed, this));
609 diskstream_playlist_changed ();
610 ds->RecordEnableChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_record_enable_changed, this));
611 ds->RecordSafeChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_record_safe_changed, this));
612 ds->SpeedChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_speed_changed, this));
613 ds->AlignmentStyleChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_alignment_style_changed, this));
617 Track::diskstream_playlist_changed ()
619 PlaylistChanged (); /* EMIT SIGNAL */
623 Track::diskstream_record_enable_changed ()
625 RecordEnableChanged (); /* EMIT SIGNAL */
629 Track::diskstream_record_safe_changed ()
631 RecordSafeChanged (); /* EMIT SIGNAL */
635 Track::diskstream_speed_changed ()
637 SpeedChanged (); /* EMIT SIGNAL */
641 Track::diskstream_alignment_style_changed ()
643 AlignmentStyleChanged (); /* EMIT SIGNAL */
646 boost::shared_ptr<Playlist>
649 return _diskstream->playlist ();
653 Track::request_input_monitoring (bool m)
655 _diskstream->request_input_monitoring (m);
659 Track::ensure_input_monitoring (bool m)
661 _diskstream->ensure_input_monitoring (m);
665 Track::destructive () const
667 return _diskstream->destructive ();
670 list<boost::shared_ptr<Source> > &
671 Track::last_capture_sources ()
673 return _diskstream->last_capture_sources ();
677 Track::set_capture_offset ()
679 _diskstream->set_capture_offset ();
683 Track::steal_write_source_name()
685 return _diskstream->steal_write_source_name ();
689 Track::reset_write_sources (bool r, bool force)
691 _diskstream->reset_write_sources (r, force);
695 Track::playback_buffer_load () const
697 return _diskstream->playback_buffer_load ();
701 Track::capture_buffer_load () const
703 return _diskstream->capture_buffer_load ();
709 return _diskstream->do_refill ();
713 Track::do_flush (RunContext c, bool force)
715 return _diskstream->do_flush (c, force);
719 Track::set_pending_overwrite (bool o)
721 _diskstream->set_pending_overwrite (o);
725 Track::seek (framepos_t p, bool complete_refill)
727 return _diskstream->seek (p, complete_refill);
731 Track::hidden () const
733 return _diskstream->hidden ();
737 Track::can_internal_playback_seek (framecnt_t p)
739 return _diskstream->can_internal_playback_seek (p);
743 Track::internal_playback_seek (framecnt_t p)
745 return _diskstream->internal_playback_seek (p);
749 Track::non_realtime_input_change ()
751 _diskstream->non_realtime_input_change ();
755 Track::non_realtime_locate (framepos_t p)
757 Route::non_realtime_locate (p);
760 /* don't waste i/o cycles and butler calls
761 for hidden (secret) tracks
763 _diskstream->non_realtime_locate (p);
768 Track::non_realtime_set_speed ()
770 _diskstream->non_realtime_set_speed ();
774 Track::overwrite_existing_buffers ()
776 return _diskstream->overwrite_existing_buffers ();
780 Track::get_captured_frames (uint32_t n) const
782 return _diskstream->get_captured_frames (n);
786 Track::set_loop (Location* l)
788 return _diskstream->set_loop (l);
792 Track::transport_looped (framepos_t p)
794 _diskstream->transport_looped (p);
798 Track::realtime_set_speed (double s, bool g)
800 return _diskstream->realtime_set_speed (s, g);
804 Track::transport_stopped_wallclock (struct tm & n, time_t t, bool g)
806 _diskstream->transport_stopped_wallclock (n, t, g);
810 Track::pending_overwrite () const
812 return _diskstream->pending_overwrite ();
816 Track::speed () const
818 return _diskstream->speed ();
822 Track::prepare_to_stop (framepos_t t, framepos_t a)
824 _diskstream->prepare_to_stop (t, a);
828 Track::set_slaved (bool s)
830 _diskstream->set_slaved (s);
836 return _diskstream->n_channels ();
840 Track::get_capture_start_frame (uint32_t n) const
842 return _diskstream->get_capture_start_frame (n);
846 Track::alignment_style () const
848 return _diskstream->alignment_style ();
852 Track::alignment_choice () const
854 return _diskstream->alignment_choice ();
858 Track::current_capture_start () const
860 return _diskstream->current_capture_start ();
864 Track::current_capture_end () const
866 return _diskstream->current_capture_end ();
870 Track::playlist_modified ()
872 _diskstream->playlist_modified ();
876 Track::use_playlist (boost::shared_ptr<Playlist> p)
878 int ret = _diskstream->use_playlist (p);
880 p->set_orig_track_id (id());
886 Track::use_copy_playlist ()
888 int ret = _diskstream->use_copy_playlist ();
891 _diskstream->playlist()->set_orig_track_id (id());
898 Track::use_new_playlist ()
900 int ret = _diskstream->use_new_playlist ();
903 _diskstream->playlist()->set_orig_track_id (id());
910 Track::set_align_style (AlignStyle s, bool force)
912 _diskstream->set_align_style (s, force);
916 Track::set_align_choice (AlignChoice s, bool force)
918 _diskstream->set_align_choice (s, force);
922 Track::using_diskstream_id (PBD::ID id) const
924 return (id == _diskstream->id ());
928 Track::set_block_size (pframes_t n)
930 Route::set_block_size (n);
931 _diskstream->set_block_size (n);
935 Track::adjust_playback_buffering ()
938 _diskstream->adjust_playback_buffering ();
943 Track::adjust_capture_buffering ()
946 _diskstream->adjust_capture_buffering ();
950 #ifdef USE_TRACKS_CODE_FEATURES
952 /* This is the Tracks version of Track::monitoring_state().
954 * Ardour developers: try to flag or fix issues if parts of the libardour API
955 * change in ways that invalidate this
959 Track::monitoring_state () const
961 /* Explicit requests */
963 if (_monitoring & MonitorInput) {
964 return MonitoringInput;
967 if (_monitoring & MonitorDisk) {
968 return MonitoringDisk;
971 /* This is an implementation of the truth table in doc/monitor_modes.pdf;
972 I don't think it's ever going to be too pretty too look at.
975 // GZ: NOT USED IN TRACKS
976 //bool const auto_input = _session.config.get_auto_input ();
977 //bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring;
978 //bool const tape_machine_mode = Config->get_tape_machine_mode ();
980 bool const roll = _session.transport_rolling ();
981 bool const track_rec = _diskstream->record_enabled ();
982 bool session_rec = _session.actively_recording ();
986 if (!session_rec && roll) {
987 return MonitoringDisk;
989 return MonitoringInput;
995 return MonitoringDisk;
999 return MonitoringSilence;
1004 /* This is the Ardour/Mixbus version of Track::monitoring_state().
1006 * Tracks developers: do NOT modify this method under any circumstances.
1010 Track::monitoring_state () const
1012 /* Explicit requests */
1014 if (_monitoring & MonitorInput) {
1015 return MonitoringInput;
1018 if (_monitoring & MonitorDisk) {
1019 return MonitoringDisk;
1022 /* This is an implementation of the truth table in doc/monitor_modes.pdf;
1023 I don't think it's ever going to be too pretty too look at.
1026 bool const roll = _session.transport_rolling ();
1027 bool const track_rec = _diskstream->record_enabled ();
1028 bool const auto_input = _session.config.get_auto_input ();
1029 bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring;
1030 bool const tape_machine_mode = Config->get_tape_machine_mode ();
1033 /* I suspect that just use actively_recording() is good enough all the
1034 * time, but just to keep the semantics the same as they were before
1035 * sept 26th 2012, we differentiate between the cases where punch is
1036 * enabled and those where it is not.
1039 if (_session.config.get_punch_in() || _session.config.get_punch_out()) {
1040 session_rec = _session.actively_recording ();
1042 session_rec = _session.get_record_enabled();
1047 if (!session_rec && roll && auto_input) {
1048 return MonitoringDisk;
1050 return software_monitor ? MonitoringInput : MonitoringSilence;
1055 if (tape_machine_mode) {
1057 return MonitoringDisk;
1061 if (!roll && auto_input) {
1062 return software_monitor ? MonitoringInput : MonitoringSilence;
1064 return MonitoringDisk;
1070 abort(); /* NOTREACHED */
1071 return MonitoringSilence;
1077 Track::maybe_declick (BufferSet& bufs, framecnt_t nframes, int declick)
1079 /* never declick if there is an internal generator - we just want it to
1080 keep generating sound without interruption.
1082 ditto if we are monitoring inputs.
1085 if (_have_internal_generator || monitoring_choice() == MonitorInput) {
1090 declick = _pending_declick;
1094 Amp::declick (bufs, nframes, declick);
1099 Track::check_initial_delay (framecnt_t nframes, framepos_t& transport_frame)
1101 if (_roll_delay > nframes) {
1103 _roll_delay -= nframes;
1104 silence_unlocked (nframes);
1105 /* transport frame is not legal for caller to use */
1108 } else if (_roll_delay > 0) {
1110 nframes -= _roll_delay;
1111 silence_unlocked (_roll_delay);
1112 transport_frame += _roll_delay;
1114 /* shuffle all the port buffers for things that lead "out" of this Route
1115 to reflect that we just wrote _roll_delay frames of silence.
1118 Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
1119 for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
1120 boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i);
1122 iop->increment_port_buffer_offset (_roll_delay);
1125 _output->increment_port_buffer_offset (_roll_delay);
1135 Track::set_monitoring (MonitorChoice mc, Controllable::GroupControlDisposition gcd)
1137 if (use_group (gcd, &RouteGroup::is_monitoring)) {
1138 _route_group->apply (&Track::set_monitoring, mc, Controllable::NoGroup);
1142 if (mc != _monitoring) {
1145 for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
1146 (*i)->monitoring_changed ();
1149 MonitoringChanged (); /* EMIT SIGNAL */
1150 _monitoring_control->Changed (); /* EMIT SIGNAL */
1155 Track::metering_state () const
1158 if (_session.transport_rolling ()) {
1159 // audio_track.cc || midi_track.cc roll() runs meter IFF:
1160 rv = _meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled());
1162 // track no_roll() always metering if
1163 rv = _meter_point == MeterInput;
1165 return rv ? MeteringInput : MeteringRoute;
1168 Track::MonitoringControllable::MonitoringControllable (std::string name, boost::shared_ptr<Track> r)
1169 : RouteAutomationControl (name, MonitoringAutomation, boost::shared_ptr<AutomationList>(), r)
1171 boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(MonitoringAutomation)));
1172 gl->set_interpolation(Evoral::ControlList::Discrete);
1177 Track::MonitoringControllable::set_value (double val, Controllable::GroupControlDisposition gcd)
1179 _set_value (val, gcd);
1183 Track::MonitoringControllable::_set_value (double val, Controllable::GroupControlDisposition gcd)
1185 boost::shared_ptr<Route> r = _route.lock();
1190 boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (r);
1197 if (mc < MonitorAuto || mc > MonitorDisk) {
1201 /* no group effect at present */
1203 t->set_monitoring ((MonitorChoice) mc, gcd);
1207 Track::MonitoringControllable::get_value () const
1209 boost::shared_ptr<Route> r = _route.lock();
1214 boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (r);
1219 return t->monitoring_choice();