ardour
track.cc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006 Paul Davis
3 
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.
8 
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.
13 
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.
17 */
18 #include "pbd/error.h"
19 
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"
30 #include "ardour/session.h"
32 #include "ardour/track.h"
33 #include "ardour/utils.h"
34 
35 #include "i18n.h"
36 
37 using namespace std;
38 using namespace ARDOUR;
39 using namespace PBD;
40 
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)
44  , _mode (mode)
45  , _monitoring (MonitorAuto)
46 {
48  _declickable = true;
49 }
50 
52 {
53  DEBUG_TRACE (DEBUG::Destruction, string_compose ("track %1 destructor\n", _name));
54 }
55 
56 int
58 {
59  if (Route::init ()) {
60  return -1;
61  }
62 
63  boost::shared_ptr<Route> rp (shared_from_this());
66  _rec_enable_control->set_flags (Controllable::Toggle);
67 
68  /* don't add rec_enable_control to controls because we don't want it to
69  * appear as an automatable parameter
70  */
71  track_number_changed.connect_same_thread (*this, boost::bind (&Track::resync_track_name, this));
72  _session.config.ParameterChanged.connect_same_thread (*this, boost::bind (&Track::parameter_changed, this, _1));
73 
74  return 0;
75 }
76 
77 void
79 {
81 
82  ds->do_refill_with_alloc ();
84  ds->playlist()->set_orig_track_id (id());
85 
86  set_diskstream (ds);
87 }
88 
89 XMLNode&
91 {
92  return state (true);
93 }
94 
95 XMLNode&
96 Track::state (bool full)
97 {
98  XMLNode& root (Route::state (full));
99  root.add_property (X_("monitoring"), enum_2_string (_monitoring));
100  root.add_property (X_("saved-meter-point"), enum_2_string (_saved_meter_point));
101  root.add_child_nocopy (_rec_enable_control->get_state());
102  root.add_child_nocopy (_diskstream->get_state ());
103 
104  return root;
105 }
106 
107 int
108 Track::set_state (const XMLNode& node, int version)
109 {
110  if (Route::set_state (node, version)) {
111  return -1;
112  }
113 
114  XMLNode* child;
115 
116  if (version >= 3000) {
117  if ((child = find_named_node (node, X_("Diskstream"))) != 0) {
119  ds->do_refill_with_alloc ();
120  set_diskstream (ds);
121  }
122  }
123 
124  if (_diskstream) {
125  _diskstream->playlist()->set_orig_track_id (id());
126  }
127 
128  /* set rec-enable control *AFTER* setting up diskstream, because it may
129  want to operate on the diskstream as it sets its own state
130  */
131 
132  XMLNodeList nlist = node.children();
133  for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
134  child = *niter;
135 
136  XMLProperty* prop;
137  if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
138  if (prop->value() == X_("recenable")) {
139  _rec_enable_control->set_state (*child, version);
140  }
141  }
142  }
143 
144  const XMLProperty* prop;
145 
146  if ((prop = node.property (X_("monitoring"))) != 0) {
148  } else {
150  }
151 
152  if ((prop = node.property (X_("saved-meter-point"))) != 0) {
154  } else {
156  }
157 
158  return 0;
159 }
160 
161 XMLNode&
163 {
164  return state (false);
165 }
166 
168 {
169  for (vector<FreezeRecordProcessorInfo*>::iterator i = processor_info.begin(); i != processor_info.end(); ++i) {
170  delete *i;
171  }
172 }
173 
176 {
177  return _freeze_record.state;
178 }
179 
181  : AutomationControl (t->session(),
184  boost::shared_ptr<AutomationList>(),
185  X_("recenable"))
186  , track (t)
187 {
189  set_list (gl);
190 }
191 
192 void
194 {
195  boost::shared_ptr<Track> t = track.lock ();
196  if (!t) {
197  return;
198  }
199 
200  t->set_record_enabled (val >= 0.5 ? true : false, this);
201 }
202 
203 double
205 {
206  boost::shared_ptr<Track> t = track.lock ();
207  if (!t) {
208  return 0;
209  }
210 
211  return (t->record_enabled() ? 1.0 : 0.0);
212 }
213 
214 bool
216 {
217  return _diskstream && _diskstream->record_enabled ();
218 }
219 
220 bool
222 {
223  bool will_record = true;
224  for (PortSet::iterator i = _input->ports().begin(); i != _input->ports().end() && will_record; ++i) {
225  if (!i->connected())
226  will_record = false;
227  }
228 
229  return will_record;
230 }
231 
232 void
233 Track::prep_record_enabled (bool yn, void *src)
234 {
235  if (!_session.writable()) {
236  return;
237  }
238 
239  if (_freeze_record.state == Frozen) {
240  return;
241  }
242 
245  return;
246  }
247 
248  /* keep track of the meter point as it was before we rec-enabled */
249  if (!_diskstream->record_enabled()) {
251  }
252 
253  bool will_follow;
254 
255  if (yn) {
256  will_follow = _diskstream->prep_record_enable ();
257  } else {
258  will_follow = _diskstream->prep_record_disable ();
259  }
260 
261  if (will_follow) {
262  if (yn) {
263  if (_meter_point != MeterCustom) {
265  }
266  } else {
268  }
269  }
270 }
271 
272 void
273 Track::set_record_enabled (bool yn, void *src)
274 {
275  if (!_session.writable()) {
276  return;
277  }
278 
279  if (_freeze_record.state == Frozen) {
280  return;
281  }
282 
285  return;
286  }
287 
288  _diskstream->set_record_enabled (yn);
289 
290  _rec_enable_control->Changed ();
291 }
292 
293 void
294 Track::parameter_changed (string const & p)
295 {
296  if (p == "track-name-number") {
298  }
299  else if (p == "track-name-take") {
301  }
302  else if (p == "take-name") {
303  if (_session.config.get_track_name_take()) {
305  }
306  }
307 }
308 
309 void
311 {
312  set_name(name());
313 }
314 
315 bool
316 Track::set_name (const string& str)
317 {
318  bool ret;
319 
321  /* this messes things up if done while recording */
322  return false;
323  }
324 
325  string diskstream_name = "";
326  if (_session.config.get_track_name_take () && !_session.config.get_take_name ().empty()) {
327  // Note: any text is fine, legalize_for_path() fixes this later
328  diskstream_name += _session.config.get_take_name ();
329  diskstream_name += "_";
330  }
331  const int64_t tracknumber = track_number();
332  if (tracknumber > 0 && _session.config.get_track_name_number()) {
333  char num[64], fmt[10];
334  snprintf(fmt, sizeof(fmt), "%%0%d" PRId64, _session.track_number_decimals());
335  snprintf(num, sizeof(num), fmt, tracknumber);
336  diskstream_name += num;
337  diskstream_name += "_";
338  }
339  diskstream_name += str;
340 
341  if (diskstream_name == _diskstream_name) {
342  return true;
343  }
344  _diskstream_name = diskstream_name;
345 
346  _diskstream->set_write_source_name (diskstream_name);
347 
348  boost::shared_ptr<Track> me = boost::dynamic_pointer_cast<Track> (shared_from_this ());
349  if (_diskstream->playlist()->all_regions_empty () && _session.playlists->playlists_for_track (me).size() == 1) {
350  /* Only rename the diskstream (and therefore the playlist) if
351  a) the playlist has never had a region added to it and
352  b) there is only one playlist for this track.
353 
354  If (a) is not followed, people can get confused if, say,
355  they have notes about a playlist with a given name and then
356  it changes (see mantis #4759).
357 
358  If (b) is not followed, we rename the current playlist and not
359  the other ones, which is a bit confusing (see mantis #4977).
360  */
361  _diskstream->set_name (str);
362  }
363 
364  /* save state so that the statefile fully reflects any filename changes */
365 
366  if ((ret = Route::set_name (str)) == 0) {
367  _session.save_state ("");
368  }
369 
370  return ret;
371 }
372 
373 void
375 {
376  Route::set_latency_compensation (longest_session_latency);
377  _diskstream->set_roll_delay (_roll_delay);
378 }
379 
380 int
381 Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool session_state_changing)
382 {
383  Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
384 
385  if (!lm.locked()) {
386  return 0;
387  }
388 
390 
391  /* no outputs? nothing to do ... what happens if we have sends etc. ? */
392 
393  if (n_outputs().n_total() == 0) {
394  return 0;
395  }
396 
397  /* not active ... do the minimum possible by just outputting silence */
398 
399  if (!_active) {
400  silence (nframes);
401  if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
402  _meter->reset();
403  }
404  return 0;
405  }
406 
407  if (session_state_changing) {
408  if (_session.transport_speed() != 0.0f) {
409  /* we're rolling but some state is changing (e.g. our diskstream contents)
410  so we cannot use them. Be silent till this is over. Don't declick.
411 
412  XXX note the absurdity of ::no_roll() being called when we ARE rolling!
413  */
414  passthru_silence (start_frame, end_frame, nframes, 0);
415  return 0;
416  }
417  /* we're really not rolling, so we're either delivery silence or actually
418  monitoring, both of which are safe to do while session_state_changing is true.
419  */
420  }
421 
422  _diskstream->check_record_status (start_frame, can_record);
423 
424  bool be_silent;
425 
426  MonitorState const s = monitoring_state ();
427  /* we are not rolling, so be silent even if we are monitoring disk, as there
428  will be no disk data coming in.
429  */
430  switch (s) {
431  case MonitoringSilence:
432  be_silent = true;
433  break;
434  case MonitoringDisk:
435  be_silent = true;
436  break;
437  case MonitoringInput:
438  be_silent = false;
439  break;
440  default:
441  be_silent = false;
442  break;
443  }
444 
445  //if we have an internal generator, let it play regardless of monitoring state
447  be_silent = false;
448  }
449 
450  _amp->apply_gain_automation (false);
451 
452  /* if have_internal_generator, or .. */
453 
454  if (be_silent) {
455 
456  if (_meter_point == MeterInput) {
457  /* still need input monitoring and metering */
458 
459  bool const track_rec = _diskstream->record_enabled ();
460  bool const auto_input = _session.config.get_auto_input ();
461  bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring;
462  bool const tape_machine_mode = Config->get_tape_machine_mode ();
463  bool no_meter = false;
464 
465  /* this needs a proper K-map
466  * and should be separated into a function similar to monitoring_state()
467  * that also handles roll() states in audio_track.cc, midi_track.cc and route.cc
468  *
469  * see http://www.oofus.co.uk/ardour/Ardour3MonitorModesV3.pdf
470  */
471  if (!auto_input && !track_rec) {
472  no_meter=true;
473  }
474  else if (tape_machine_mode && !track_rec && auto_input) {
475  no_meter=true;
476  }
477  else if (!software_monitor && tape_machine_mode && !track_rec) {
478  no_meter=true;
479  }
480  else if (!software_monitor && !tape_machine_mode && !track_rec && !auto_input) {
481  no_meter=true;
482  }
483 
484  if (no_meter) {
486  _meter->run (bufs, 0, 0, nframes, true);
487  _input->process_input (boost::shared_ptr<Processor>(), start_frame, end_frame, nframes);
488  } else {
489  _input->process_input (_meter, start_frame, end_frame, nframes);
490  }
491  }
492 
493  passthru_silence (start_frame, end_frame, nframes, 0);
494 
495  } else {
496 
498 
499  fill_buffers_with_input (bufs, _input, nframes);
500 
501  if (_meter_point == MeterInput) {
502  _meter->run (bufs, start_frame, end_frame, nframes, true);
503  }
504 
505  passthru (bufs, start_frame, end_frame, nframes, false);
506  }
507 
508  for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
510  if (d) {
511  d->flush_buffers (nframes);
512  }
513  }
514 
515  return 0;
516 }
517 
518 int
519 Track::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/, bool& need_butler)
520 {
521  Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
522  if (!lm.locked()) {
523  framecnt_t playback_distance = _diskstream->calculate_playback_distance(nframes);
524  if (can_internal_playback_seek(playback_distance)) {
525  internal_playback_seek(playback_distance);
526  }
527  return 0;
528  }
529 
530  if (n_outputs().n_total() == 0 && _processors.empty()) {
531  return 0;
532  }
533 
534  if (!_active) {
535  silence (nframes);
536  return 0;
537  }
538 
539  _silent = true;
540  _amp->apply_gain_automation(false);
541 
542  silence (nframes);
543 
544  framecnt_t playback_distance;
545 
547 
548  int const dret = _diskstream->process (bufs, _session.transport_frame(), nframes, playback_distance, false);
549  need_butler = _diskstream->commit (playback_distance);
550  return dret;
551 }
552 
553 void
555 {
556  _diskstream = ds;
557 
558  ds->PlaylistChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_playlist_changed, this));
560  ds->RecordEnableChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_record_enable_changed, this));
561  ds->SpeedChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_speed_changed, this));
562  ds->AlignmentStyleChanged.connect_same_thread (*this, boost::bind (&Track::diskstream_alignment_style_changed, this));
563 }
564 
565 void
567 {
568  PlaylistChanged (); /* EMIT SIGNAL */
569 }
570 
571 void
573 {
574  RecordEnableChanged (); /* EMIT SIGNAL */
575 }
576 
577 void
579 {
580  SpeedChanged (); /* EMIT SIGNAL */
581 }
582 
583 void
585 {
586  AlignmentStyleChanged (); /* EMIT SIGNAL */
587 }
588 
591 {
592  return _diskstream->playlist ();
593 }
594 
595 void
597 {
598  _diskstream->request_input_monitoring (m);
599 }
600 
601 void
603 {
604  _diskstream->ensure_input_monitoring (m);
605 }
606 
607 bool
609 {
610  return _diskstream->destructive ();
611 }
612 
613 list<boost::shared_ptr<Source> > &
615 {
616  return _diskstream->last_capture_sources ();
617 }
618 
619 void
621 {
622  _diskstream->set_capture_offset ();
623 }
624 
625 std::string
627 {
628  return _diskstream->steal_write_source_name ();
629 }
630 
631 void
632 Track::reset_write_sources (bool r, bool force)
633 {
634  _diskstream->reset_write_sources (r, force);
635 }
636 
637 float
639 {
640  return _diskstream->playback_buffer_load ();
641 }
642 
643 float
645 {
646  return _diskstream->capture_buffer_load ();
647 }
648 
649 int
651 {
652  return _diskstream->do_refill ();
653 }
654 
655 int
657 {
658  return _diskstream->do_flush (c, force);
659 }
660 
661 void
663 {
664  _diskstream->set_pending_overwrite (o);
665 }
666 
667 int
668 Track::seek (framepos_t p, bool complete_refill)
669 {
670  return _diskstream->seek (p, complete_refill);
671 }
672 
673 bool
675 {
676  return _diskstream->hidden ();
677 }
678 
679 int
681 {
682  return _diskstream->can_internal_playback_seek (p);
683 }
684 
685 int
687 {
688  return _diskstream->internal_playback_seek (p);
689 }
690 
691 void
693 {
694  _diskstream->non_realtime_input_change ();
695 }
696 
697 void
699 {
701 
702  if (!hidden()) {
703  /* don't waste i/o cycles and butler calls
704  for hidden (secret) tracks
705  */
706  _diskstream->non_realtime_locate (p);
707  }
708 }
709 
710 void
712 {
713  _diskstream->non_realtime_set_speed ();
714 }
715 
716 int
718 {
719  return _diskstream->overwrite_existing_buffers ();
720 }
721 
723 Track::get_captured_frames (uint32_t n) const
724 {
725  return _diskstream->get_captured_frames (n);
726 }
727 
728 int
730 {
731  return _diskstream->set_loop (l);
732 }
733 
734 void
736 {
737  _diskstream->transport_looped (p);
738 }
739 
740 bool
741 Track::realtime_set_speed (double s, bool g)
742 {
743  return _diskstream->realtime_set_speed (s, g);
744 }
745 
746 void
747 Track::transport_stopped_wallclock (struct tm & n, time_t t, bool g)
748 {
749  _diskstream->transport_stopped_wallclock (n, t, g);
750 }
751 
752 bool
754 {
755  return _diskstream->pending_overwrite ();
756 }
757 
758 double
759 Track::speed () const
760 {
761  return _diskstream->speed ();
762 }
763 
764 void
766 {
767  _diskstream->prepare_to_stop (t, a);
768 }
769 
770 void
772 {
773  _diskstream->set_slaved (s);
774 }
775 
776 ChanCount
778 {
779  return _diskstream->n_channels ();
780 }
781 
784 {
785  return _diskstream->get_capture_start_frame (n);
786 }
787 
790 {
791  return _diskstream->alignment_style ();
792 }
793 
796 {
797  return _diskstream->alignment_choice ();
798 }
799 
802 {
803  return _diskstream->current_capture_start ();
804 }
805 
808 {
809  return _diskstream->current_capture_end ();
810 }
811 
812 void
814 {
815  _diskstream->playlist_modified ();
816 }
817 
818 int
820 {
821  int ret = _diskstream->use_playlist (p);
822  if (ret == 0) {
823  p->set_orig_track_id (id());
824  }
825  return ret;
826 }
827 
828 int
830 {
831  int ret = _diskstream->use_copy_playlist ();
832 
833  if (ret == 0) {
834  _diskstream->playlist()->set_orig_track_id (id());
835  }
836 
837  return ret;
838 }
839 
840 int
842 {
843  int ret = _diskstream->use_new_playlist ();
844 
845  if (ret == 0) {
846  _diskstream->playlist()->set_orig_track_id (id());
847  }
848 
849  return ret;
850 }
851 
852 void
854 {
855  _diskstream->set_align_style (s, force);
856 }
857 
858 void
860 {
861  _diskstream->set_align_choice (s, force);
862 }
863 
864 bool
866 {
867  return (id == _diskstream->id ());
868 }
869 
870 void
872 {
874  _diskstream->set_block_size (n);
875 }
876 
877 void
879 {
880  if (_diskstream) {
881  _diskstream->adjust_playback_buffering ();
882  }
883 }
884 
885 void
887 {
888  if (_diskstream) {
889  _diskstream->adjust_capture_buffering ();
890  }
891 }
892 
895 {
896  /* Explicit requests */
897 
898  if (_monitoring & MonitorInput) {
899  return MonitoringInput;
900  }
901 
902  if (_monitoring & MonitorDisk) {
903  return MonitoringDisk;
904  }
905 
906  /* This is an implementation of the truth table in doc/monitor_modes.pdf;
907  I don't think it's ever going to be too pretty too look at.
908  */
909 
910  bool const roll = _session.transport_rolling ();
911  bool const track_rec = _diskstream->record_enabled ();
912  bool const auto_input = _session.config.get_auto_input ();
913  bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring;
914  bool const tape_machine_mode = Config->get_tape_machine_mode ();
915  bool session_rec;
916 
917  /* I suspect that just use actively_recording() is good enough all the
918  * time, but just to keep the semantics the same as they were before
919  * sept 26th 2012, we differentiate between the cases where punch is
920  * enabled and those where it is not.
921  */
922 
923  if (_session.config.get_punch_in() || _session.config.get_punch_out()) {
924  session_rec = _session.actively_recording ();
925  } else {
926  session_rec = _session.get_record_enabled();
927  }
928 
929  if (track_rec) {
930 
931  if (!session_rec && roll && auto_input) {
932  return MonitoringDisk;
933  } else {
934  return software_monitor ? MonitoringInput : MonitoringSilence;
935  }
936 
937  } else {
938 
939  if (tape_machine_mode) {
940 
941  return MonitoringDisk;
942 
943  } else {
944 
945  if (!roll && auto_input) {
946  return software_monitor ? MonitoringInput : MonitoringSilence;
947  } else {
948  return MonitoringDisk;
949  }
950 
951  }
952  }
953 
954  abort(); /* NOTREACHED */
955  return MonitoringSilence;
956 }
957 
958 void
959 Track::maybe_declick (BufferSet& bufs, framecnt_t nframes, int declick)
960 {
961  /* never declick if there is an internal generator - we just want it to
962  keep generating sound without interruption.
963 
964  ditto if we are monitoring inputs.
965  */
966 
968  return;
969  }
970 
971  if (!declick) {
972  declick = _pending_declick;
973  }
974 
975  if (declick != 0) {
976  Amp::declick (bufs, nframes, declick);
977  }
978 }
979 
982 {
983  if (_roll_delay > nframes) {
984 
985  _roll_delay -= nframes;
986  silence_unlocked (nframes);
987  /* transport frame is not legal for caller to use */
988  return 0;
989 
990  } else if (_roll_delay > 0) {
991 
992  nframes -= _roll_delay;
994  transport_frame += _roll_delay;
995 
996  /* shuffle all the port buffers for things that lead "out" of this Route
997  to reflect that we just wrote _roll_delay frames of silence.
998  */
999 
1000  Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
1001  for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
1003  if (iop) {
1005  }
1006  }
1007  _output->increment_port_buffer_offset (_roll_delay);
1008 
1009  _roll_delay = 0;
1010 
1011  }
1012 
1013  return nframes;
1014 }
1015 
1016 void
1018 {
1019  if (mc != _monitoring) {
1020  _monitoring = mc;
1021 
1022  for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
1023  (*i)->monitoring_changed ();
1024  }
1025 
1026  MonitoringChanged (); /* EMIT SIGNAL */
1027  }
1028 }
1029 
1030 MeterState
1032 {
1033  bool rv;
1034  if (_session.transport_rolling ()) {
1035  // audio_track.cc || midi_track.cc roll() runs meter IFF:
1036  rv = _meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled());
1037  } else {
1038  // track no_roll() always metering if
1039  rv = _meter_point == MeterInput;
1040  }
1041  return rv ? MeteringInput : MeteringRoute;
1042 }
1043 
bool pending_overwrite() const
Definition: track.cc:753
framepos_t get_capture_start_frame(uint32_t n=0) const
Definition: track.cc:783
bool transport_rolling() const
Definition: session.h:592
void set_align_choice(AlignChoice, bool force=false)
Definition: track.cc:859
int use_copy_playlist()
Definition: track.cc:829
double get_value(void) const
Definition: track.cc:204
std::string steal_write_source_name()
Definition: track.cc:626
void set_record_enabled(bool yn, void *src)
Definition: track.cc:273
ARDOUR::Session & _session
MeterPoint _meter_point
Definition: route.h:538
PBD::Signal0< void > SpeedChanged
Definition: diskstream.h:179
RecEnableControl(boost::shared_ptr< Track > t)
Definition: track.cc:180
void parameter_changed(std::string const &p)
Definition: track.cc:294
FreezeRecord _freeze_record
Definition: track.h:214
const std::string & value() const
Definition: xml++.h:159
void use_new_diskstream()
Definition: track.cc:78
int do_refill()
Definition: track.cc:650
bool get_record_enabled() const
Definition: session.h:272
bool _silent
Definition: route.h:550
void transport_looped(framepos_t)
Definition: track.cc:735
double transport_speed() const
Definition: session.h:590
bool writable() const
Definition: session.h:173
AlignStyle
Definition: types.h:163
LIBARDOUR_API uint64_t Destruction
Definition: debug.cc:38
virtual int set_state(const XMLNode &, int version)
Definition: track.cc:108
PBD::Signal0< void > RecordEnableChanged
Definition: diskstream.h:178
void set_latency_compensation(framecnt_t)
Definition: track.cc:374
#define enum_2_string(e)
Definition: enumwriter.h:97
Session & session() const
boost::shared_ptr< Amp > _amp
Definition: route.h:588
void flush_buffers(framecnt_t nframes)
Definition: delivery.cc:450
MeterState metering_state() const
Definition: track.cc:1031
bool actively_recording() const
Definition: session.h:280
int silent_roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool &need_butler)
Definition: track.cc:519
virtual ~Track()
Definition: track.cc:51
MeterState
Definition: types.h:399
void maybe_declick(BufferSet &, framecnt_t, int)
Definition: track.cc:959
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
Definition: shared_ptr.hpp:396
int overwrite_existing_buffers()
Definition: track.cc:717
virtual int init()
Definition: route.cc:122
void adjust_capture_buffering()
Definition: track.cc:886
const std::string & name() const
Definition: xml++.h:104
virtual void set_block_size(pframes_t nframes)
Definition: route.cc:3754
int use_new_playlist()
Definition: track.cc:841
void diskstream_playlist_changed()
Definition: track.cc:566
int _pending_declick
Definition: route.h:537
bool hidden() const
Definition: track.cc:674
float capture_buffer_load() const
Definition: track.cc:644
void reset_write_sources(bool, bool force=false)
Definition: track.cc:632
void passthru(BufferSet &, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
Definition: route.cc:729
PBD::Signal0< void > PlaylistChanged
Definition: diskstream.h:182
virtual void set_monitoring(MonitorChoice)
Definition: track.cc:1017
framecnt_t get_captured_frames(uint32_t n=0) const
Definition: track.cc:723
void set_orig_track_id(const PBD::ID &did)
Definition: playlist.cc:3215
MeterPoint _saved_meter_point
Definition: track.h:175
framepos_t current_capture_end() const
Definition: track.cc:807
meter the input IO, regardless of what is going through the route
Definition: types.h:400
uint32_t pframes_t
Definition: types.h:61
void resync_track_name()
Definition: track.cc:310
Definition: Beats.hpp:239
void non_realtime_input_change()
Definition: track.cc:692
bool _active
Definition: route.h:510
const XMLNodeList & children(const std::string &str=std::string()) const
Definition: xml++.cc:329
bool _have_internal_generator
Definition: route.h:560
ProcessorList _processors
Definition: route.h:517
bool set_name(const std::string &str)
Definition: route.cc:3870
void silence_unlocked(framecnt_t)
Definition: route.cc:2905
MonitorChoice
Definition: types.h:386
SessionConfiguration config
Definition: session.h:866
RunContext
Definition: types.h:492
virtual int no_roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, bool state_changing)
Definition: track.cc:381
meter what is going through the route
Definition: types.h:401
AlignChoice alignment_choice() const
Definition: track.cc:795
PBD::Signal0< void > AlignmentStyleChanged
Definition: diskstream.h:183
bool using_diskstream_id(PBD::ID) const
Definition: track.cc:865
bool can_record()
Definition: track.cc:221
Definition: id.h:32
boost::shared_ptr< PeakMeter > _meter
Definition: route.h:590
std::list< XMLNode * > XMLNodeList
Definition: xml++.h:44
void request_input_monitoring(bool)
Definition: track.cc:596
XMLNode & get_template()
Definition: track.cc:162
PBD::Signal0< void > AlignmentStyleChanged
Definition: track.h:169
virtual void non_realtime_locate(framepos_t)
Definition: route.cc:4608
int64_t track_number() const
Definition: route.h:302
void non_realtime_set_speed()
Definition: track.cc:711
virtual void set_latency_compensation(framecnt_t)
Definition: route.cc:3620
TrackMode
Definition: types.h:198
void prepare_to_stop(framepos_t, framepos_t)
Definition: track.cc:765
#define X_(Text)
Definition: i18n.h:13
boost::shared_ptr< RecEnableControl > _rec_enable_control
Definition: track.h:220
int64_t framecnt_t
Definition: types.h:76
PBD::Signal0< void > track_number_changed
Definition: route.h:301
XMLProperty * property(const char *)
Definition: xml++.cc:413
LIBARDOUR_API RCConfiguration * Config
Definition: globals.cc:119
boost::shared_ptr< IO > _output
Definition: route.h:508
bool _declickable
Definition: route.h:551
#define string_2_enum(str, e)
Definition: enumwriter.h:98
void set_capture_offset()
Definition: track.cc:620
void silence(framecnt_t)
Definition: route.cc:2894
std::vector< FreezeRecordProcessorInfo * > processor_info
Definition: track.h:198
int use_playlist(boost::shared_ptr< Playlist >)
Definition: track.cc:819
int seek(framepos_t, bool complete_refill=false)
Definition: track.cc:668
void set_meter_point(MeterPoint, bool force=false)
Definition: route.cc:3436
void set_block_size(pframes_t)
Definition: track.cc:871
int internal_playback_seek(framecnt_t)
Definition: track.cc:686
framepos_t transport_frame() const
Definition: session.h:551
Definition: amp.h:29
MonitorState
Definition: types.h:393
bool is_active() const
Definition: route_group.h:66
ChanCount n_outputs() const
Definition: route.h:93
bool is_recenable() const
Definition: route_group.h:72
std::list< boost::shared_ptr< Source > > & last_capture_sources()
Definition: track.cc:614
PBD::Signal0< void > SpeedChanged
Definition: track.h:168
boost::shared_ptr< Playlist > playlist()
Definition: track.cc:590
void diskstream_record_enable_changed()
Definition: track.cc:572
#define DEBUG_TRACE(bits, str)
Definition: debug.h:55
bool record_enabled() const
Definition: track.cc:215
void ensure_input_monitoring(bool)
Definition: track.cc:602
int64_t framepos_t
Definition: types.h:66
void transport_stopped_wallclock(struct tm &, time_t, bool)
Definition: track.cc:747
MonitorChoice _monitoring
Definition: track.h:178
void set_pending_overwrite(bool)
Definition: track.cc:662
LIBARDOUR_API XMLNode * find_named_node(const XMLNode &node, std::string name)
void passthru_silence(framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
Definition: route.cc:748
int do_flush(RunContext, bool force=false)
Definition: track.cc:656
PBD::Property< std::string > _name
void apply(void(Track::*func)(T, void *), T val, void *src)
Ardour does monitoring.
Definition: types.h:382
PBD::Signal1< void, std::string > ParameterChanged
Definition: configuration.h:44
void set_list(boost::shared_ptr< Evoral::ControlList >)
PBD::Signal0< void > PlaylistChanged
Definition: track.h:166
static void declick(BufferSet &bufs, framecnt_t nframes, int dir)
Definition: amp.cc:233
void diskstream_alignment_style_changed()
Definition: track.cc:584
static const std::string xml_node_name
Definition: controllable.h:116
virtual boost::shared_ptr< Diskstream > diskstream_factory(XMLNode const &)=0
XMLProperty * add_property(const char *name, const std::string &value)
BufferSet & get_route_buffers(ChanCount count=ChanCount::ZERO, bool silence=true)
Definition: session.cc:4857
boost::shared_ptr< IO > _input
Definition: route.h:507
void prep_record_enabled(bool yn, void *src)
Definition: track.cc:233
MonitorState monitoring_state() const
Definition: track.cc:894
void playlist_modified()
Definition: track.cc:813
const char * name
MonitorChoice monitoring_choice() const
Definition: track.h:55
void add_child_nocopy(XMLNode &)
Definition: xml++.cc:357
virtual int set_state(const XMLNode &, int version)
Definition: route.cc:2243
int can_internal_playback_seek(framecnt_t)
Definition: track.cc:680
pframes_t get_block_size() const
Definition: session.h:393
ChanCount n_channels()
Definition: track.cc:777
XMLNode & state(bool full)
Definition: track.cc:96
virtual boost::shared_ptr< Diskstream > create_diskstream()=0
Definition: xml++.h:95
std::string name() const
virtual int do_refill_with_alloc()=0
uint32_t track_number_decimals() const
Definition: session.h:268
void increment_port_buffer_offset(pframes_t)
void adjust_playback_buffering()
Definition: track.cc:878
framecnt_t check_initial_delay(framecnt_t nframes, framepos_t &)
Definition: track.cc:981
PBD::Signal0< void > MonitoringChanged
Definition: track.h:57
float playback_buffer_load() const
Definition: track.cc:638
std::string _diskstream_name
Definition: track.h:234
Definition: debug.h:30
bool realtime_set_speed(double, bool)
Definition: track.cc:741
void set_slaved(bool)
Definition: track.cc:771
XMLNode & get_state()
Definition: track.cc:90
PBD::Signal0< void > RecordEnableChanged
Definition: track.h:167
void non_realtime_locate(framepos_t)
Definition: track.cc:698
int set_loop(Location *)
Definition: track.cc:729
int init()
Definition: track.cc:57
virtual XMLNode & state(bool)
Definition: route.cc:2143
boost::shared_ptr< SessionPlaylists > playlists
Definition: session.h:907
FreezeState freeze_state() const
Definition: track.cc:175
AlignStyle alignment_style() const
Definition: track.cc:789
Glib::Threads::RWLock _processor_lock
Definition: route.h:518
int save_state(std::string snapshot_name, bool pending=false, bool switch_to_snapshot=false, bool template_only=false)
boost::shared_ptr< Diskstream > _diskstream
Definition: track.h:174
bool set_name(const std::string &str)
Definition: track.cc:316
bool destructive() const
Definition: track.cc:608
framecnt_t _roll_delay
Definition: route.h:515
MeterPoint
Definition: types.h:174
virtual void set_diskstream(boost::shared_ptr< Diskstream >)
Definition: track.cc:554
AlignChoice
Definition: types.h:168
virtual void set_block_size(pframes_t)=0
XMLNodeList::const_iterator XMLNodeConstIterator
Definition: xml++.h:49
void fill_buffers_with_input(BufferSet &bufs, boost::shared_ptr< IO > io, pframes_t nframes)
Definition: route.cc:4629
boost::shared_ptr< Playlist > playlist()
Definition: diskstream.h:127
BufferSet & get_silent_buffers(ChanCount count=ChanCount::ZERO)
Definition: session.cc:4845
virtual int roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool &need_butler)=0
ChanCount n_process_buffers()
Definition: route.cc:714
framepos_t current_capture_start() const
Definition: track.cc:801
std::string string_compose(const std::string &fmt, const T1 &o1)
Definition: compose.h:208
void diskstream_speed_changed()
Definition: track.cc:578
double speed() const
Definition: track.cc:759
void set_align_style(AlignStyle, bool force=false)
Definition: track.cc:853