Ardour  9.0-pre0-582-g084a23a80d
session.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2000-2019 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2005-2009 Taybin Rutkin <taybin@taybin.com>
4  * Copyright (C) 2006-2007 Jesse Chappell <jesse@essej.net>
5  * Copyright (C) 2006-2009 Sampo Savolainen <v2@iki.fi>
6  * Copyright (C) 2006-2015 David Robillard <d@drobilla.net>
7  * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
8  * Copyright (C) 2007-2015 Tim Mayberry <mojofunk@gmail.com>
9  * Copyright (C) 2008-2009 Hans Baier <hansfbaier@googlemail.com>
10  * Copyright (C) 2008-2009 Sakari Bergen <sakari.bergen@beatwaves.net>
11  * Copyright (C) 2012-2019 Robin Gareus <robin@gareus.org>
12  * Copyright (C) 2013-2017 Nick Mainsbridge <mainsbridge@gmail.com>
13  * Copyright (C) 2013-2018 John Emmas <john@creativepost.co.uk>
14  * Copyright (C) 2014-2018 Ben Loftis <ben@harrisonconsoles.com>
15  * Copyright (C) 2015-2018 Len Ovens <len@ovenwerks.net>
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 2 of the License, or
20  * (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License along
28  * with this program; if not, write to the Free Software Foundation, Inc.,
29  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30  */
31 
32 #pragma once
33 
34 #ifdef WAF_BUILD
35 #include "libardour-config.h"
36 #endif
37 
38 #include <atomic>
39 #include <exception>
40 #include <list>
41 #include <map>
42 #include <memory>
43 #include <set>
44 #include <string>
45 #include <vector>
46 #include <queue>
47 #include <stdint.h>
48 
49 #include <boost/dynamic_bitset.hpp>
50 #include <glibmm/threads.h>
51 
52 #include <ltc.h>
53 
54 #include "pbd/atomic.h"
55 #include "pbd/error.h"
56 #include "pbd/event_loop.h"
57 #include "pbd/file_archive.h"
58 #include "pbd/history_owner.h"
59 #include "pbd/rcu.h"
61 #include "pbd/signals.h"
62 #include "pbd/undo.h"
63 
64 #ifdef USE_TLSF
65 # include "pbd/tlsf.h"
66 #else
67 # include "pbd/reallocpool.h"
68 #endif
69 #include "lua/luastate.h"
70 
71 #include "temporal/range.h"
73 
74 #include "midi++/types.h"
75 #include "midi++/mmc.h"
76 
77 #include "temporal/time.h"
78 
79 #include "ardour/ardour.h"
80 #include "ardour/chan_count.h"
81 #include "ardour/delivery.h"
83 #include "ardour/luascripting.h"
84 #include "ardour/location.h"
89 #include "ardour/session_event.h"
90 #include "ardour/plugin.h"
92 #include "ardour/route.h"
93 #include "ardour/graph_edges.h"
94 #include "ardour/transport_api.h"
95 #include "ardour/triggerbox.h"
96 
97 class XMLTree;
98 class XMLNode;
99 struct _AEffect;
100 typedef struct _AEffect AEffect;
101 
102 class PTFFormat;
103 
104 namespace MIDI {
105 class Port;
106 class MachineControl;
107 class Parser;
108 }
109 
110 namespace PBD {
111 class Controllable;
112 class Progress;
113 class Command;
114 }
115 
116 namespace luabridge {
117  class LuaRef;
118 }
119 
120 namespace Evoral {
121 class Curve;
122 }
123 
124 namespace Temporal {
125 class TempoMap;
126 }
127 
128 namespace ARDOUR {
129 
130 class Amp;
131 class AsyncMIDIPort;
132 class AudioEngine;
133 class AudioFileSource;
134 class AudioRegion;
135 class AudioSource;
136 class AudioTrack;
137 class Auditioner;
138 class AutomationList;
139 class AuxInput;
140 class BufferSet;
141 class Bundle;
142 class Butler;
143 class Click;
144 class CoreSelection;
145 class ExportHandler;
146 class ExportStatus;
147 class Graph;
148 struct GraphChain;
149 class IO;
150 class IOPlug;
151 class IOProcessor;
152 class IOTaskList;
153 class ImportStatus;
154 class MidiClockTicker;
155 class MidiControlUI;
156 class MidiPortManager;
157 class MidiPort;
158 class MidiRegion;
159 class MidiSource;
160 class MidiTrack;
161 class MixerScene;
162 class Playlist;
163 class PluginInsert;
164 class PluginInfo;
165 class Port;
166 class PortInsert;
167 class PortManager;
168 class ProcessThread;
169 class Processor;
170 class Region;
171 class Return;
172 class Route;
173 class RouteGroup;
174 class RTTaskList;
175 class SMFSource;
176 class Send;
177 class SceneChanger;
178 class SessionDirectory;
179 class SessionMetadata;
180 class SessionPlaylists;
181 class SoloMuteRelease;
182 class Source;
183 class Speakers;
184 class TransportMaster;
185 struct TransportFSM;
186 class Track;
187 class UI_TransportMaster;
188 class VCAManager;
189 class WindowsVSTPlugin;
190 
191 extern void setup_enum_writer ();
192 
193 class LIBARDOUR_API SessionException: public std::exception {
194 public:
195  explicit SessionException(const std::string msg) : _message(msg) {}
196  virtual ~SessionException() throw() {}
197 
198  virtual const char* what() const throw() { return _message.c_str(); }
199 
200 private:
201  std::string _message;
202 };
203 
208  public SessionEventManager,
209  public TransportAPI,
211 {
212 public:
213  /* a new session might have non-empty mix_template, an existing session should always have an empty one.
214  the bus profile can be null if no master out bus is required.
215  */
216 
218  const std::string& fullpath,
219  const std::string& snapshot_name,
220  BusProfile const * bus_profile = 0,
221  std::string mix_template = "",
222  bool unnamed = false,
223  samplecnt_t samplerate = 0);
224 
225  virtual ~Session ();
226 
227  static int get_info_from_path (const std::string& xmlpath, float& sample_rate, SampleFormat& data_format, std::string& program_version, XMLNode* engine_hints = 0);
228  static std::string get_snapshot_from_instant (const std::string& session_dir);
229 
234  static unsigned int next_name_id ();
235 
236  std::string path() const { return _path; }
237  std::string name() const { return _name; }
238  std::string snap_name() const { return _current_snapshot_name; }
239  std::string raid_path () const;
240  bool path_is_within_session (const std::string&);
241 
242  bool writable() const { return _writable; }
243  void set_clean (); // == Clean and emit DirtyChanged IFF session was Dirty
244  void set_dirty (); // |= Dirty and emit DirtyChanged (unless already dirty or Loading, Deletion)
245  void unset_dirty (bool emit_dirty_changed = false); // &= ~Dirty
246  void set_deletion_in_progress (); // |= Deletion
247  void clear_deletion_in_progress (); // &= ~Deletion
248 
249  bool reconnection_in_progress () const { return _reconnecting_routes_in_progress; }
250  bool routes_deletion_in_progress () const { return _route_deletion_in_progress; }
251  bool dirty () const { return _state_of_the_state & Dirty; }
252  bool deletion_in_progress () const { return _state_of_the_state & Deletion; }
253  bool peaks_cleanup_in_progres () const { return _state_of_the_state & PeakCleanup; }
254  bool loading () const { return _state_of_the_state & Loading; }
255  bool cannot_save () const { return _state_of_the_state & CannotSave; }
256  bool in_cleanup () const { return _state_of_the_state & InCleanup; }
257  bool inital_connect_or_deletion_in_progress () const { return _state_of_the_state & (InitialConnecting | Deletion); }
258  bool have_external_connections_for_current_backend (bool tracks_only = true) const;
259  bool unnamed() const;
260 
261  void end_unnamed_status () const;
262 
264 
265  const SessionDirectory& session_directory () const { return *(_session_dir.get()); }
266 
267  static PBD::Signal<void(std::string)> Dialog;
268 
271 
273 
274  std::string automation_dir () const;
275  std::string analysis_dir () const;
276  std::string plugins_dir () const;
277  std::string externals_dir () const;
278 
279  std::string construct_peak_filepath (const std::string& audio_path, const bool in_session = false, const bool old_peak_name = false) const;
280 
281  bool audio_source_name_is_unique (const std::string& name);
282  std::string format_audio_source_name (const std::string& legalized_base, uint32_t nchan, uint32_t chan, bool take_required, uint32_t cnt, bool related_exists);
283  std::string new_audio_source_path_for_embedded (const std::string& existing_path);
284  std::string new_audio_source_path (const std::string&, uint32_t nchans, uint32_t chan, bool take_required);
285  std::string new_midi_source_path (const std::string&, bool need_source_lock = true);
286 
295  RouteList new_route_from_template (uint32_t how_many, PresentationInfo::order_t insert_at, const std::string& template_path, const std::string& name, PlaylistDisposition pd = NewPlaylist);
296  RouteList new_route_from_template (uint32_t how_many, PresentationInfo::order_t insert_at, XMLNode&, const std::string& name, PlaylistDisposition pd = NewPlaylist);
297  std::vector<std::string> get_paths_for_new_sources (bool allow_replacing, const std::string& import_file_path,
298  uint32_t channels, std::vector<std::string> const & smf_track_names, bool use_smf_file_names);
299 
300  int bring_all_sources_into_session (std::function<void(uint32_t,uint32_t,std::string)> callback);
301 
302  void process (pframes_t nframes);
303 
306 
309  BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = true);
310  BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = true);
312 
314 
315  bool have_rec_enabled_track () const;
316  bool have_rec_disabled_track () const;
317 
318  bool have_captured() const { return _have_captured; }
319 
320  samplecnt_t capture_duration () const { return _capture_duration; }
321  unsigned int capture_xruns () const { return _capture_xruns; }
322  unsigned int export_xruns () const { return _export_xruns; }
323 
325  Butler* butler() { return _butler; }
326  void butler_transport_work (bool have_process_lock = false);
327 
329 
330  int load_routes (const XMLNode&, int);
331  std::shared_ptr<RouteList const> get_routes() const {
332  return routes.reader ();
333  }
334 
335  std::shared_ptr<RTTaskList> rt_tasklist () { return _rt_tasklist; }
336  std::shared_ptr<IOTaskList> io_tasklist () { return _io_tasklist; }
337 
339 
340  CoreSelection& selection () const { return *_selection; }
341 
342  /* because the set of Stripables consists of objects managed
343  * independently, in multiple containers within the Session (or objects
344  * owned by the session), we fill out a list in-place rather than
345  * return a pointer to a copy of the (RCU) managed list, as happens
346  * with get_routes()
347  */
348 
351  std::shared_ptr<RouteList> get_tracks() const;
352  std::shared_ptr<RouteList> get_routes_with_internal_returns() const;
353  std::shared_ptr<RouteList> get_routes_with_regions_at (timepos_t const &) const;
354 
355  uint32_t nstripables (bool with_monitor = false) const;
356  uint32_t nroutes() const { return routes.reader()->size(); }
357  uint32_t ntracks () const;
358  uint32_t naudiotracks () const;
359  uint32_t nbusses () const;
360 
361  bool plot_process_graph (std::string const& file_name) const;
362 
363  std::shared_ptr<BundleList const> bundles () {
364  return _bundles.reader ();
365  }
366 
368 
369  template<class T> void foreach_route (T *obj, void (T::*func)(Route&), bool sort = true);
370  template<class T> void foreach_route (T *obj, void (T::*func)(std::shared_ptr<Route>), bool sort = true);
371  template<class T, class A> void foreach_route (T *obj, void (T::*func)(Route&, A), A arg, bool sort = true);
372 
373  template<class A> void foreach_track (void (Track::*method)(A), A arg);
374  template<class A1, class A2> void foreach_track (void (Track::*method)(A1, A2), A1 arg1, A2 arg2);
375 
376  void foreach_route (void (Route::*method)());
377  template<class A> void foreach_route (void (Route::*method)(A), A arg);
378  template<class A1, class A2> void foreach_route (void (Route::*method)(A1, A2), A1 arg1, A2 arg2);
379 
380  static const std::string session_name_is_legal (const std::string&);
381 
382  bool io_name_is_legal (const std::string&) const;
383  std::shared_ptr<Route> route_by_name (std::string) const;
384  std::shared_ptr<Route> route_by_id (PBD::ID) const;
385  std::shared_ptr<Stripable> stripable_by_id (PBD::ID) const;
387  std::shared_ptr<Route> get_remote_nth_route (PresentationInfo::order_t n) const;
388  std::shared_ptr<Route> route_by_selected_count (uint32_t cnt) const;
389  void routes_using_input_from (const std::string& str, RouteList& rl);
390 
391  bool route_name_unique (std::string) const;
392  bool route_name_internal (std::string) const;
393 
394  uint32_t track_number_decimals () const {
395  return _track_number_decimals;
396  }
397 
398  bool get_record_enabled() const {
399  return (record_status () >= Enabled);
400  }
401 
403  return _record_status.load();
404  }
405 
406  bool actively_recording () const {
407  return record_status() == Recording;
408  }
409 
410  bool record_enabling_legal () const;
411  void maybe_enable_record (bool rt_context = false);
412  void disable_record (bool rt_context, bool force = false);
414 
416 
418 
420 
421  /* Emitted when all i/o connections are complete */
422 
424 
425  /* Record status signals */
426 
427  PBD::Signal<void()> RecordStateChanged; /* signals changes in recording state (i.e. are we recording) */
428  /* XXX may 2015: paul says: it isn't clear to me that this has semantics that cannot be inferrred
429  from the previous signal and session state.
430  */
431  PBD::Signal<void()> RecordArmStateChanged; /* signals changes in recording arming */
432 
433  PBD::Signal<void()> UpdateRouteRecordState; /* signals potential change in route recording arming */
434 
435  /* Emited when session is loaded */
437 
438  /* Transport mechanism signals */
439 
448 
449  PBD::Signal<void(samplepos_t)> PositionChanged; /* sent after any non-sequential motion */
452 
455 
464  PBD::Signal<void(RouteGroup *, std::weak_ptr<Route> )> RouteAddedToRouteGroup;
468  PBD::Signal<void(RouteGroup *, std::weak_ptr<Route> )> RouteRemovedFromRouteGroup;
469 
473 
474  /* Step Editing status changed */
476 
477  /* Timecode state signals */
479 
481 
485  void request_stop (bool abort = false, bool clear_state = false, TransportRequestSource origin = TRS_UI);
487 
488  void request_play_loop (bool yn, bool leave_rolling = false);
489  bool get_play_loop () const { return play_loop; }
490 
491  samplepos_t last_transport_start () const { return _last_roll_location; }
492  void goto_end ();
493  void goto_start (bool and_roll = false);
495  void allow_auto_play (bool yn);
496 
499 
500  void trigger_stop_all (bool now = true);
501 
505  void request_overwrite_buffer (std::shared_ptr<Track>, OverwriteReason);
508 
509  bool global_locate_pending() const { return _global_locate_pending; }
510  bool locate_pending() const;
511  bool locate_initiated() const;
512  bool declick_in_progress () const;
513  bool transport_locked () const;
514 
515  bool had_destructive_tracks () const;
517 
518  int wipe ();
519 
525  samplecnt_t sample_rate () const { return _current_sample_rate; }
527  samplecnt_t nominal_sample_rate () const { return _base_sample_rate; }
528  samplecnt_t frames_per_hour () const { return _frames_per_hour; }
529 
530  double samples_per_timecode_frame() const { return _samples_per_timecode_frame; }
531  samplecnt_t timecode_frames_per_hour() const { return _timecode_frames_per_hour; }
532 
534  return mtc_timecode_bits; /* encoding of SMTPE type for MTC */
535  }
536 
538  bool timecode_drop_frames() const;
539 
540  /* Locations */
541 
542  Locations *locations() { return _locations; }
543 
547 
550  void set_session_extents (timepos_t const & start, timepos_t const & end);
551  bool session_range_is_free () const { return _session_range_is_free; }
553 
554  pframes_t get_block_size () const { return current_block_size; }
555  samplecnt_t worst_output_latency () const { return _worst_output_latency; }
556  samplecnt_t worst_input_latency () const { return _worst_input_latency; }
557  samplecnt_t worst_route_latency () const { return _worst_route_latency; }
558  samplecnt_t io_latency () const { return _io_latency; }
561 
563 
564  struct SaveAs {
565  std::string new_parent_folder; /* parent folder where new session folder will be created */
566  std::string new_name; /* name of newly saved session */
567  bool switch_to; /* true if we should be working on newly saved session after save-as; false otherwise */
568  bool include_media; /* true if the newly saved session should contain references to media */
569  bool copy_media; /* true if media files (audio, media, etc) should be copied into newly saved session; false otherwise */
570  bool copy_external; /* true if external media should be consolidated into the newly saved session; false otherwise */
571 
572  std::string final_session_folder_name; /* filled in by * Session::save_as(), provides full path to newly saved session */
573 
574  /* emitted as we make progress. 3 arguments passed to signal
575  * handler:
576  *
577  * 1: percentage complete measured as a fraction (0-1.0) of
578  * total data copying done.
579  * 2: number of files copied so far
580  * 3: total number of files to copy
581  *
582  * Handler should return true for save-as to continue, or false
583  * to stop (and remove all evidence of partial save-as).
584  */
585  PBD::Signal<bool(float,int64_t,int64_t)> Progress;
586 
587  /* if save_as() returns non-zero, this string will indicate the reason why.
588  */
589  std::string failure_message;
590  };
591 
592  int save_as (SaveAs&);
593 
603  int save_state (std::string snapshot_name = "",
604  bool pending = false,
605  bool switch_to_snapshot = false,
606  bool template_only = false,
607  bool for_archive = false,
608  bool only_used_assets = false);
609 
613  FLAC_24BIT
614  };
615 
616  int archive_session (const std::string&, const std::string&,
617  ArchiveEncode compress_audio = FLAC_16BIT,
619  bool only_used_sources = false,
620  PBD::Progress* p = 0);
621 
622  int restore_state (std::string snapshot_name);
623  int save_template (const std::string& template_name, const std::string& description = "", bool replace_existing = false);
624  int save_history (std::string snapshot_name = "");
625  int restore_history (std::string snapshot_name);
626  void remove_state (std::string snapshot_name);
627  void rename_state (std::string old_name, std::string new_name);
629  int rename (const std::string&);
630  bool get_nsm_state () const { return _under_nsm_control; }
631  void set_nsm_state (bool state) { _under_nsm_control = state; }
633 
634  PBD::Signal<void(std::string)> StateSaved;
636 
637  /* emitted when session needs to be saved due to some internal
638  * event or condition (i.e. not in response to a user request).
639  *
640  * Only one object should
641  * connect to this signal and take responsibility.
642  *
643  * Argument is the snapshot name to use when saving.
644  */
645  PBD::Signal<void(std::string)> SaveSessionRequested;
646 
647  /* emitted during a session save to allow other entities to add state, via
648  * extra XML, to the session state
649  */
651 
652  std::vector<std::string> possible_states() const;
653  static std::vector<std::string> possible_states (std::string path);
654 
655  bool export_track_state (std::shared_ptr<RouteList> rl, const std::string& path);
656 
658  void add_instant_xml (XMLNode&, bool write_to_config = true);
659  XMLNode* instant_xml (const std::string& str);
660 
662  Clean = 0x0,
663  Dirty = 0x1,
664  CannotSave = 0x2,
665  Deletion = 0x4,
666  InitialConnecting = 0x8,
667  Loading = 0x10,
668  InCleanup = 0x20,
669  PeakCleanup = 0x40
670  };
671 
673  public:
674  StateProtector (Session* s) : _session (s) {
676  }
678  if (PBD::atomic_dec_and_test (_session->_suspend_save)) {
679  while (_session->_save_queued) {
680  _session->_save_queued = false;
681  _session->save_state ("");
682  }
683  while (_session->_save_queued_pending) {
684  _session->_save_queued_pending = false;
685  _session->save_state ("", true);
686  }
687  }
688  }
689  private:
691  };
692 
694  public:
695  ProcessorChangeBlocker (Session* s, bool rc = true);
697 
698  private:
701  };
702 
703  RouteGroup* new_route_group (const std::string&);
705  void remove_route_group (RouteGroup* rg) { if (rg) remove_route_group (*rg); }
707  void reorder_route_groups (std::list<RouteGroup*>);
708 
711 
715 
716  void foreach_route_group (std::function<void(RouteGroup*)> f) {
717  for (std::list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) {
718  f (*i);
719  }
720  }
721 
722  std::list<RouteGroup*> const & route_groups () const {
723  return _route_groups;
724  }
725 
726  /* fundamental operations. duh. */
727 
728  std::list<std::shared_ptr<AudioTrack> > new_audio_track (
729  int input_channels,
730  int output_channels,
731  RouteGroup* route_group,
732  uint32_t how_many,
733  std::string name_template,
735  TrackMode mode = Normal,
736  bool input_auto_connect = true,
737  bool trigger_visibility = false
738  );
739 
740  std::list<std::shared_ptr<MidiTrack> > new_midi_track (
741  const ChanCount& input, const ChanCount& output, bool strict_io,
742  std::shared_ptr<PluginInfo> instrument,
743  Plugin::PresetRecord* pset,
744  RouteGroup* route_group, uint32_t how_many, std::string name_template,
746  TrackMode mode,
747  bool input_auto_connect,
748  bool trigger_visibility = false
749  );
750 
751  RouteList new_audio_route (int input_channels, int output_channels, RouteGroup* route_group, uint32_t how_many, std::string name_template, PresentationInfo::Flag, PresentationInfo::order_t);
752  RouteList new_midi_route (RouteGroup* route_group, uint32_t how_many, std::string name_template, bool strict_io, std::shared_ptr<PluginInfo> instrument, Plugin::PresetRecord*, PresentationInfo::Flag, PresentationInfo::order_t);
753 
754  void remove_routes (std::shared_ptr<RouteList>);
755  void remove_route (std::shared_ptr<Route>);
756 
757  void resort_routes ();
758 
759  AudioEngine & engine() { return _engine; }
760  AudioEngine const & engine () const { return _engine; }
761 
762  static std::string default_track_name_pattern (DataType);
763 
764  /* Time */
765 
766  samplepos_t transport_sample () const { return _transport_sample; }
767  samplepos_t record_location () const { return _last_record_location; }
768  samplepos_t audible_sample (bool* latent_locate = NULL) const;
769  samplepos_t requested_return_sample() const { return _requested_return_sample; }
771  std::optional<samplepos_t> const & nominal_jack_transport_sample() { return _nominal_jack_transport_sample; }
772 
773  bool compute_audible_delta (samplepos_t& pos_and_delta) const;
774  samplecnt_t remaining_latency_preroll () const { return _remaining_latency_preroll; }
775 
785  pullup_Minus4Minus1
786  };
787 
789 
790  void timecode_to_sample(Timecode::Time& timecode, samplepos_t& sample, bool use_offset, bool use_subframes) const;
791  void sample_to_timecode(samplepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const;
795 
797  void timecode_duration_string (char *, size_t len, samplecnt_t) const;
798 
801 
804 
805  void request_sync_source (std::shared_ptr<TransportMaster>);
806  bool synced_to_engine() const;
807 
808  double engine_speed() const { return _engine_speed; }
809  double actual_speed() const;
810  double transport_speed (bool incl_preroll = false) const;
812  bool transport_stopped() const;
823  bool transport_rolling() const;
825  bool transport_locating() const;
826 
827  bool silent () { return _silent; }
828 
829  bool punch_is_possible () const;
830  bool loop_is_possible () const;
832 
834 
835  unsigned int get_xrun_count () const {return _xrun_count; }
837 
838  /* region info */
839 
840  std::shared_ptr<Region> find_whole_file_parent (std::shared_ptr<Region const>) const;
841 
842  std::shared_ptr<Region> XMLRegionFactory (const XMLNode&, bool full);
843  std::shared_ptr<AudioRegion> XMLAudioRegionFactory (const XMLNode&, bool full);
844  std::shared_ptr<MidiRegion> XMLMidiRegionFactory (const XMLNode&, bool full);
845 
846  void deinterlace_midi_region ( std::shared_ptr<MidiRegion> mr );
847 
848  /* source management */
849 
851  bool sample_rate_convert (ImportStatus&, std::string infile, std::string& outfile);
852  std::string build_tmp_convert_name (std::string file);
853 
854  std::shared_ptr<ExportHandler> get_export_handler ();
855  std::shared_ptr<ExportStatus> get_export_status ();
856 
857  int start_audio_export (samplepos_t position, bool realtime = false, bool region_export = false);
858 
860  static PBD::Signal<void(std::string, std::string, bool, samplepos_t)> Exported;
861 
862  void add_source (std::shared_ptr<Source>);
863  void remove_source (std::weak_ptr<Source>, bool drop_references = true);
864 
866  bool can_cleanup_peakfiles () const;
870 
871  int destroy_sources (std::list<std::shared_ptr<Source> > const&);
872 
874  void get_last_capture_sources (std::list<std::shared_ptr<Source> >&);
875 
880  static PBD::Signal<int(std::shared_ptr<Playlist> )> AskAboutPlaylistDeletion;
881 
886 
889 
893 
899  static PBD::Signal<void()> AfterConnect;
900 
901  std::shared_ptr<AudioFileSource> create_audio_source_for_session (
902  size_t, std::string const &, uint32_t);
903 
904  std::shared_ptr<MidiSource> create_midi_source_for_session (std::string const &);
905  std::shared_ptr<MidiSource> create_midi_source_by_stealing_name (std::shared_ptr<Track>);
906 
907  std::shared_ptr<Source> source_by_id (const PBD::ID&);
908  std::shared_ptr<AudioFileSource> audio_source_by_path_and_channel (const std::string&, uint16_t) const;
909  std::shared_ptr<MidiSource> midi_source_by_path (const std::string&, bool need_source_lock) const;
910  uint32_t count_sources_by_origin (const std::string&);
911 
912  void add_playlist (std::shared_ptr<Playlist>);
913 
914  /* Curves and AutomationLists (TODO when they go away) */
916 
917  /* auditioning */
918 
919  std::shared_ptr<Auditioner> the_auditioner() { return auditioner; }
921  void audition_region (std::shared_ptr<Region>);
923  bool is_auditioning () const;
924 
926 
927  /* session script */
928  void register_lua_function (const std::string&, const std::string&, const LuaScriptParamList&);
929  void unregister_lua_function (const std::string& name);
930  std::vector<std::string> registered_lua_functions ();
931  uint32_t registered_lua_function_count () const { return _n_lua_scripts; }
932  void scripts_changed (); // called from lua, updates _n_lua_scripts
933 
935 
936  /* I/O Plugin */
938 
939  void load_io_plugin (std::shared_ptr<IOPlug>);
940  bool unload_io_plugin (std::shared_ptr<IOPlug>);
941 
942  std::shared_ptr<IOPlug> nth_io_plug (uint32_t n) {
943  std::shared_ptr<IOPlugList const> iop (_io_plugins.reader ());
944  if (n < iop->size ()) {
945  return (*iop)[n];
946  }
947  return std::shared_ptr<IOPlug> ();
948  }
949 
950  std::shared_ptr<IOPlugList const> io_plugs () const {
951  return _io_plugins.reader ();
952  }
953 
954  /* flattening stuff */
955 
956  std::shared_ptr<Region> write_one_track (Track&, samplepos_t start, samplepos_t end,
957  bool overwrite, std::vector<std::shared_ptr<Source> >&, InterThreadInfo& wot,
958  std::shared_ptr<Processor> endpoint,
959  bool include_endpoint, bool for_export, bool for_freeze,
960  std::string const& source_name = "", std::string const& region_name = "");
962 
963  /* session-wide solo/mute/rec-enable */
964 
965  bool muted () const;
966  std::vector<std::weak_ptr<AutomationControl> > cancel_all_mute ();
967 
968  bool soloing () const { return _non_soloed_outs_muted; }
969  bool listening () const;
970  bool solo_isolated () const { return _solo_isolated_cnt > 0; }
972 
975 
976  void clear_all_solo_state (std::shared_ptr<RouteList const>);
977  void prepare_momentary_solo (SoloMuteRelease* smr = NULL, bool exclusive = false, std::shared_ptr<Route> route = std::shared_ptr<Route> ());
978 
980 
981  /* Control-based methods */
982 
983  void set_controls (std::shared_ptr<AutomationControlList>, double val, PBD::Controllable::GroupControlDisposition);
984  void set_control (std::shared_ptr<AutomationControl>, double val, PBD::Controllable::GroupControlDisposition);
985 
986  void set_exclusive_input_active (std::shared_ptr<RouteList> rt, bool onoff, bool flip_others = false);
987 
988  PBD::Signal<void(bool)> SoloActive;
995 
997 
998  /* monitor/master out */
999  int add_master_bus (ChanCount const&);
1000 
1002  bool monitor_active() const { return (_monitor_out && _monitor_out->monitor_control () && _monitor_out->monitor_control ()->monitor_active()); }
1003 
1004  std::shared_ptr<Route> monitor_out() const { return _monitor_out; }
1005  std::shared_ptr<Route> master_out() const { return _master_out; }
1006  std::shared_ptr<GainControl> master_volume () const;
1007  std::shared_ptr<Route> surround_master() const { return _surround_master; }
1008 
1009  PresentationInfo::order_t master_order_key () const { return _master_out ? _master_out->presentation_info ().order () : -1; }
1011 
1012  void globally_add_internal_sends (std::shared_ptr<Route> dest, Placement p, bool);
1013  void globally_set_send_gains_from_track (std::shared_ptr<Route> dest);
1014  void globally_set_send_gains_to_zero (std::shared_ptr<Route> dest);
1015  void globally_set_send_gains_to_unity (std::shared_ptr<Route> dest);
1016  void add_internal_sends (std::shared_ptr<Route> dest, Placement p, std::shared_ptr<RouteList> senders);
1017  void add_internal_send (std::shared_ptr<Route>, int, std::shared_ptr<Route>);
1018  void add_internal_send (std::shared_ptr<Route>, std::shared_ptr<Processor>, std::shared_ptr<Route>);
1019 
1020  static void set_disable_all_loaded_plugins (bool yn) {
1021  _disable_all_loaded_plugins = yn;
1022  }
1024  return _disable_all_loaded_plugins;
1025  }
1026  static void set_bypass_all_loaded_plugins (bool yn) {
1027  _bypass_all_loaded_plugins = yn;
1028  }
1030  return _bypass_all_loaded_plugins;
1031  }
1032 
1033  uint32_t next_send_id();
1035  uint32_t next_aux_send_id();
1036  uint32_t next_return_id();
1037  uint32_t next_insert_id();
1038  void mark_send_id (uint32_t);
1039  void mark_surround_send_id (uint32_t);
1040  void mark_aux_send_id (uint32_t);
1041  void mark_return_id (uint32_t);
1042  void mark_insert_id (uint32_t);
1043  void unmark_send_id (uint32_t);
1044  void unmark_surround_send_id (uint32_t);
1045  void unmark_aux_send_id (uint32_t);
1046  void unmark_return_id (uint32_t);
1047  void unmark_insert_id (uint32_t);
1048 
1049  bool vapor_barrier ();
1051 
1052  /* s/w "RAID" management */
1053 
1054  std::optional<samplecnt_t> available_capture_duration();
1055 
1056  /* I/O bundles */
1057 
1058  void add_bundle (std::shared_ptr<Bundle>, bool emit_signal = true);
1059  void remove_bundle (std::shared_ptr<Bundle>);
1060  std::shared_ptr<Bundle> bundle_by_name (std::string) const;
1061 
1063 
1064  void midi_panic ();
1065 
1066  /* History (for editors, mixers, UIs etc.) */
1067 
1071  void undo (uint32_t n);
1075  void redo (uint32_t n);
1076 
1077  PBD::UndoHistory& history() { return _history; }
1078 
1079  uint32_t undo_depth() const { return _history.undo_depth(); }
1080  uint32_t redo_depth() const { return _history.redo_depth(); }
1081  std::string next_undo() const { return _history.next_undo(); }
1082  std::string next_redo() const { return _history.next_redo(); }
1083 
1084 
1085  std::map<PBD::ID,PBD::StatefulDestructible*> registry;
1086 
1087  // these commands are implemented in libs/ardour/session_command.cc
1091 
1092  /* clicking */
1093 
1094  std::shared_ptr<IO> click_io() { return _click_io; }
1095  std::shared_ptr<Amp> click_gain() { return _click_gain; }
1096 
1097  /* disk, buffer loads */
1098 
1099  uint32_t playback_load ();
1100  uint32_t capture_load ();
1101 
1102  /* ranges */
1103 
1104  void request_play_range (std::list<TimelineRange>*, bool leave_rolling = false);
1106  bool get_play_range () const { return _play_range; }
1107 
1109 
1110  /* preroll */
1112 
1115 
1116  samplecnt_t preroll_record_trim_len () const { return _preroll_record_trim_len; }
1117 
1118  /* temporary hacks to allow selection to be pushed from GUI into backend.
1119  Whenever we move the selection object into libardour, these will go away.
1120  */
1125 
1127 
1128  /* buffers for gain and pan */
1129 
1135 
1136  /* VST support */
1137 
1139  static const char* vst_can_do_strings[];
1140  static const int vst_can_do_string_count;
1141 
1142  static intptr_t vst_callback (
1143  AEffect* effect,
1144  int32_t opcode,
1145  int32_t index,
1146  intptr_t value,
1147  void* ptr,
1148  float opt
1149  );
1150 
1151  static PBD::Signal<void()> SendFeedback;
1152 
1153  /* Speakers */
1154 
1155  std::shared_ptr<Speakers> get_speakers ();
1156 
1157  /* Controllables */
1158 
1159  std::shared_ptr<ARDOUR::Trigger> trigger_by_id (PBD::ID) const;
1160 
1161  std::shared_ptr<Processor> processor_by_id (PBD::ID) const;
1162 
1163  std::shared_ptr<PBD::Controllable> controllable_by_id (const PBD::ID&);
1164  std::shared_ptr<AutomationControl> automation_control_by_id (const PBD::ID&);
1165 
1166  void add_controllable (std::shared_ptr<PBD::Controllable>);
1167 
1168  std::shared_ptr<PBD::Controllable> solo_cut_control() const;
1169  std::shared_ptr<PBD::Controllable> recently_touched_controllable () const;
1170 
1171  bool apply_nth_mixer_scene (size_t);
1172  bool apply_nth_mixer_scene (size_t, RouteList const&);
1173  void store_nth_mixer_scene (size_t);
1174  bool nth_mixer_scene_valid (size_t) const;
1175  size_t last_touched_mixer_scene_idx () {return _last_touched_mixer_scene_idx;}
1176 
1177  std::shared_ptr<MixerScene> nth_mixer_scene (size_t, bool create_if_missing = false);
1178  std::vector<std::shared_ptr<MixerScene>> mixer_scenes () const;
1179 
1181 
1182  SessionConfiguration* cfg () { return &config; }
1183 
1184  bool exporting () const {
1185  return _exporting;
1186  }
1187 
1188  bool realtime_export() const {
1189  return _realtime_export;
1190  }
1191 
1192  bool bounce_processing() const {
1193  return _bounce_processing_active;
1194  }
1195 
1196  /* this is a private enum, but setup_enum_writer() needs it,
1197  and i can't find a way to give that function
1198  friend access. sigh.
1199  */
1200 
1202  PostTransportStop = 0x1,
1203  PostTransportLocate = 0x2,
1204  PostTransportAbort = 0x8,
1205  PostTransportOverWrite = 0x10,
1206  PostTransportAudition = 0x20,
1207  PostTransportReverse = 0x40,
1208  PostTransportClearSubstate = 0x80,
1209  PostTransportAdjustPlaybackBuffering = 0x100,
1210  PostTransportAdjustCaptureBuffering = 0x200,
1211  PostTransportLoopChanged = 0x400
1212  };
1213 
1214  std::shared_ptr<SessionPlaylists> playlists () const { return _playlists; }
1215 
1217  void queue_full_time_code () { _send_timecode_update = true; }
1218  void queue_song_position_pointer () { /* currently does nothing */ }
1219 
1220  bool step_editing() const { return (_step_editors > 0); }
1221 
1225 
1226  std::vector<std::string> source_search_path(DataType) const;
1227  void ensure_search_path_includes (const std::string& path, DataType type);
1228  void remove_dir_from_search_path (const std::string& path, DataType type);
1229 
1230  std::list<std::string> unknown_processors () const;
1231 
1232  std::list<std::string> missing_filesources (DataType) const;
1233 
1239 
1244 
1245  /* handlers can return an integer value:
1246  0: config.set_audio_search_path() or config.set_midi_search_path() was used
1247  to modify the search path and we should try to find it again.
1248  1: quit entire session load
1249  2: as 0, but don't ask about other missing files
1250  3: don't ask about other missing files, and just mark this one missing
1251  -1: just mark this one missing
1252  any other value: as -1
1253  */
1254  static PBD::Signal<int(Session*,std::string,DataType)> MissingFile;
1255 
1256  void set_missing_file_replacement (const std::string& mfr) {
1257  _missing_file_replacement = mfr;
1258  }
1259 
1261  static PBD::Signal<void()> Quit;
1262 
1266  static PBD::Signal<void(std::string,std::string)> VersionMismatch;
1267 
1268  SceneChanger* scene_changer() const { return _scene_changer; }
1269 
1270  /* asynchronous MIDI control ports */
1271 
1272  std::shared_ptr<Port> mmc_output_port () const;
1273  std::shared_ptr<Port> mmc_input_port () const;
1274  std::shared_ptr<Port> trigger_input_port () const;
1275  std::shared_ptr<Port> scene_input_port () const;
1276  std::shared_ptr<Port> scene_output_port () const;
1277 
1278  std::shared_ptr<AsyncMIDIPort> vkbd_output_port () const;
1279 
1280  /* synchronous MIDI ports used for synchronization */
1281 
1282  std::shared_ptr<MidiPort> midi_clock_output_port () const;
1283  std::shared_ptr<MidiPort> mtc_output_port () const;
1284  std::shared_ptr<Port> ltc_output_port() const { return _ltc_output_port; }
1285 
1286  MIDI::MachineControl& mmc() { return *_mmc; }
1287 
1289  void reconnect_mmc_ports (bool);
1290 
1292 
1293  VCAManager& vca_manager() { return *_vca_manager; }
1294  VCAManager* vca_manager_ptr() { return _vca_manager; }
1295 
1297 
1301  std::shared_ptr<TransportMaster> transport_master() const;
1302 
1305  bool import_sndfile_as_region (std::string path, SrcQuality quality, timepos_t& pos, SourceList& sources, ImportStatus& status, uint32_t current, uint32_t total);
1306 
1307  struct ptflookup {
1308  uint16_t index1;
1309  uint16_t index2;
1311 
1312  bool operator ==(const struct ptflookup& other) {
1313  return (this->index1 == other.index1);
1314  }
1315  };
1316  std::vector<struct ptflookup> ptfwavpair;
1318 
1320  OverallProcess = 0,
1321  ProcessFunction = 1,
1322  NoRoll = 2,
1323  Roll = 3,
1324  /* end */
1325  NTT = 4
1326  };
1327 
1328  PBD::TimingStats dsp_stats[NTT];
1329 
1330  int32_t first_cue_within (samplepos_t s, samplepos_t e, bool& was_recorded);
1331  void trigger_cue_row (int32_t);
1332  CueEvents const & cue_events() const { return _cue_events; }
1333 
1334  int num_triggerboxes () const;
1335  std::shared_ptr<TriggerBox> triggerbox_at (int32_t route_index) const;
1336  TriggerPtr trigger_at (int32_t route_index, int32_t row_index) const;
1337  bool bang_trigger_at(int32_t route_index, int32_t row_index, float velocity = 1.0);
1338  bool unbang_trigger_at(int32_t route_index, int32_t row_index);
1339  void clear_cue (int row_index);
1340 
1343 
1344  AnyTime global_quantization() const { return _global_quantization; }
1347 
1348 protected:
1349  friend class AudioEngine;
1350  void set_block_size (pframes_t nframes);
1352 
1353  friend class Route;
1354  void update_latency_compensation (bool force, bool called_from_backend);
1355 
1356  /* transport API */
1357 
1358  void locate (samplepos_t, bool for_loop_end=false, bool force=false, bool with_mmc=true);
1359  void stop_transport (bool abort = false, bool clear_state = false);
1360  void start_transport (bool after_loop);
1362  void post_locate ();
1365  bool user_roll_after_locate () const;
1367  samplepos_t position() const { return _transport_sample; }
1368  void set_transport_speed (double speed);
1369  void set_default_play_speed (double spd);
1372 
1373 private:
1374  int create (const std::string& mix_template, BusProfile const *, bool unnamed);
1375  void destroy ();
1376 
1377  static std::atomic<unsigned int> _name_id_counter;
1378  static void init_name_id_counter (unsigned int n);
1379  static unsigned int name_id_counter ();
1380 
1381  std::shared_ptr<SessionPlaylists> _playlists;
1382 
1383  /* stuff used in process() should be close together to
1384  maximise cache hits
1385  */
1386 
1387  typedef void (Session::*process_function_type)(pframes_t);
1388 
1390  process_function_type process_function;
1391  process_function_type last_process_function;
1394  samplecnt_t _base_sample_rate; // sample-rate of the session at creation time, "native" SR
1395  samplecnt_t _current_sample_rate; // this includes video pullup offset
1397  std::atomic<int> _seek_counter;
1398  std::atomic<int> _butler_seek_counter;
1401  bool _silent;
1404 
1405  // varispeed playback -- TODO: move out of session to backend.
1408 
1420  unsigned int _capture_xruns;
1421  unsigned int _export_xruns;
1424  uint32_t _listen_cnt;
1429  unsigned int _xrun_count;
1430 
1432 
1433  mutable std::atomic<int> _processing_prohibited;
1434  mutable std::atomic<RecordState> _record_status;
1435 
1438 
1441 
1442  std::optional<bool> _vapor_available;
1443  std::optional<bool> _vapor_exportable;
1444 
1445  void update_latency (bool playback);
1446  void set_owned_port_public_latency (bool playback);
1447  bool update_route_latency (bool reverse, bool apply_to_delayline, bool* delayline_update_needed);
1451 
1454 
1456 
1460 
1466 
1468 
1470  void unblock_processing() { _processing_prohibited.store (0); }
1471  bool processing_blocked() const { return _processing_prohibited.load (); }
1472 
1474 
1475  /* Transport master DLL */
1476 
1478  Stopped, /* no incoming or invalid signal/data for master to run with */
1479  Waiting, /* waiting to get full lock on incoming signal/data */
1480  Running /* lock achieved, master is generating meaningful speed & position */
1481  };
1482 
1484 
1492  };
1493 
1498  double catch_speed;
1499 
1501  : action (TransportMasterRelax)
1502  , target (0)
1503  , roll_disposition (MustStop)
1504  , catch_speed (0.) {}
1505  };
1506 
1508  double plan_master_strategy (pframes_t nframes, double master_speed, samplepos_t master_transport_sample, double catch_speed);
1509  double plan_master_strategy_engine (pframes_t nframes, double master_speed, samplepos_t master_transport_sample, double catch_speed);
1511 
1513 
1515 
1518 
1524 
1525  std::shared_ptr<ExportHandler> export_handler;
1526  std::shared_ptr<ExportStatus> export_status;
1527 
1528  int pre_export ();
1531  void finalize_export_internal (bool stop_freewheel);
1533 
1535 
1537  int process_routes (pframes_t, bool& need_butler);
1538  int silent_process_routes (pframes_t, bool& need_butler);
1539 
1544  bool maybe_stop (samplepos_t limit);
1546 
1547  std::string _path;
1548  std::string _name;
1549  bool _is_new;
1558 
1559  const std::unique_ptr<SessionDirectory> _session_dir;
1560 
1561  void hookup_io ();
1562  void graph_reordered (bool called_from_backend);
1563 
1565  void set_snapshot_name (const std::string &);
1566  void save_snapshot_name (const std::string &);
1568 
1571 
1572  friend class StateProtector;
1573  std::atomic<int> _suspend_save;
1574  volatile bool _save_queued;
1575  volatile bool _save_queued_pending;
1577 
1578  Glib::Threads::Mutex save_state_lock;
1579  Glib::Threads::Mutex save_source_lock;
1580  Glib::Threads::Mutex peak_cleanup_lock;
1581 
1582  int load_options (const XMLNode&);
1583  int load_state (std::string snapshot_name, bool from_template = false);
1584  static int parse_stateful_loading_version (const std::string&);
1585 
1590 
1593 
1594 #ifdef USE_TLSF
1595  PBD::TLSF _mempool;
1596 #else
1598 #endif
1600  mutable Glib::Threads::Mutex lua_lock;
1601  luabridge::LuaRef * _lua_run;
1602  luabridge::LuaRef * _lua_add;
1603  luabridge::LuaRef * _lua_del;
1604  luabridge::LuaRef * _lua_list;
1605  luabridge::LuaRef * _lua_load;
1606  luabridge::LuaRef * _lua_save;
1607  luabridge::LuaRef * _lua_cleanup;
1608  uint32_t _n_lua_scripts;
1609 
1610  void setup_lua ();
1613 
1615 
1616  std::vector<std::shared_ptr<MixerScene>> _mixer_scenes;
1617  mutable Glib::Threads::RWLock _mixer_scenes_lock;
1618 
1620 
1622 
1623  static const PostTransportWork ProcessCannotProceedMask = PostTransportWork (PostTransportAudition);
1624 
1625  std::atomic<PostTransportWork> _post_transport_work; /* accessed only atomic ops */
1626  PostTransportWork post_transport_work() const { return _post_transport_work.load(); }
1627  void set_post_transport_work (PostTransportWork ptw) { _post_transport_work.store (ptw); }
1629 
1632 
1638 
1639  void update_skips (Location*, bool consolidate);
1640  void update_marks (Location* loc);
1644 
1647 
1652 
1655 
1656  void pre_engine_init (std::string path);
1660 
1662 
1665 
1666  void enable_record ();
1667 
1669  if (max_samplepos - val < _transport_sample) {
1670  _transport_sample = max_samplepos;
1671  } else {
1672  _transport_sample += val;
1673  }
1674  }
1675 
1677  if (val < _transport_sample) {
1678  _transport_sample -= val;
1679  } else {
1680  _transport_sample = 0;
1681  }
1682  }
1683 
1685  static void *session_loader_thread (void *arg);
1686 
1687  void *do_work();
1688 
1689  /* Signal Forwarding */
1692  static void *emit_thread (void *);
1695 
1696  pthread_t _rt_emit_thread;
1698 
1699  pthread_mutex_t _rt_emit_mutex;
1700  pthread_cond_t _rt_emit_cond;
1702 
1703  /* Auto Connect Thread */
1704  static void *auto_connect_thread (void *);
1708 
1710  std::atomic<int> _ac_thread_active;
1711  pthread_mutex_t _auto_connect_mutex;
1712  pthread_cond_t _auto_connect_cond;
1713 
1715  public:
1716  AutoConnectRequest (std::shared_ptr <Route> r,
1717  bool ci, bool co,
1718  const ChanCount& is,
1719  const ChanCount& os,
1720  const ChanCount& io,
1721  const ChanCount& oo)
1722  : route (std::weak_ptr<Route> (r))
1723  , connect_inputs (ci)
1724  , connect_outputs (co)
1725  , input_start (is)
1726  , output_start (os)
1727  , input_offset (io)
1728  , output_offset (oo)
1729  {}
1730 
1731  std::weak_ptr <Route> route;
1738  };
1739 
1740  Glib::Threads::Mutex _update_latency_lock;
1741 
1742  typedef std::queue<AutoConnectRequest> AutoConnectQueue;
1743  Glib::Threads::Mutex _auto_connect_queue_lock;
1745  std::atomic<unsigned int> _latency_recompute_pending;
1746 
1747  void get_physical_ports (std::vector<std::string>& inputs, std::vector<std::string>& outputs, DataType type,
1748  MidiPortFlags include = MidiPortFlags (0),
1749  MidiPortFlags exclude = MidiPortFlags (0));
1750 
1753 
1754  /* SessionEventManager interface */
1755 
1759 
1760  /* MIDI Machine Control */
1761 
1762  void spp_start ();
1763  void spp_continue ();
1764  void spp_stop ();
1765 
1773  void mmc_track_record_status (MIDI::MachineControl &, uint32_t track, bool enabled);
1777  void mmc_shuttle (MIDI::MachineControl &mmc, float speed, bool forw);
1778  void mmc_record_enable (MIDI::MachineControl &mmc, size_t track, bool enabled);
1779 
1781  double step_speed;
1782 
1783  typedef std::function<bool()> MidiTimeoutCallback;
1784  typedef std::list<MidiTimeoutCallback> MidiTimeoutList;
1785 
1789 
1790  MIDI::byte mtc_msg[16];
1791  MIDI::byte mtc_timecode_bits; /* encoding of SMTPE type for MTC */
1792  MIDI::byte midi_msg[16];
1796 
1797  double _samples_per_timecode_frame; /* has to be floating point because of drop sample */
1800 
1801  /* cache the most-recently requested time conversions. This helps when we
1802  * have multiple clocks showing the same time (e.g. the transport sample) */
1806 
1808 
1810 
1813 
1815  int32_t ltc_buf_off;
1816  int32_t ltc_buf_len;
1817 
1818  double ltc_speed;
1819  int32_t ltc_enc_byte;
1821  double ltc_enc_cnt;
1825 
1828 
1831 
1839 
1841 
1842  int no_roll (pframes_t nframes);
1843  int fail_roll (pframes_t nframes);
1844 
1845  bool non_realtime_work_pending() const { return static_cast<bool>(post_transport_work()); }
1846  bool process_can_proceed() const { return !(post_transport_work() & ProcessCannotProceedMask); }
1847 
1849 
1851 
1853 
1854  void set_play_loop (bool yn, bool change_transport_state);
1855  void unset_play_loop (bool change_transport_state = false);
1856  void overwrite_some_buffers (std::shared_ptr<Route>, OverwriteReason);
1858  int micro_locate (samplecnt_t distance);
1859 
1864  };
1865 
1866  std::atomic<PunchLoopLock> _punch_or_loop;
1867  std::atomic<int> _current_usecs_per_track;
1868 
1869  bool punch_active () const;
1870  void unset_punch ();
1872  bool maybe_allow_only_loop (bool play_loop = false);
1874 
1876  void realtime_stop (bool abort, bool clear_state);
1877  void realtime_locate (bool);
1880  void non_realtime_stop (bool abort, int entry_request_count, bool& finished, bool will_locate);
1881  void non_realtime_overwrite (int entry_request_count, bool& finished, bool reset_loop_declicks);
1882  void engine_halted ();
1884  void xrun_recovery ();
1885  void set_track_loop (bool);
1889 
1890  /* These are synchronous and so can only be called from within the process
1891  * cycle
1892  */
1893 
1897 
1898  /* edit/mix groups */
1899 
1900  int load_route_groups (const XMLNode&, int);
1901 
1902  std::list<RouteGroup *> _route_groups;
1904 
1905  /* routes stuff */
1906 
1908 
1909  void add_routes (RouteList&, bool input_auto_connect, bool output_auto_connect, PresentationInfo::order_t);
1910  void add_routes_inner (RouteList&, bool input_auto_connect, bool output_auto_connect, PresentationInfo::order_t);
1915 
1917  bool strict_io,
1918  std::shared_ptr<PluginInfo> instrument,
1919  Plugin::PresetRecord* pset,
1920  ChanCount& existing_outputs
1921  );
1922 
1923  std::shared_ptr<Route> XMLRouteFactory (const XMLNode&, int);
1924  std::shared_ptr<Route> XMLRouteFactory_2X (const XMLNode&, int);
1925  std::shared_ptr<Route> XMLRouteFactory_3X (const XMLNode&, int);
1926 
1928 
1929  bool find_route_name (std::string const &, uint32_t& id, std::string& name, bool);
1931  void auto_connect_route (std::shared_ptr<Route>, bool, bool, const ChanCount&, const ChanCount&, const ChanCount& io = ChanCount(), const ChanCount& oo = ChanCount());
1932  void midi_output_change_handler (IOChange change, void* /*src*/, std::weak_ptr<Route> midi_track);
1933 
1934  /* track numbering */
1935 
1938 
1939  /* solo/mute/notifications */
1940 
1943  void route_solo_changed (bool self_solo_change, PBD::Controllable::GroupControlDisposition group_override, std::weak_ptr<Route>);
1944  void route_solo_isolated_changed (std::weak_ptr<Route>);
1945 
1946  void update_route_solo_state (std::shared_ptr<RouteList const> r = std::shared_ptr<RouteList const>());
1947 
1950 
1951  /* REGION MANAGEMENT */
1952 
1953  mutable Glib::Threads::Mutex region_lock;
1954 
1955  int load_regions (const XMLNode& node);
1956  int load_compounds (const XMLNode& node);
1957 
1958  void route_added_to_route_group (RouteGroup *, std::weak_ptr<Route>);
1959  void route_removed_from_route_group (RouteGroup *, std::weak_ptr<Route>);
1961 
1962  /* SOURCES */
1963 
1964  mutable Glib::Threads::Mutex source_lock;
1965 
1966 public:
1967 
1968  /* Emited when a new source is added to the session */
1969  PBD::Signal< void(std::weak_ptr<Source> )> SourceAdded;
1970  PBD::Signal< void(std::weak_ptr<Source> )> SourceRemoved;
1971 
1972  typedef std::map<PBD::ID,std::shared_ptr<Source> > SourceMap;
1973 
1974  void foreach_source (std::function<void( std::shared_ptr<Source> )> f) {
1975  Glib::Threads::Mutex::Lock ls (source_lock);
1976  for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) {
1977  f ( (*i).second );
1978  }
1979  }
1980 
1981  bool playlist_is_active( std::shared_ptr<Playlist>);
1982  ARDOUR::CueMarkers pending_source_markers; // source markers created while recording
1983 
1984 private:
1985  void reset_write_sources (bool mark_write_complete);
1987 
1988  int load_sources (const XMLNode& node);
1990 
1991  std::shared_ptr<Source> XMLSourceFactory (const XMLNode&);
1992 
1993  /* PLAYLISTS */
1994 
1995  void remove_playlist (std::weak_ptr<Playlist>);
1996  void track_playlist_changed (std::weak_ptr<Track>);
1997  void playlist_region_added (std::weak_ptr<Region>);
1998  void playlist_ranges_moved (std::list<Temporal::RangeMove> const &);
1999  void playlist_regions_extended (std::list<Temporal::Range> const &);
2000 
2001  /* CURVES and AUTOMATION LISTS */
2002  std::map<PBD::ID, AutomationList*> automation_lists;
2003 
2005  std::map<PBD::ID, std::string> _diskstreams_2X;
2006 
2007  /* DEFAULT FADE CURVES */
2008 
2011 
2012  /* AUDITIONING */
2013 
2014  std::shared_ptr<Auditioner> auditioner;
2015  void set_audition (std::shared_ptr<Region>);
2017  std::shared_ptr<Region> pending_audition_region;
2018 
2019  /* EXPORT */
2020 
2021  /* FLATTEN */
2022 
2024 
2025  /* INSERT AND SEND MANAGEMENT */
2026 
2027  boost::dynamic_bitset<uint32_t> send_bitset;
2028  boost::dynamic_bitset<uint32_t> surround_send_bitset;
2029  boost::dynamic_bitset<uint32_t> aux_send_bitset;
2030  boost::dynamic_bitset<uint32_t> return_bitset;
2031  boost::dynamic_bitset<uint32_t> insert_bitset;
2032 
2033  /* S/W RAID */
2034 
2036  uint32_t blocks;
2038  std::string path;
2039 
2041  : blocks (0)
2042  , blocks_unknown (true)
2043  {}
2044  };
2045 
2047  bool operator() (space_and_path a, space_and_path b) {
2048  if (a.blocks_unknown != b.blocks_unknown) {
2049  return !a.blocks_unknown;
2050  }
2051  return a.blocks > b.blocks;
2052  }
2053  };
2054 
2055  void setup_raid_path (std::string path);
2056 
2057  std::vector<space_and_path> session_dirs;
2058  std::vector<space_and_path>::iterator last_rr_session_dir;
2065  Glib::Threads::Mutex space_lock;
2066 
2068 
2070 
2071  mutable std::atomic<int> _playback_load;
2072  mutable std::atomic<int> _capture_load;
2073 
2074  /* I/O bundles */
2075 
2078  int load_bundles (XMLNode const &);
2079 
2081 
2083 
2084  enum snapshot_t {
2087  SwitchToSnapshot
2088  };
2089 
2090  XMLNode& state (bool save_template,
2091  snapshot_t snapshot_type = NormalSave,
2092  bool for_archive = false,
2093  bool only_used_assets = false) const;
2094 
2095  XMLNode& get_state () const;
2096  int set_state (const XMLNode& node, int version); // not idempotent
2098 
2099  bool maybe_copy_midifile (snapshot_t, std::shared_ptr<Source> src, XMLNode*);
2100 
2101  void collect_sources_of_this_snapshot (std::set<std::shared_ptr<Source>>&, bool incl_unused = true) const;
2102 
2103  /* click track */
2104  typedef std::list<Click*> Clicks;
2108  std::shared_ptr<IO> _click_io;
2109  std::shared_ptr<Amp> _click_gain;
2114  mutable Glib::Threads::RWLock click_lock;
2118 
2119  static const Sample default_click[];
2121  static const Sample default_click_emphasis[];
2123 
2127  void setup_click_sounds (int which);
2128  void setup_click_sounds (Sample**, Sample const *, samplecnt_t*, samplecnt_t, std::string const &);
2129  void clear_clicks ();
2132  void add_click (samplepos_t pos, bool emphasis);
2134 
2135  /* range playback */
2136 
2137  std::list<TimelineRange> current_audio_range;
2139  void set_play_range (std::list<TimelineRange>&, bool leave_rolling);
2141 
2142  /* temporary hacks to allow selection to be pushed from GUI into backend
2143  Whenever we move the selection object into libardour, these will go away.
2144  */
2147 
2149 
2152 
2153  /* main outs */
2154  uint32_t main_outs;
2155 
2156  std::shared_ptr<Route> _master_out;
2157  std::shared_ptr<Route> _monitor_out;
2158  std::shared_ptr<Route> _surround_master;
2159 
2160  friend class PortManager;
2164  void auto_connect_io (std::shared_ptr<IO>);
2165 
2166  void setup_route_monitor_sends (bool enable, bool need_process_lock);
2167  void setup_route_surround_sends (bool enable, bool need_process_lock);
2168 
2169  int find_all_sources (std::string path, std::set<std::string>& result);
2170  int find_all_sources_across_snapshots (std::set<std::string>& result, bool exclude_this_snapshot);
2171 
2172  typedef std::set<std::shared_ptr<PBD::Controllable> > Controllables;
2173  Glib::Threads::Mutex controllables_lock;
2175 
2176  std::shared_ptr<PBD::Controllable> _solo_cut_control;
2177 
2178  void controllable_touched (std::weak_ptr<PBD::Controllable>);
2179  std::weak_ptr<PBD::Controllable> _recently_touched_controllable;
2180 
2184 
2185  void config_changed (std::string, bool);
2186 
2188 
2189  void set_history_depth (uint32_t depth);
2190 
2193 
2194  mutable bool have_looped;
2195 
2197  std::atomic<int> _have_rec_enabled_track;
2198  std::atomic<int> _have_rec_disabled_track;
2199 
2200  static int ask_about_playlist_deletion (std::shared_ptr<Playlist>);
2201 
2202  /* realtime "apply to set of routes" operations */
2203  template<typename T> SessionEvent*
2204  get_rt_event (std::shared_ptr<RouteList const> rl, T targ, SessionEvent::RTeventCallback after, PBD::Controllable::GroupControlDisposition group_override,
2205  void (Session::*method) (std::shared_ptr<RouteList const>, T, PBD::Controllable::GroupControlDisposition)) {
2207  ev->rt_slot = std::bind (method, this, rl, targ, group_override);
2208  ev->rt_return = after;
2210 
2211  return ev;
2212  }
2213 
2214  /* specialized version realtime "apply to set of routes" operations */
2215  template<typename T1, typename T2> SessionEvent*
2216  get_rt_event (std::shared_ptr<RouteList const> rl, T1 t1arg, T2 t2arg, SessionEvent::RTeventCallback after, PBD::Controllable::GroupControlDisposition group_override,
2217  void (Session::*method) (std::shared_ptr<RouteList const>, T1, T2, PBD::Controllable::GroupControlDisposition)) {
2219  ev->rt_slot = std::bind (method, this, rl, t1arg, t2arg, group_override);
2220  ev->rt_return = after;
2222 
2223  return ev;
2224  }
2225 
2226  /* specialized version realtime "apply to set of controls" operations */
2227  SessionEvent* get_rt_event (std::shared_ptr<WeakAutomationControlList> cl, double arg, PBD::Controllable::GroupControlDisposition group_override) {
2229  ev->rt_slot = std::bind (&Session::rt_set_controls, this, cl, arg, group_override);
2232 
2233  return ev;
2234  }
2235 
2236  void rt_set_controls (std::shared_ptr<WeakAutomationControlList>, double val, PBD::Controllable::GroupControlDisposition group_override);
2237  void rt_clear_all_solo_state (std::shared_ptr<RouteList const>, bool yn, PBD::Controllable::GroupControlDisposition group_override);
2238 
2240 
2242  uint32_t _step_editors;
2243 
2245  mutable std::atomic<int> _suspend_timecode_transmission;
2246 
2249 
2252 
2253  std::shared_ptr<Speakers> _speakers;
2254  void load_nested_sources (const XMLNode& node);
2255 
2260 
2261  friend class IOPlug;
2262  std::shared_ptr<Graph> _process_graph;
2263  std::shared_ptr<GraphChain> _graph_chain;
2264  std::shared_ptr<GraphChain> _io_graph_chain[2];
2265 
2266  void resort_routes_using (std::shared_ptr<RouteList>);
2268 
2271 
2273 
2277 
2279 
2280  std::shared_ptr<Port> _ltc_output_port;
2281 
2282  std::shared_ptr<RTTaskList> _rt_tasklist;
2283  std::shared_ptr<IOTaskList> _io_tasklist;
2284 
2285  /* Scene Changing */
2287 
2288  /* persistent, non-track related MIDI ports */
2291 
2292  void setup_ltc ();
2293  void setup_click ();
2295  void setup_bundles ();
2296 
2299 
2300  void save_as_bring_callback (uint32_t, uint32_t, std::string);
2301 
2302  static const uint32_t session_end_shift;
2303 
2304  std::string _template_state_dir;
2305 
2307 
2308  std::shared_ptr<Route> get_midi_nth_route_by_id (PresentationInfo::order_t n) const;
2309 
2310  std::string created_with;
2311  mutable std::string modified_with;
2312 
2313  void midi_track_presentation_info_changed (PBD::PropertyChange const &, std::weak_ptr<MidiTrack>);
2314  void rewire_selected_midi (std::shared_ptr<MidiTrack>);
2316  void disconnect_port_for_rewire (std::string const& port) const;
2317  std::weak_ptr<MidiTrack> current_midi_target;
2318 
2319  StripableList _soloSelection; //the items that are soloe'd during a solo-selection operation; need to unsolo after the roll
2320 
2322 
2324  std::optional<samplepos_t> _nominal_jack_transport_sample;
2325 
2327 
2328  std::string unnamed_file_name () const;
2329 
2330  std::atomic<int> _update_pretty_names;
2331 
2334 
2336  bool operator() (CueEvent const & c, samplepos_t s) {
2337  return c.time < s;
2338  }
2339  };
2340 
2342  void sync_cues ();
2344 
2345  std::atomic<int32_t> _pending_cue;
2346  std::atomic<int32_t> _active_cue;
2349 
2351  void handle_slots_empty_status (std::weak_ptr<Route> const &);
2352 
2354 
2356 };
2357 
2358 
2359 } // namespace ARDOUR
2360 
static const ChanCount ZERO
Definition: chan_count.h:208
std::list< Location * > LocationList
Definition: location.h:251
static const Flag MixerStripables
static const Flag MixerRoutes
std::function< void(SessionEvent *)> RTeventCallback
RTeventCallback rt_return
std::function< void(void)> rt_slot
static const samplepos_t Immediate
PBD::EventLoop * event_loop
virtual ~SessionException()
Definition: session.h:196
std::string _message
Definition: session.h:201
SessionException(const std::string msg)
Definition: session.h:195
virtual const char * what() const
Definition: session.h:198
ProcessorChangeBlocker(Session *s, bool rc=true)
void process_without_events(pframes_t)
void add_internal_sends(std::shared_ptr< Route > dest, Placement p, std::shared_ptr< RouteList > senders)
int send_midi_time_code_for_cycle(samplepos_t, samplepos_t, pframes_t nframes)
std::string created_with
Definition: session.h:2310
PBD::Signal< void(RouteList &)> RouteAdded
Definition: session.h:456
void clear_all_solo_state(std::shared_ptr< RouteList const >)
void mark_surround_send_id(uint32_t)
luabridge::LuaRef * _lua_load
Definition: session.h:1605
std::shared_ptr< Route > route_by_name(std::string) const
int load_regions(const XMLNode &node)
std::shared_ptr< Auditioner > the_auditioner()
Definition: session.h:919
void emit_thread_start()
std::shared_ptr< Stripable > get_remote_nth_stripable(PresentationInfo::order_t n, PresentationInfo::Flag) const
int next_quarter_frame_to_send
Definition: session.h:1795
std::map< PBD::ID, std::shared_ptr< Source > > SourceMap
Definition: session.h:1972
SceneChanger * scene_changer() const
Definition: session.h:1268
std::atomic< int > _ignore_route_processor_changes
Definition: session.h:2275
const std::unique_ptr< SessionDirectory > _session_dir
Definition: session.h:1559
void route_added_to_route_group(RouteGroup *, std::weak_ptr< Route >)
std::shared_ptr< IOTaskList > io_tasklist()
Definition: session.h:336
bool follow_transport_master(pframes_t nframes)
Glib::Threads::Mutex space_lock
Definition: session.h:2065
void step_back_from_record()
PBD::ScopedConnectionList loop_connections
Definition: session.h:1653
boost::dynamic_bitset< uint32_t > aux_send_bitset
Definition: session.h:2029
std::shared_ptr< Route > master_out() const
Definition: session.h:1005
bool loop_is_possible() const
void add_surround_master()
std::queue< AutoConnectRequest > AutoConnectQueue
Definition: session.h:1742
std::shared_ptr< Bundle > bundle_by_name(std::string) const
static std::vector< std::string > possible_states(std::string path)
void setup_route_surround_sends(bool enable, bool need_process_lock)
void realtime_locate(bool)
PBD::UndoHistory & history()
Definition: session.h:1077
samplecnt_t preroll_samples(samplepos_t) const
PBD::Signal< void(bool)> SoloActive
Definition: session.h:988
bool _rt_emit_pending
Definition: session.h:1701
void remove_surround_master()
float default_fade_msecs
Definition: session.h:2010
samplecnt_t _worst_route_latency
Definition: session.h:1414
void click(samplepos_t start, samplecnt_t nframes)
void auto_punch_changed(Location *)
void send_ltc_for_cycle(samplepos_t, samplepos_t, pframes_t)
void sync_source_changed(SyncSource, samplepos_t pos, pframes_t cycle_nframes)
void stop_transport(bool abort=false, bool clear_state=false)
void end_unnamed_status() const
void timecode_duration_string(char *, size_t len, samplecnt_t) const
bool solo_isolated() const
Definition: session.h:970
void audition_playlist()
pan_t ** pan_automation_buffer() const
void process(pframes_t nframes)
TriggerPtr trigger_at(int32_t route_index, int32_t row_index) const
void unset_play_loop(bool change_transport_state=false)
CoreSelection * _selection
Definition: session.h:2321
std::map< PBD::ID, std::string > _diskstreams_2X
Definition: session.h:2005
std::shared_ptr< Graph > _process_graph
Definition: session.h:2262
void set_session_extents(timepos_t const &start, timepos_t const &end)
bool import_sndfile_as_region(std::string path, SrcQuality quality, timepos_t &pos, SourceList &sources, ImportStatus &status, uint32_t current, uint32_t total)
samplecnt_t _remaining_latency_preroll
Definition: session.h:1402
XMLNode * instant_xml(const std::string &str)
samplecnt_t remaining_latency_preroll() const
Definition: session.h:774
void maybe_find_pending_cue()
void load_io_plugin(std::shared_ptr< IOPlug >)
int restore_state(std::string snapshot_name)
std::shared_ptr< TransportMaster > transport_master() const
void try_run_lua(pframes_t)
void resort_io_plugs()
XMLNode & get_sources_as_xml()
bool _ignore_skips_updates
Definition: session.h:1646
void mark_aux_send_id(uint32_t)
uint64_t _total_free_4k_blocks
Definition: session.h:2059
double timecode_frames_per_second() const
void set_owned_port_public_latency(bool playback)
int fail_roll(pframes_t nframes)
bool in_cleanup() const
Definition: session.h:256
void request_default_play_speed(double speed, TransportRequestSource origin=TRS_UI)
void run_click(samplepos_t start, samplecnt_t nframes)
bool no_questions_about_missing_files
Definition: session.h:2067
int32_t first_cue_within(samplepos_t s, samplepos_t e, bool &was_recorded)
std::atomic< int > _update_pretty_names
Definition: session.h:2330
PBD::Signal< void()> DirtyChanged
Definition: session.h:263
PBD::Signal< void(samplepos_t)> Xrun
Definition: session.h:450
void request_transport_speed_nonzero(double, TransportRequestSource origin=TRS_UI)
std::string raid_path() const
Location * _session_range_location
session range, or 0 if there is nothing in the session yet
Definition: session.h:1399
void follow_playhead_priority()
void request_stop(bool abort=false, bool clear_state=false, TransportRequestSource origin=TRS_UI)
double samples_per_timecode_frame() const
Definition: session.h:530
bool step_editing() const
Definition: session.h:1220
void auto_loop_changed(Location *)
static unsigned int name_id_counter()
Locations * locations()
Definition: session.h:542
void reset_write_sources(bool mark_write_complete)
static PBD::Signal< void(samplepos_t)> StartTimeChanged
Definition: session.h:802
static PBD::Signal< void(std::string, std::string)> VersionMismatch
Definition: session.h:1266
Glib::Threads::Mutex save_state_lock
Definition: session.h:1578
BufferSet & get_mix_buffers(ChanCount count=ChanCount::ZERO)
CueEvents const & cue_events() const
Definition: session.h:1332
int load_state(std::string snapshot_name, bool from_template=false)
void finalize_export_internal(bool stop_freewheel)
void use_rf_shuttle_speed()
bool auto_play_legal
Definition: session.h:1409
bool plot_process_graph(std::string const &file_name) const
std::shared_ptr< MidiSource > midi_source_by_path(const std::string &, bool need_source_lock) const
std::list< Click * > Clicks
Definition: session.h:2104
std::string new_audio_source_path(const std::string &, uint32_t nchans, uint32_t chan, bool take_required)
void mtc_tx_resync_latency(bool)
bool transport_stopped() const
void non_realtime_set_speed()
pframes_t get_block_size() const
Definition: session.h:554
void auto_connect(const AutoConnectRequest &)
bool select_playhead_priority_target(samplepos_t &)
BufferSet & get_silent_buffers(ChanCount count=ChanCount::ZERO)
std::shared_ptr< Route > _monitor_out
Definition: session.h:2157
void remove_dir_from_search_path(const std::string &path, DataType type)
bool _region_export
Definition: session.h:1522
std::shared_ptr< Source > source_by_id(const PBD::ID &)
std::shared_ptr< Route > XMLRouteFactory(const XMLNode &, int)
bool ltc_timecode_negative_offset
Definition: session.h:1827
void undo(uint32_t n)
samplecnt_t worst_output_latency() const
Definition: session.h:555
SceneChanger * _scene_changer
Definition: session.h:2286
void add_internal_send(std::shared_ptr< Route >, int, std::shared_ptr< Route >)
void cleanup_event(SessionEvent *, int)
uint32_t next_insert_id()
void request_roll_at_and_return(samplepos_t start, samplepos_t return_to)
void step_edit_status_change(bool)
PBD::ScopedConnectionList ltc_tx_connections
Definition: session.h:1838
void set_snapshot_name(const std::string &)
std::atomic< int > _current_usecs_per_track
Definition: session.h:1867
static const samplecnt_t default_click_emphasis_length
Definition: session.h:2122
void mmc_record_strobe(MIDI::MachineControl &)
void set_transport_speed(double speed)
void trigger_cue_row(int32_t)
bool _route_deletion_in_progress
Definition: session.h:1913
samplecnt_t sample_rate() const
Definition: session.h:525
bool maybe_sync_start(pframes_t &)
void maybe_write_autosave()
void disable_record(bool rt_context, bool force=false)
int stop_audio_export()
PBD::Signal< void()> SoloChanged
Definition: session.h:989
static intptr_t vst_callback(AEffect *effect, int32_t opcode, int32_t index, intptr_t value, void *ptr, float opt)
bool record_enabling_legal() const
int freeze_all(InterThreadInfo &)
uint32_t next_aux_send_id()
bool audio_source_name_is_unique(const std::string &name)
void setup_click_sounds(Sample **, Sample const *, samplecnt_t *, samplecnt_t, std::string const &)
bool exporting() const
Definition: session.h:1184
void set_worst_input_latency()
void pre_engine_init(std::string path)
int64_t _last_mmc_step
Definition: session.h:1780
bool _had_destructive_tracks
Definition: session.h:2326
process_function_type process_function
Definition: session.h:1390
static const samplecnt_t bounce_chunk_size
Definition: session.h:1473
void update_route_record_state()
void process_audition(pframes_t)
PBD::Signal< void()> LuaScriptsChanged
Definition: session.h:934
int load_bundles(XMLNode const &)
const SessionDirectory & session_directory() const
Definition: session.h:265
void setup_route_monitor_sends(bool enable, bool need_process_lock)
std::map< PBD::ID, AutomationList * > automation_lists
Definition: session.h:2002
void import_pt_sources(PTFFormat &ptf, ImportStatus &status)
void process_export_fw(pframes_t)
void unregister_lua_function(const std::string &name)
void controllable_touched(std::weak_ptr< PBD::Controllable >)
std::shared_ptr< AudioFileSource > create_audio_source_for_session(size_t, std::string const &, uint32_t)
TransportFSM * _transport_fsm
Definition: session.h:1621
bool nth_mixer_scene_valid(size_t) const
ltcsnd_sample_t * ltc_enc_buf
Definition: session.h:1812
PBD::Signal< void()> BundleAddedOrRemoved
Definition: session.h:1062
void reconnect_mmc_ports(bool)
uint32_t ntracks() const
std::string next_undo() const
Definition: session.h:1081
double default_play_speed()
int load_options(const XMLNode &)
std::set< std::shared_ptr< PBD::Controllable > > Controllables
Definition: session.h:2172
void remove_bundle(std::shared_ptr< Bundle >)
bool non_realtime_work_pending() const
Definition: session.h:1845
Temporal::Range _range_selection
Definition: session.h:2145
void request_suspend_timecode_transmission()
int process_routes(pframes_t, bool &need_butler)
void add_routes(RouteList &, bool input_auto_connect, bool output_auto_connect, PresentationInfo::order_t)
std::string _missing_file_replacement
Definition: session.h:1431
samplepos_t master_wait_end
Definition: session.h:1483
void send_mclk_for_cycle(samplepos_t, samplepos_t, pframes_t, samplecnt_t)
bool _total_free_4k_blocks_uncertain
Definition: session.h:2064
double _samples_per_timecode_frame
Definition: session.h:1797
uint32_t _n_lua_scripts
Definition: session.h:1608
MIDI::MachineControl & mmc()
Definition: session.h:1286
void mmc_deferred_play(MIDI::MachineControl &)
samplepos_t last_loopend
Definition: session.h:1557
void auto_punch_end_changed(Location *)
Timecode::Time last_timecode
Definition: session.h:1805
MidiClockTicker * midi_clock
Definition: session.h:2278
std::list< std::shared_ptr< AudioTrack > > new_audio_track(int input_channels, int output_channels, RouteGroup *route_group, uint32_t how_many, std::string name_template, PresentationInfo::order_t order, TrackMode mode=Normal, bool input_auto_connect=true, bool trigger_visibility=false)
TransportMasterStrategy transport_master_strategy
Definition: session.h:1507
void non_realtime_stop(bool abort, int entry_request_count, bool &finished, bool will_locate)
std::shared_ptr< Auditioner > auditioner
Definition: session.h:2014
std::shared_ptr< MidiPort > midi_clock_output_port() const
void set_range_selection(Temporal::timepos_t const &start, Temporal::timepos_t const &end)
std::shared_ptr< RTTaskList > _rt_tasklist
Definition: session.h:2282
bool inital_connect_or_deletion_in_progress() const
Definition: session.h:257
std::string get_best_session_directory_for_new_audio()
void locate(samplepos_t, bool for_loop_end=false, bool force=false, bool with_mmc=true)
std::string _name
Definition: session.h:1548
bool transport_rolling() const
bool timecode_transmission_suspended() const
timepos_t current_start() const
std::shared_ptr< Route > route_by_selected_count(uint32_t cnt) const
double _engine_speed
Definition: session.h:1406
PBD::Signal< void()> SurroundMasterAddedOrRemoved
Definition: session.h:994
void butler_completed_transport_work()
RouteGroup * _all_route_group
Definition: session.h:1903
void load_and_connect_instruments(RouteList &, bool strict_io, std::shared_ptr< PluginInfo > instrument, Plugin::PresetRecord *pset, ChanCount &existing_outputs)
bool compute_audible_delta(samplepos_t &pos_and_delta) const
bool declick_in_progress() const
void request_roll(TransportRequestSource origin=TRS_UI)
static void set_disable_all_loaded_plugins(bool yn)
Definition: session.h:1020
bool writable() const
Definition: session.h:242
bool maybe_stop(samplepos_t limit)
MidiControlUI * midi_control_ui
Definition: session.h:1848
samplepos_t _last_record_location
Definition: session.h:1589
std::shared_ptr< Region > XMLRegionFactory(const XMLNode &, bool full)
std::optional< samplepos_t > const & nominal_jack_transport_sample()
Definition: session.h:771
PBD::Signal< void()> PunchLoopConstraintChange
Definition: session.h:831
PBD::Signal< void()> MtcOrLtcInputPortChanged
Definition: session.h:478
std::shared_ptr< RouteList > get_routes_with_regions_at(timepos_t const &) const
@ TransportMasterLocate
Definition: session.h:1488
@ TransportMasterRelax
Definition: session.h:1486
@ TransportMasterNoRoll
Definition: session.h:1487
@ TransportMasterStart
Definition: session.h:1489
std::list< std::shared_ptr< MidiTrack > > new_midi_track(const ChanCount &input, const ChanCount &output, bool strict_io, std::shared_ptr< PluginInfo > instrument, Plugin::PresetRecord *pset, RouteGroup *route_group, uint32_t how_many, std::string name_template, PresentationInfo::order_t, TrackMode mode, bool input_auto_connect, bool trigger_visibility=false)
void rt_clear_all_solo_state(std::shared_ptr< RouteList const >, bool yn, PBD::Controllable::GroupControlDisposition group_override)
std::shared_ptr< RouteList > get_routes_with_internal_returns() const
std::string format_audio_source_name(const std::string &legalized_base, uint32_t nchan, uint32_t chan, bool take_required, uint32_t cnt, bool related_exists)
static std::string default_track_name_pattern(DataType)
bool routes_deletion_in_progress() const
Definition: session.h:250
void update_send_delaylines()
int bring_all_sources_into_session(std::function< void(uint32_t, uint32_t, std::string)> callback)
bool io_name_is_legal(const std::string &) const
samplepos_t _transport_sample
Definition: session.h:1396
std::shared_ptr< MidiSource > create_midi_source_for_session(std::string const &)
void non_realtime_overwrite(int entry_request_count, bool &finished, bool reset_loop_declicks)
std::shared_ptr< RTTaskList > rt_tasklist()
Definition: session.h:335
XMLTree * state_tree
Definition: session.h:1569
std::string plugins_dir() const
Plugin state.
bool apply_nth_mixer_scene(size_t)
std::shared_ptr< ARDOUR::Trigger > trigger_by_id(PBD::ID) const
float default_fade_steepness
Definition: session.h:2009
void session_loaded()
std::list< TimelineRange > current_audio_range
Definition: session.h:2137
void remove_pending_capture_state()
AnyTime global_quantization() const
Definition: session.h:1344
void process_export(pframes_t)
bool listening() const
int save_history(std::string snapshot_name="")
void ensure_buffers(ChanCount howmany=ChanCount::ZERO)
void mmc_locate(MIDI::MachineControl &, const MIDI::byte *)
void mmc_pause(MIDI::MachineControl &)
bool pending_auto_loop
Definition: session.h:1592
std::shared_ptr< SessionPlaylists > _playlists
Definition: session.h:1381
std::shared_ptr< AsyncMIDIPort > vkbd_output_port() const
std::shared_ptr< IOPlug > nth_io_plug(uint32_t n)
Definition: session.h:942
void route_solo_changed(bool self_solo_change, PBD::Controllable::GroupControlDisposition group_override, std::weak_ptr< Route >)
samplecnt_t _count_in_samples
Definition: session.h:2126
samplecnt_t calc_preroll_subcycle(samplecnt_t) const
bool first_file_data_format_reset
Definition: session.h:2182
void sample_to_timecode(samplepos_t sample, Timecode::Time &timecode, bool use_offset, bool use_subframes) const
void resort_routes_using(std::shared_ptr< RouteList >)
void set_worst_output_latency()
void clear_cue(int row_index)
PBD::Signal< void()> SessionLoaded
Definition: session.h:436
double compute_speed_from_master(pframes_t nframes)
std::optional< samplecnt_t > available_capture_duration()
std::string build_tmp_convert_name(std::string file)
MIDI::byte get_mtc_timecode_bits() const
Definition: session.h:533
double plan_master_strategy_engine(pframes_t nframes, double master_speed, samplepos_t master_transport_sample, double catch_speed)
std::atomic< unsigned int > _latency_recompute_pending
Definition: session.h:1745
std::shared_ptr< Route > XMLRouteFactory_2X(const XMLNode &, int)
void unset_preroll_record_trim()
void get_track_statistics()
bool should_roll_after_locate() const
RecordState record_status() const
Definition: session.h:402
static const samplecnt_t default_click_length
Definition: session.h:2120
std::shared_ptr< ExportStatus > get_export_status()
std::list< RouteGroup * > _route_groups
Definition: session.h:1902
PBD::Signal< void(bool)> StepEditStatusChange
Definition: session.h:475
void rewire_selected_midi(std::shared_ptr< MidiTrack >)
void collect_sources_of_this_snapshot(std::set< std::shared_ptr< Source >> &, bool incl_unused=true) const
void set_exclusive_input_active(std::shared_ptr< RouteList > rt, bool onoff, bool flip_others=false)
samplepos_t _requested_return_sample
Definition: session.h:1410
int tb_with_filled_slots
Definition: session.h:2350
std::weak_ptr< MidiTrack > current_midi_target
Definition: session.h:2317
int32_t ltc_buf_len
Definition: session.h:1816
SessionEvent * get_rt_event(std::shared_ptr< RouteList const > rl, T1 t1arg, T2 t2arg, SessionEvent::RTeventCallback after, PBD::Controllable::GroupControlDisposition group_override, void(Session::*method)(std::shared_ptr< RouteList const >, T1, T2, PBD::Controllable::GroupControlDisposition))
Definition: session.h:2216
void globally_set_send_gains_to_unity(std::shared_ptr< Route > dest)
PBD::ScopedConnectionList punch_connections
Definition: session.h:1648
void add_automation_list(AutomationList *)
void set_deletion_in_progress()
void playlist_ranges_moved(std::list< Temporal::RangeMove > const &)
void globally_set_send_gains_to_zero(std::shared_ptr< Route > dest)
void end_time_changed(samplepos_t)
bool have_looped
Used in audible_sample.
Definition: session.h:2194
bool _rt_thread_active
Definition: session.h:1697
static void init_name_id_counter(unsigned int n)
void reset_native_file_format()
bool _update_send_delaylines
Definition: session.h:1417
void ltc_tx_resync_latency(bool)
Timecode::Time transmitting_timecode_time
Definition: session.h:1794
void maybe_enable_record(bool rt_context=false)
samplepos_t audible_sample(bool *latent_locate=NULL) const
void scripts_changed()
double actual_speed() const
int32_t ltc_buf_off
Definition: session.h:1815
void queue_event(SessionEvent *)
boost::dynamic_bitset< uint32_t > insert_bitset
Definition: session.h:2031
PBD::Signal< void()> RecordStateChanged
Definition: session.h:427
void remove_playlist(std::weak_ptr< Playlist >)
bool _reconnecting_routes_in_progress
Definition: session.h:1912
std::shared_ptr< PBD::Controllable > recently_touched_controllable() const
static PBD::Signal< void(samplepos_t)> EndTimeChanged
Definition: session.h:803
std::shared_ptr< Amp > _click_gain
Definition: session.h:2109
samplecnt_t worst_input_latency() const
Definition: session.h:556
bool locate_initiated() const
void request_bounded_roll(samplepos_t start, samplepos_t end)
void redo(uint32_t n)
bool _have_captured
Definition: session.h:1418
void send_song_position_pointer(samplepos_t)
samplecnt_t nominal_sample_rate() const
Definition: session.h:527
std::string externals_dir() const
Links to external files.
int archive_session(const std::string &, const std::string &, ArchiveEncode compress_audio=FLAC_16BIT, PBD::FileArchive::CompressionLevel compression_level=PBD::FileArchive::CompressGood, bool only_used_sources=false, PBD::Progress *p=0)
void set_history_depth(uint32_t depth)
bool transport_state_rolling() const
void cut_copy_section(Temporal::timepos_t const &start, Temporal::timepos_t const &end, Temporal::timepos_t const &to, SectionOperation const op)
double _signalled_varispeed
Definition: session.h:1407
std::atomic< int > _playback_load
Definition: session.h:2071
void load_nested_sources(const XMLNode &node)
uint32_t undo_depth() const
Definition: session.h:1079
std::string path() const
Definition: session.h:236
void request_transport_speed(double speed, TransportRequestSource origin=TRS_UI)
luabridge::LuaRef * _lua_cleanup
Definition: session.h:1607
std::shared_ptr< Port > ltc_output_port() const
Definition: session.h:1284
void mmc_rewind(MIDI::MachineControl &)
bool processing_blocked() const
Definition: session.h:1471
RouteList new_midi_route(RouteGroup *route_group, uint32_t how_many, std::string name_template, bool strict_io, std::shared_ptr< PluginInfo > instrument, Plugin::PresetRecord *, PresentationInfo::Flag, PresentationInfo::order_t)
pthread_cond_t _rt_emit_cond
Definition: session.h:1700
void playlist_region_added(std::weak_ptr< Region >)
static PBD::Signal< void()> AfterConnect
Definition: session.h:899
samplecnt_t _capture_duration
Definition: session.h:1419
int post_engine_init()
std::atomic< int > _have_rec_enabled_track
Definition: session.h:2197
void save_snapshot_name(const std::string &)
void register_lua_function(const std::string &, const std::string &, const LuaScriptParamList &)
void send_mmc_locate(samplepos_t)
boost::dynamic_bitset< uint32_t > surround_send_bitset
Definition: session.h:2028
bool cannot_save() const
Definition: session.h:255
samplepos_t current_end_sample() const
void add_bundle(std::shared_ptr< Bundle >, bool emit_signal=true)
void set_audition(std::shared_ptr< Region >)
bool _non_soloed_outs_muted
Definition: session.h:1422
SessionConfiguration config
Definition: session.h:1180
std::shared_ptr< TriggerBox > triggerbox_at(int32_t route_index) const
bool need_declick_before_locate() const
void force_locate(samplepos_t sample, LocateTransportDisposition)
void enable_record()
static PBD::Signal< int()> AskAboutPendingState
Definition: session.h:892
bool is_auditioning() const
int rename(const std::string &)
PBD::Signal< void()> QuantizationChanged
Definition: session.h:1346
void setup_engine_resampling()
void clear_deletion_in_progress()
void setup_thread_local_variables()
std::shared_ptr< IOPlugList const > io_plugs() const
Definition: session.h:950
PBD::Signal< void()> IOConnectionsComplete
Definition: session.h:423
bool transport_master_no_external_or_using_engine() const
unsigned int _capture_xruns
Definition: session.h:1420
luabridge::LuaRef * _lua_add
Definition: session.h:1602
void store_nth_mixer_scene(size_t)
void trigger_stop_all(bool now=true)
void request_cancel_play_range()
void update_latency(bool playback)
void send_latency_compensation_change()
bool last_timecode_valid
Definition: session.h:1803
void ensure_route_presentation_info_gap(PresentationInfo::order_t, uint32_t gap_size)
std::shared_ptr< Route > route_by_id(PBD::ID) const
Sample * click_data
Definition: session.h:2110
std::string new_midi_source_path(const std::string &, bool need_source_lock=true)
void auto_connect_monitor_bus()
std::atomic< int32_t > _pending_cue
Definition: session.h:2345
void initialize_latencies()
bool _click_rec_only
Definition: session.h:2107
samplecnt_t capture_duration() const
Definition: session.h:320
int create(const std::string &mix_template, BusProfile const *, bool unnamed)
void mark_insert_id(uint32_t)
void emit_thread_terminate()
PBD::Signal< void()> MuteChanged
Definition: session.h:990
bool loop_changing
Definition: session.h:1556
pframes_t _pframes_since_last_mtc
Definition: session.h:1554
std::shared_ptr< PBD::Controllable > solo_cut_control() const
std::list< std::string > missing_filesources(DataType) const
void consolidate_skips(Location *)
int cleanup_peakfiles()
bool rechain_ioplug_graph(bool)
PBD::Signal< void(std::string)> StateSaved
Definition: session.h:634
void add_internal_send(std::shared_ptr< Route >, std::shared_ptr< Processor >, std::shared_ptr< Route >)
bool ensure_stripable_sort_order()
void solo_selection(StripableList &, bool)
static unsigned int next_name_id()
void probe_ctrl_surfaces()
void prepare_momentary_solo(SoloMuteRelease *smr=NULL, bool exclusive=false, std::shared_ptr< Route > route=std::shared_ptr< Route >())
double ltc_speed
Definition: session.h:1818
void _locations_changed(const Locations::LocationList &)
void auto_connect_thread_run()
boost::dynamic_bitset< uint32_t > return_bitset
Definition: session.h:2030
void setup_midi_control()
bool should_stop_before_locate() const
int silent_process_routes(pframes_t, bool &need_butler)
std::string snap_name() const
Definition: session.h:238
gain_t * gain_automation_buffer() const
void import_files(ImportStatus &)
void handle_slots_empty_status(std::weak_ptr< Route > const &)
std::shared_ptr< Amp > click_gain()
Definition: session.h:1095
void reset_record_status()
std::shared_ptr< Port > mmc_input_port() const
void unmark_surround_send_id(uint32_t)
bool get_play_range() const
Definition: session.h:1106
double ltc_enc_cnt
Definition: session.h:1821
BufferSet & get_noinplace_buffers(ChanCount count=ChanCount::ZERO)
bool loading() const
Definition: session.h:254
uint32_t _listen_cnt
Definition: session.h:1424
Controllables controllables
Definition: session.h:2174
XMLNode & get_control_protocol_state() const
bool timecode_drop_frames() const
void overwrite_some_buffers(std::shared_ptr< Route >, OverwriteReason)
void set_play_loop(bool yn, bool change_transport_state)
bool get_play_loop() const
Definition: session.h:489
std::atomic< int32_t > _active_cue
Definition: session.h:2346
void ltc_tx_parse_offset()
bool transport_will_roll_forwards() const
samplecnt_t _worst_input_latency
Definition: session.h:1413
void refresh_disk_space()
int midi_read(MIDI::Port *)
std::list< MidiTimeoutCallback > MidiTimeoutList
Definition: session.h:1784
PBD::Signal< void(bool)> AuditionActive
Definition: session.h:925
std::shared_ptr< MidiRegion > XMLMidiRegionFactory(const XMLNode &, bool full)
bool pending_abort
Definition: session.h:1591
static bool get_disable_all_loaded_plugins()
Definition: session.h:1023
void timecode_time_subframes(samplepos_t when, Timecode::Time &)
void time_domain_changed()
void location_added(Location *)
static int ask_about_playlist_deletion(std::shared_ptr< Playlist >)
void clear_range_selection()
void maybe_update_tempo_from_midiclock_tempo(float bpm)
PostTransportWork post_transport_work() const
Definition: session.h:1626
void ensure_buffers_unlocked(ChanCount howmany)
std::string analysis_dir() const
Analysis data.
void set_sample_rate(samplecnt_t nframes)
void reset_xrun_count()
uint32_t next_send_id()
void ltc_tx_recalculate_position()
bool maybe_copy_midifile(snapshot_t, std::shared_ptr< Source > src, XMLNode *)
uint32_t naudiotracks() const
void queue_latency_recompute()
void foreach_route(void(Route::*method)())
bool should_ignore_transport_request(TransportRequestSource, TransportRequestType)
std::shared_ptr< PBD::Controllable > _solo_cut_control
Definition: session.h:2176
void ensure_search_path_includes(const std::string &path, DataType type)
std::shared_ptr< Port > trigger_input_port() const
void setup_bundles()
std::vector< std::string > get_paths_for_new_sources(bool allow_replacing, const std::string &import_file_path, uint32_t channels, std::vector< std::string > const &smf_track_names, bool use_smf_file_names)
bool mmc_step_timeout()
luabridge::LuaRef * _lua_del
Definition: session.h:1603
int num_triggerboxes() const
void remove_source(std::weak_ptr< Source >, bool drop_references=true)
void remove_monitor_section()
samplepos_t compute_stop_limit() const
int find_all_sources_across_snapshots(std::set< std::string > &result, bool exclude_this_snapshot)
void set_default_play_speed(double spd)
uint32_t count_sources_by_origin(const std::string &)
std::shared_ptr< Region > pending_audition_region
Definition: session.h:2017
bool _adding_routes_in_progress
Definition: session.h:1911
void non_realtime_locate()
samplecnt_t _timecode_frames_per_hour
Definition: session.h:1799
static int get_info_from_path(const std::string &xmlpath, float &sample_rate, SampleFormat &data_format, std::string &program_version, XMLNode *engine_hints=0)
VCAManager & vca_manager()
Definition: session.h:1293
volatile bool _save_queued_pending
Definition: session.h:1575
void start_time_changed(samplepos_t)
PBD::Signal< void()> Located
Definition: session.h:454
void reconnect_ltc_output()
void add_instant_xml(XMLNode &, bool write_to_config=true)
The instant xml file is written to the session directory.
std::shared_ptr< Processor > processor_by_id(PBD::ID) const
void set_play_range(std::list< TimelineRange > &, bool leave_rolling)
void schedule_butler_for_transport_work()
Glib::Threads::RWLock _mixer_scenes_lock
Definition: session.h:1617
SourceMap sources
Definition: session.h:1986
void start_domain_bounce(Temporal::DomainBounceInfo &)
bool vapor_export_barrier()
double engine_speed() const
Definition: session.h:808
luabridge::LuaRef * _lua_list
Definition: session.h:1604
void remove_route_group(RouteGroup &)
bool have_rec_disabled_track() const
void reset_punch_loop_constraint()
void reconnect_midi_scene_ports(bool)
samplepos_t _clicks_cleared
Definition: session.h:2125
std::string unnamed_file_name() const
uint32_t registered_lua_function_count() const
Definition: session.h:931
LatencyRange ltc_out_latency
Definition: session.h:1829
XMLNode & get_state() const
void set_had_destructive_tracks(bool yn)
std::shared_ptr< ExportStatus > export_status
Definition: session.h:1526
samplepos_t _last_roll_location
Definition: session.h:1586
void resort_routes()
bool had_destructive_tracks() const
void notify_presentation_info_change(PBD::PropertyChange const &)
std::shared_ptr< Route > _master_out
Definition: session.h:2156
void rt_set_controls(std::shared_ptr< WeakAutomationControlList >, double val, PBD::Controllable::GroupControlDisposition group_override)
std::shared_ptr< MidiPort > mtc_output_port() const
void route_solo_isolated_changed(std::weak_ptr< Route >)
void adjust_capture_buffering()
void unmark_aux_send_id(uint32_t)
void request_play_range(std::list< TimelineRange > *, bool leave_rolling=false)
void request_sync_source(std::shared_ptr< TransportMaster >)
PBD::Signal< void(int)> SurroundObjectCountChanged
Definition: session.h:419
bool _send_timecode_update
Flag to send a full sample (Timecode) MTC message this cycle.
Definition: session.h:1807
void engine_running()
VCAManager * _vca_manager
Definition: session.h:2306
void sync_locations_to_skips()
samplepos_t requested_return_sample() const
Definition: session.h:769
void add_routes_inner(RouteList &, bool input_auto_connect, bool output_auto_connect, PresentationInfo::order_t)
std::atomic< int > _ac_thread_active
Definition: session.h:1710
bool actively_recording() const
Definition: session.h:406
void set_requested_return_sample(samplepos_t return_to)
std::list< std::string > unknown_processors() const
timepos_t current_end() const
bool transport_locating() const
samplecnt_t worst_route_latency() const
Definition: session.h:557
samplecnt_t _current_sample_rate
Definition: session.h:1395
RouteGroup * new_route_group(const std::string &)
std::shared_ptr< PBD::Controllable > controllable_by_id(const PBD::ID &)
std::atomic< int > _ignored_a_processor_change
Definition: session.h:2276
void route_removed_from_route_group(RouteGroup *, std::weak_ptr< Route >)
std::shared_ptr< AudioFileSource > audio_source_by_path_and_channel(const std::string &, uint16_t) const
samplepos_t transport_sample() const
Definition: session.h:766
std::shared_ptr< Port > scene_input_port() const
unsigned int get_xrun_count() const
Definition: session.h:835
PBD::Signal< void()> route_group_removed
Definition: session.h:713
samplepos_t current_start_sample() const
void location_removed(Location *)
std::shared_ptr< Speakers > get_speakers()
int immediately_post_engine()
std::map< PBD::ID, PBD::StatefulDestructible * > registry
Definition: session.h:1085
void locations_changed()
luabridge::LuaRef * _lua_run
Definition: session.h:1601
bool _session_range_is_free
Definition: session.h:1400
samplecnt_t click_length
Definition: session.h:2112
size_t last_touched_mixer_scene_idx()
Definition: session.h:1175
void flush_all_inserts()
bool bang_trigger_at(int32_t route_index, int32_t row_index, float velocity=1.0)
void graph_reordered(bool called_from_backend)
bool _pre_export_mmc_enabled
Definition: session.h:1532
void remove_state(std::string snapshot_name)
unsigned int export_xruns() const
Definition: session.h:322
void set_global_quantization(AnyTime const &)
std::list< RouteGroup * > const & route_groups() const
Definition: session.h:722
bool bounce_processing() const
Definition: session.h:1192
int flatten_one_track(AudioTrack &, samplepos_t start, samplecnt_t cnt)
void cleanup_regions()
SerializedRCUManager< BundleList > _bundles
Definition: session.h:2076
samplecnt_t any_duration_to_samples(samplepos_t position, AnyTime const &duration)
double plan_master_strategy(pframes_t nframes, double master_speed, samplepos_t master_transport_sample, double catch_speed)
PBD::Signal< void()> BatchUpdateEnd
Definition: session.h:270
uint32_t track_number_decimals() const
Definition: session.h:394
static bool _disable_all_loaded_plugins
Definition: session.h:2191
ARDOUR::CueMarkers pending_source_markers
Definition: session.h:1982
void route_listen_changed(PBD::Controllable::GroupControlDisposition, std::weak_ptr< Route >)
LuaState lua
Definition: session.h:1599
std::string automation_dir() const
Automation data.
boost::dynamic_bitset< uint32_t > send_bitset
Definition: session.h:2027
bool peaks_cleanup_in_progres() const
Definition: session.h:253
PBD::Signal< void(RouteGroup *, std::weak_ptr< Route >)> RouteAddedToRouteGroup
Definition: session.h:464
PBD::Signal< void()> session_routes_reconnected
Definition: session.h:996
std::string new_audio_source_path_for_embedded(const std::string &existing_path)
Temporal::Range _object_selection
Definition: session.h:2146
void remove_routes(std::shared_ptr< RouteList >)
std::optional< bool > _vapor_available
Definition: session.h:1442
void add_post_transport_work(PostTransportWork ptw)
samplecnt_t preroll_record_trim_len() const
Definition: session.h:1116
void mark_return_id(uint32_t)
bool unload_io_plugin(std::shared_ptr< IOPlug >)
std::shared_ptr< Region > write_one_track(Track &, samplepos_t start, samplepos_t end, bool overwrite, std::vector< std::shared_ptr< Source > > &, InterThreadInfo &wot, std::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze, std::string const &source_name="", std::string const &region_name="")
static void set_bypass_all_loaded_plugins(bool yn)
Definition: session.h:1026
void realtime_stop(bool abort, bool clear_state)
SessionEvent * get_rt_event(std::shared_ptr< WeakAutomationControlList > cl, double arg, PBD::Controllable::GroupControlDisposition group_override)
Definition: session.h:2227
void reset_transport_speed(TransportRequestSource origin=TRS_UI)
samplecnt_t _preroll_record_trim_len
Definition: session.h:2150
void route_mute_changed()
bool route_name_unique(std::string) const
ChanCount _required_thread_buffers
Definition: session.h:1458
void setup_click_sounds(int which)
void count_existing_track_channels(ChanCount &in, ChanCount &out)
double step_speed
Definition: session.h:1781
bool update_route_latency(bool reverse, bool apply_to_delayline, bool *delayline_update_needed)
Glib::Threads::Mutex _auto_connect_queue_lock
Definition: session.h:1743
gain_t * trim_automation_buffer() const
LTCEncoder * ltc_encoder
Definition: session.h:1811
PBD::Signal< void()> MonitorChanged
Definition: session.h:992
bool first_file_header_format_reset
Definition: session.h:2183
static const SessionEvent::RTeventCallback rt_cleanup
Definition: session.h:979
void post_transport_motion()
static PBD::Signal< void()> Quit
Definition: session.h:1261
MIDI::byte mtc_timecode_bits
Definition: session.h:1791
PBD::Signal< void(bool)> LatencyUpdated
Definition: session.h:562
Glib::Threads::Mutex save_source_lock
Definition: session.h:1579
uint32_t nstripables(bool with_monitor=false) const
void port_registry_changed()
double transport_speed(bool incl_preroll=false) const
std::shared_ptr< Stripable > stripable_by_id(PBD::ID) const
void set_all_tracks_record_enabled(bool)
samplepos_t _export_preroll
Definition: session.h:1523
samplecnt_t _worst_output_latency
Definition: session.h:1412
void set_missing_file_replacement(const std::string &mfr)
Definition: session.h:1256
PBD::Signal< void(RouteGroup *)> RouteGroupPropertyChanged
Definition: session.h:460
void engine_halted()
RouteList new_audio_route(int input_channels, int output_channels, RouteGroup *route_group, uint32_t how_many, std::string name_template, PresentationInfo::Flag, PresentationInfo::order_t)
std::shared_ptr< Port > _ltc_output_port
Definition: session.h:2280
RouteList new_route_from_template(uint32_t how_many, PresentationInfo::order_t insert_at, const std::string &template_path, const std::string &name, PlaylistDisposition pd=NewPlaylist)
void finalize_audio_export(TransportRequestSource trs)
void set_track_loop(bool)
void cancel_all_solo()
void timecode_time(Timecode::Time &)
Sample * click_emphasis_data
Definition: session.h:2111
Glib::Threads::Mutex _update_latency_lock
Definition: session.h:1740
std::vector< std::shared_ptr< MixerScene > > _mixer_scenes
Definition: session.h:1616
void unset_dirty(bool emit_dirty_changed=false)
pframes_t current_block_size
Definition: session.h:1411
uint32_t _track_number_decimals
Definition: session.h:1937
unsigned int capture_xruns() const
Definition: session.h:321
PBD::Signal< void()> IOPluginsChanged
Definition: session.h:937
bool _send_qf_mtc
Definition: session.h:1550
bool reconnection_in_progress() const
Definition: session.h:249
static const uint32_t session_end_shift
Definition: session.h:2302
bool _count_in_once
Definition: session.h:2151
bool solo_selection_active()
void update_skips(Location *, bool consolidate)
PBD::Signal< void()> RecordArmStateChanged
Definition: session.h:431
bool _realtime_export
Definition: session.h:1521
PBD::Signal< void(Location *)> auto_punch_location_changed
Definition: session.h:545
int save_as(SaveAs &)
void auto_connect_io(std::shared_ptr< IO >)
void decrement_transport_position(samplecnt_t val)
Definition: session.h:1676
AudioEngine const & engine() const
Definition: session.h:760
bool _global_locate_pending
Definition: session.h:2323
void config_changed(std::string, bool)
CueEvents _cue_events
Definition: session.h:2341
RouteGroup & all_route_group() const
PBD::Signal< void()> FBSendsChanged
Definition: session.h:472
void mmc_step(MIDI::MachineControl &, int)
void clear_object_selection()
void process_rtop(SessionEvent *)
std::atomic< int > _capture_load
Definition: session.h:2072
void set_control(std::shared_ptr< AutomationControl >, double val, PBD::Controllable::GroupControlDisposition)
void auto_punch_start_changed(Location *)
SessionEvent * get_rt_event(std::shared_ptr< RouteList const > rl, T targ, SessionEvent::RTeventCallback after, PBD::Controllable::GroupControlDisposition group_override, void(Session::*method)(std::shared_ptr< RouteList const >, T, PBD::Controllable::GroupControlDisposition))
Definition: session.h:2204
void set_post_transport_work(PostTransportWork ptw)
Definition: session.h:1627
PBD::Signal< void()> SessionSaveUnderway
Definition: session.h:650
std::shared_ptr< Port > scene_output_port() const
int cleanup_sources(CleanupReport &)
PBD::Signal< void()> IsolatedChanged
Definition: session.h:991
XMLNode & get_template()
void foreach_source(std::function< void(std::shared_ptr< Source >)> f)
Definition: session.h:1974
std::atomic< PunchLoopLock > _punch_or_loop
Definition: session.h:1866
static int parse_stateful_loading_version(const std::string &)
AudioEngine & _engine
Definition: session.h:1389
PBD::Signal< void()> locations_modified
Definition: session.h:546
PBD::Signal< void(samplepos_t)> PositionChanged
Definition: session.h:449
bool _was_seamless
Definition: session.h:1427
process_function_type last_process_function
Definition: session.h:1391
Clicks clicks
Definition: session.h:2105
Butler * _butler
Definition: session.h:1619
PBD::Signal< void(Location *)> auto_loop_location_changed
Definition: session.h:544
std::shared_ptr< IOTaskList > _io_tasklist
Definition: session.h:2283
SessionConfiguration * cfg()
Definition: session.h:1182
PBD::ScopedConnectionList skip_update_connections
Definition: session.h:1645
int add_master_bus(ChanCount const &)
std::atomic< PostTransportWork > _post_transport_work
Definition: session.h:1625
samplepos_t position() const
Definition: session.h:1367
int load_routes(const XMLNode &, int)
bool _bounce_processing_active
Definition: session.h:1392
Glib::Threads::Mutex controllables_lock
Definition: session.h:2173
GraphEdges _current_route_graph
Definition: session.h:2259
std::shared_ptr< Route > surround_master() const
Definition: session.h:1007
bool synced_to_engine() const
std::atomic< RecordState > _record_status
Definition: session.h:1434
void setup_raid_path(std::string path)
std::atomic< int > _processing_prohibited
Definition: session.h:1433
void reassign_track_numbers()
std::shared_ptr< ExportHandler > export_handler
Definition: session.h:1525
std::optional< bool > _vapor_exportable
Definition: session.h:1443
BufferSet & get_route_buffers(ChanCount count=ChanCount::ZERO, bool silence=true)
std::shared_ptr< IO > _click_io
Definition: session.h:2108
static const int vst_can_do_string_count
Definition: session.h:1140
bool unbang_trigger_at(int32_t route_index, int32_t row_index)
void refill_all_track_buffers()
void disconnect_port_for_rewire(std::string const &port) const
void add_playlist(std::shared_ptr< Playlist >)
Glib::Threads::Mutex source_lock
Definition: session.h:1964
std::shared_ptr< Route > get_remote_nth_route(PresentationInfo::order_t n) const
SourceList pt_imported_sources
Definition: session.h:1317
void globally_add_internal_sends(std::shared_ptr< Route > dest, Placement p, bool)
void timecode_duration(samplecnt_t, Timecode::Time &) const
uint32_t capture_load()
PBD::Signal< void(std::string)> SaveSessionRequested
Definition: session.h:645
MIDI::MachineControl * _mmc
Definition: session.h:2290
void get_physical_ports(std::vector< std::string > &inputs, std::vector< std::string > &outputs, DataType type, MidiPortFlags include=MidiPortFlags(0), MidiPortFlags exclude=MidiPortFlags(0))
static PBD::Signal< void()> SendFeedback
Definition: session.h:1151
samplecnt_t io_latency() const
Definition: session.h:558
void audition_region(std::shared_ptr< Region >)
void flush_cue_recording()
void * do_work()
std::atomic< int > _have_rec_disabled_track
Definition: session.h:2198
void request_resume_timecode_transmission()
void reorder_route_groups(std::list< RouteGroup * >)
void unblock_processing()
Definition: session.h:1470
SerializedRCUManager< RouteList > routes
Definition: session.h:1907
static PBD::Signal< int(Session *, std::string, DataType)> MissingFile
Definition: session.h:1254
std::shared_ptr< GainControl > master_volume() const
void add_route_group(RouteGroup *)
bool implement_master_strategy()
bool save_default_options()
pthread_t _rt_emit_thread
Definition: session.h:1696
PBD::ReallocPool _mempool
Definition: session.h:1597
AutoConnectQueue _auto_connect_queue
Definition: session.h:1744
std::string modified_with
Definition: session.h:2311
Glib::Threads::Mutex peak_cleanup_lock
Definition: session.h:1580
pthread_mutex_t _auto_connect_mutex
Definition: session.h:1711
BufferSet & get_scratch_buffers(ChanCount count=ChanCount::ZERO, bool silence=true)
bool global_locate_pending() const
Definition: session.h:509
void cancel_audition()
PBD::ScopedConnection _click_io_connection
Definition: session.h:2116
std::atomic< int > _suspend_save
Definition: session.h:1573
void setup_click_state(const XMLNode *)
bool get_record_enabled() const
Definition: session.h:398
static void * auto_connect_thread(void *)
Locations * _locations
Definition: session.h:1633
void luabindings_session_rt(lua_State *)
unsigned int _export_xruns
Definition: session.h:1421
double outbound_mtc_timecode_frame
Definition: session.h:1793
Glib::Threads::RWLock click_lock
Definition: session.h:2114
static const std::string session_name_is_legal(const std::string &)
std::shared_ptr< RouteList const > get_routes() const
Definition: session.h:331
PresentationInfo::order_t master_order_key() const
Definition: session.h:1009
uint32_t next_return_id()
samplecnt_t convert_to_samples(AnyTime const &position)
samplepos_t record_location() const
Definition: session.h:767
static PBD::Signal< int(std::shared_ptr< Playlist >)> AskAboutPlaylistDeletion
Definition: session.h:880
bool export_track_state(std::shared_ptr< RouteList > rl, const std::string &path)
size_t _last_touched_mixer_scene_idx
Definition: session.h:1403
CoreSelection & selection() const
Definition: session.h:340
void update_route_solo_state(std::shared_ptr< RouteList const > r=std::shared_ptr< RouteList const >())
VCAManager * vca_manager_ptr()
Definition: session.h:1294
RouteList get_routelist(bool mixer_order=false, PresentationInfo::Flag fl=PresentationInfo::MixerRoutes) const
std::shared_ptr< AutomationControl > automation_control_by_id(const PBD::ID &)
AudioEngine & engine()
Definition: session.h:759
void timecode_to_sample(Timecode::Time &timecode, samplepos_t &sample, bool use_offset, bool use_subframes) const
void get_last_capture_sources(std::list< std::shared_ptr< Source > > &)
volatile bool _save_queued
Definition: session.h:1574
std::function< bool()> MidiTimeoutCallback
Definition: session.h:1783
void mark_send_id(uint32_t)
bool have_rec_enabled_track() const
std::shared_ptr< MixerScene > nth_mixer_scene(size_t, bool create_if_missing=false)
void remove_route_group(RouteGroup *rg)
Definition: session.h:705
void playlist_regions_extended(std::list< Temporal::Range > const &)
uint32_t main_outs
Definition: session.h:2154
static int vst_current_loading_id
Definition: session.h:1138
void mmc_record_exit(MIDI::MachineControl &)
pthread_cond_t _auto_connect_cond
Definition: session.h:1712
void queue_full_time_code()
Definition: session.h:1217
SerializedRCUManager< IOPlugList > _io_plugins
Definition: session.h:1614
std::shared_ptr< Speakers > _speakers
Definition: session.h:2253
int find_all_sources(std::string path, std::set< std::string > &result)
void add_controllable(std::shared_ptr< PBD::Controllable >)
std::atomic< int > _butler_seek_counter
Definition: session.h:1398
PBD::Signal< void()> TransportStateChange
Definition: session.h:447
gain_t * send_gain_automation_buffer() const
void emit_thread_run()
std::shared_ptr< Port > mmc_output_port() const
std::vector< std::weak_ptr< AutomationControl > > cancel_all_mute()
void xrun_recovery()
void request_locate(samplepos_t sample, bool force=false, LocateTransportDisposition ltd=RollIfAppropriate, TransportRequestSource origin=TRS_UI)
bool rechain_process_graph(GraphNodeList &)
void mmc_stop(MIDI::MachineControl &)
bool sample_rate_convert(ImportStatus &, std::string infile, std::string &outfile)
static PBD::Signal< int(samplecnt_t, samplecnt_t)> AskAboutSampleRateMismatch
Definition: session.h:885
int save_template(const std::string &template_name, const std::string &description="", bool replace_existing=false)
uint32_t redo_depth() const
Definition: session.h:1080
void set_track_monitor_input_status(bool)
bool playlist_is_active(std::shared_ptr< Playlist >)
std::shared_ptr< Route > monitor_out() const
Definition: session.h:1004
bool waiting_for_sync_offset
Definition: session.h:1393
Timecode::TimecodeFormat ltc_enc_tcformat
Definition: session.h:1814
void process_with_events(pframes_t)
StateOfTheState _state_of_the_state
Definition: session.h:1570
PBD::Signal< void()> MonitorBusAddedOrRemoved
Definition: session.h:993
std::shared_ptr< Source > XMLSourceFactory(const XMLNode &)
XMLNode * _bundle_xml_node
Definition: session.h:2077
void process_event(SessionEvent *)
bool soloing() const
Definition: session.h:968
samplecnt_t _io_latency
Definition: session.h:1415
void request_count_in_record()
void set_auto_loop_location(Location *)
void route_processors_changed(RouteProcessorChange)
std::atomic< int > _seek_counter
Definition: session.h:1397
MidiPortManager * _midi_ports
Definition: session.h:2289
void schedule_playback_buffering_adjustment()
void reset_monitor_section()
bool muted() const
AnyTime _global_quantization
Definition: session.h:2355
std::shared_ptr< Route > _surround_master
Definition: session.h:2158
std::shared_ptr< SessionPlaylists > playlists() const
Definition: session.h:1214
samplecnt_t click_emphasis_length
Definition: session.h:2113
bool apply_nth_mixer_scene(size_t, RouteList const &)
void clear_active_cue()
std::atomic< int > _suspend_timecode_transmission
Definition: session.h:2245
void auto_connect_thread_start()
bool punch_active() const
std::vector< space_and_path >::iterator last_rr_session_dir
Definition: session.h:2058
Session(AudioEngine &, const std::string &fullpath, const std::string &snapshot_name, BusProfile const *bus_profile=0, std::string mix_template="", bool unnamed=false, samplecnt_t samplerate=0)
void schedule_capture_buffering_adjustment()
XMLNode & state(bool save_template, snapshot_t snapshot_type=NormalSave, bool for_archive=false, bool only_used_assets=false) const
bool session_range_is_free() const
Definition: session.h:551
int no_roll(pframes_t nframes)
std::shared_ptr< BundleList const > bundles()
Definition: session.h:363
void non_realtime_set_audition()
samplepos_t ltc_timecode_offset
Definition: session.h:1826
PBD::Signal< void(std::weak_ptr< Source >)> SourceAdded
Definition: session.h:1969
PBD::Signal< void(RouteGroup *, std::weak_ptr< Route >)> RouteRemovedFromRouteGroup
Definition: session.h:468
void request_preroll_record_trim(samplepos_t start, samplecnt_t preroll)
pthread_mutex_t _rt_emit_mutex
Definition: session.h:1699
bool user_roll_after_locate() const
PBD::Signal< void()> route_groups_reordered
Definition: session.h:714
static PBD::Signal< void(samplecnt_t, samplecnt_t)> NotifyAboutSampleRateMismatch
Definition: session.h:888
static bool get_bypass_all_loaded_plugins()
Definition: session.h:1029
void queue_song_position_pointer()
Definition: session.h:1218
bool locate_pending() const
samplepos_t ltc_prev_cycle
Definition: session.h:1824
bool vapor_barrier()
void routes_using_input_from(const std::string &str, RouteList &rl)
PBD::Signal< void(std::weak_ptr< Source >)> SourceRemoved
Definition: session.h:1970
void butler_transport_work(bool have_process_lock=false)
samplepos_t ltc_enc_pos
Definition: session.h:1820
void mmc_record_enable(MIDI::MachineControl &mmc, size_t track, bool enabled)
std::shared_ptr< MidiSource > create_midi_source_by_stealing_name(std::shared_ptr< Track >)
int cleanup_trash_sources(CleanupReport &)
bool path_is_within_session(const std::string &)
Glib::Threads::Mutex region_lock
Definition: session.h:1953
std::string name() const
Definition: session.h:237
Butler * butler()
Definition: session.h:325
void send_immediate_mmc(MIDI::MachineControlCommand)
std::shared_ptr< AudioRegion > XMLAudioRegionFactory(const XMLNode &, bool full)
void midi_output_change_handler(IOChange change, void *, std::weak_ptr< Route > midi_track)
void add_monitor_section()
uint32_t _send_latency_changes
Definition: session.h:1416
MidiTimeoutList midi_timeouts
Definition: session.h:1786
std::vector< std::string > registered_lua_functions()
void add_source(std::shared_ptr< Source >)
samplecnt_t worst_latency_preroll() const
int32_t ltc_enc_byte
Definition: session.h:1819
std::shared_ptr< Route > XMLRouteFactory_3X(const XMLNode &, int)
samplecnt_t frames_per_hour() const
Definition: session.h:528
void auto_connect_surround_master()
std::optional< samplepos_t > _nominal_jack_transport_sample
Definition: session.h:2324
bool get_nsm_state() const
Definition: session.h:630
void timecode_time(samplepos_t when, Timecode::Time &)
std::string _path
Definition: session.h:1547
uint32_t _solo_isolated_cnt
Definition: session.h:1425
int start_audio_export(samplepos_t position, bool realtime=false, bool region_export=false)
bool monitor_active() const
Definition: session.h:1002
static void * session_loader_thread(void *arg)
void remove_route(std::shared_ptr< Route >)
int send_full_time_code(samplepos_t, pframes_t nframes)
void set_auto_punch_location(Location *)
void cue_marker_change(Location *)
static PBD::Signal< void()> FeedbackDetected
Definition: session.h:1238
void set_controls(std::shared_ptr< AutomationControlList >, double val, PBD::Controllable::GroupControlDisposition)
void set_block_size(pframes_t nframes)
bool _route_reorder_in_progress
Definition: session.h:1914
void click_io_resync_latency(bool)
samplepos_t last_transport_start() const
Definition: session.h:491
void unset_play_range()
void mmc_fast_forward(MIDI::MachineControl &)
void mmc_shuttle(MIDI::MachineControl &mmc, float speed, bool forw)
int load_sources(const XMLNode &node)
std::string next_redo() const
Definition: session.h:1082
bool find_route_name(std::string const &, uint32_t &id, std::string &name, bool)
int set_state(const XMLNode &node, int version)
bool transport_master_is_external() const
bool transport_locked() const
int load_route_groups(const XMLNode &, int)
void auto_connect_master_bus()
Click * get_click()
void mmc_record_pause(MIDI::MachineControl &)
std::shared_ptr< GraphChain > _graph_chain
Definition: session.h:2263
void rewire_midi_selection_ports()
PBD::Signal< void()> BatchUpdateStart
Definition: session.h:269
void setup_midi_machine_control()
samplecnt_t worst_latency_preroll_buffer_size_ceil() const
samplecnt_t timecode_frames_per_hour() const
Definition: session.h:531
std::string _current_snapshot_name
Definition: session.h:1567
bool transport_stopped_or_stopping() const
uint32_t playback_load()
void import_pt_rest(PTFFormat &ptf)
void deinterlace_midi_region(std::shared_ptr< MidiRegion > mr)
void unmark_insert_id(uint32_t)
void register_with_memento_command_factory(PBD::ID, PBD::StatefulDestructible *)
samplecnt_t _click_io_latency
Definition: session.h:2115
RouteGroup * route_group_by_name(std::string)
unsigned int _xrun_count
Definition: session.h:1429
Glib::Threads::Mutex lua_lock
Definition: session.h:1600
virtual ~Session()
PBD::Signal< void()> UpdateRouteRecordState
Definition: session.h:433
void add_click(samplepos_t pos, bool emphasis)
std::weak_ptr< PBD::Controllable > _recently_touched_controllable
Definition: session.h:2179
void save_as_bring_callback(uint32_t, uint32_t, std::string)
luabridge::LuaRef * _lua_save
Definition: session.h:1606
void adjust_playback_buffering()
pthread_t _auto_connect_thread
Definition: session.h:1709
void solo_control_mode_changed()
void request_overwrite_buffer(std::shared_ptr< Track >, OverwriteReason)
void emit_route_signals()
PBD::ScopedConnection export_freewheel_connection
Definition: session.h:1534
std::string _template_state_dir
Definition: session.h:2304
void listen_position_changed()
void auto_connect_thread_terminate()
PBD::Signal< void()> StateReady
Definition: session.h:635
RouteList new_route_from_template(uint32_t how_many, PresentationInfo::order_t insert_at, XMLNode &, const std::string &name, PlaylistDisposition pd=NewPlaylist)
std::shared_ptr< RouteList > get_tracks() const
void track_playlist_changed(std::weak_ptr< Track >)
std::shared_ptr< Route > get_midi_nth_route_by_id(PresentationInfo::order_t n) const
samplepos_t _last_roll_or_reversal_location
Definition: session.h:1588
int destroy_sources(std::list< std::shared_ptr< Source > > const &)
void foreach_route_group(std::function< void(RouteGroup *)> f)
Definition: session.h:716
std::vector< space_and_path > session_dirs
Definition: session.h:2057
samplepos_t ltc_enc_off
Definition: session.h:1822
PBD::Command * stateful_diff_command_factory(XMLNode *)
std::shared_ptr< Region > find_whole_file_parent(std::shared_ptr< Region const >) const
void rename_state(std::string old_name, std::string new_name)
samplecnt_t _frames_per_hour
Definition: session.h:1798
size_t _required_thread_buffersize
Definition: session.h:1459
int save_state(std::string snapshot_name="", bool pending=false, bool switch_to_snapshot=false, bool template_only=false, bool for_archive=false, bool only_used_assets=false)
void unmark_return_id(uint32_t)
uint32_t next_surround_send_id()
int remove_last_capture()
bool maybe_allow_only_punch()
void finish_domain_bounce(Temporal::DomainBounceInfo &)
bool dirty() const
Definition: session.h:251
void goto_start(bool and_roll=false)
@ pullup_Minus4Plus1
Definition: session.h:783
@ pullup_Plus4Minus1
Definition: session.h:779
LatencyRange mtc_out_latency
Definition: session.h:1830
std::vector< std::string > source_search_path(DataType) const
void update_marks(Location *loc)
gain_t * scratch_automation_buffer() const
int load_compounds(const XMLNode &node)
std::shared_ptr< ExportHandler > get_export_handler()
bool punch_is_possible() const
void remove_empty_sounds()
void auto_connect_thread_wakeup()
void unmark_send_id(uint32_t)
static PBD::Signal< void()> SuccessfulGraphSort
Definition: session.h:1243
void set_next_event()
bool _no_save_signal
Definition: session.h:1576
std::string construct_peak_filepath(const std::string &audio_path, const bool in_session=false, const bool old_peak_name=false) const
static void * emit_thread(void *)
bool route_name_internal(std::string) const
samplepos_t post_export_position
Definition: session.h:1517
std::shared_ptr< IO > click_io()
Definition: session.h:1094
std::vector< std::shared_ptr< MixerScene > > mixer_scenes() const
bool can_cleanup_peakfiles() const
samplecnt_t _base_sample_rate
Definition: session.h:1394
bool _export_rolling
Definition: session.h:1520
void update_latency_compensation(bool force, bool called_from_backend)
bool maybe_allow_only_loop(bool play_loop=false)
bool process_can_proceed() const
Definition: session.h:1846
bool deletion_in_progress() const
Definition: session.h:252
void ltc_tx_initialize()
void mmc_track_record_status(MIDI::MachineControl &, uint32_t track, bool enabled)
void _sync_locations_to_skips()
bool post_export_sync
Definition: session.h:1516
bool realtime_export() const
Definition: session.h:1188
static std::string get_snapshot_from_instant(const std::string &session_dir)
bool silent()
Definition: session.h:827
void sync_cues_from_list(Locations::LocationList const &)
bool have_external_connections_for_current_backend(bool tracks_only=true) const
uint32_t nbusses() const
void increment_transport_position(samplecnt_t val)
Definition: session.h:1668
void auto_connect_route(std::shared_ptr< Route >, bool, bool, const ChanCount &, const ChanCount &, const ChanCount &io=ChanCount(), const ChanCount &oo=ChanCount())
int backend_sync_callback(TransportState, samplepos_t)
uint32_t _step_editors
Definition: session.h:2242
void set_object_selection(Temporal::timepos_t const &start, Temporal::timepos_t const &end)
bool have_captured() const
Definition: session.h:318
void sync_time_vars()
PBD::Signal< void(RouteGroup *)> route_group_added
Definition: session.h:712
void ltc_tx_cleanup()
StripableList get_stripables() const
static std::atomic< unsigned int > _name_id_counter
Definition: session.h:1377
StripableList _soloSelection
Definition: session.h:2319
void globally_set_send_gains_from_track(std::shared_ptr< Route > dest)
bool _play_range
Definition: session.h:2138
std::vector< struct ptflookup > ptfwavpair
Definition: session.h:1316
void block_processing()
void get_stripables(StripableList &, PresentationInfo::Flag fl=PresentationInfo::MixerStripables) const
void start_transport(bool after_loop)
int restore_history(std::string snapshot_name)
void set_nsm_state(bool state)
Definition: session.h:631
void set_session_range_is_free(bool)
Temporal::GridIterator _click_iterator
Definition: session.h:2117
bool unnamed() const
void maybe_update_session_range(timepos_t const &, timepos_t const &)
int micro_locate(samplecnt_t distance)
void tempo_map_changed()
static bool _bypass_all_loaded_plugins
Definition: session.h:2192
void request_play_loop(bool yn, bool leave_rolling=false)
PBD::Command * memento_command_factory(XMLNode *n)
void allow_auto_play(bool yn)
static PBD::Signal< void(std::string, std::string, bool, samplepos_t)> Exported
Definition: session.h:860
std::vector< std::string > possible_states() const
int start_midi_thread()
void route_group_property_changed(RouteGroup *)
PBD::Signal< void()> TransportLooped
Definition: session.h:451
samplepos_t last_timecode_when
Definition: session.h:1804
bool _under_nsm_control
Definition: session.h:1428
void midi_track_presentation_info_changed(PBD::PropertyChange const &, std::weak_ptr< MidiTrack >)
PBD::Signal< int(samplecnt_t)> ProcessExport
Definition: session.h:859
static PBD::Signal< void(std::string)> Dialog
Definition: session.h:267
uint32_t nroutes() const
Definition: session.h:356
Definition: LuaRef.h:52
static EventLoop * get_event_loop_for_thread()
Definition: id.h:34
Definition: tlsf.h:30
Definition: xml++.h:114
Definition: xml++.h:74
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
libltc - en+decode linear timecode
unsigned char ltcsnd_sample_t
Definition: ltc.h:82
PBD::PropertyDescriptor< uint32_t > order
PBD::PropertyDescriptor< timepos_t > start
std::shared_ptr< Trigger > TriggerPtr
Definition: triggerbox.h:83
std::set< CueMarker > CueMarkers
uint32_t pframes_t
std::vector< std::shared_ptr< Source > > SourceList
std::vector< CueEvent > CueEvents
std::list< std::shared_ptr< Stripable > > StripableList
Temporal::samplecnt_t samplecnt_t
void setup_enum_writer()
std::list< std::shared_ptr< GraphNode > > GraphNodeList
std::list< std::shared_ptr< Route > > RouteList
std::vector< LuaScriptParamPtr > LuaScriptParamList
Definition: luascripting.h:107
Temporal::samplepos_t samplepos_t
std::shared_ptr< PBD::Controllable > Controllable
Definition: console1.h:80
Definition: editor.h:86
DebugBits IOTaskList
DebugBits Graph
DebugBits AudioEngine
Definition: session.h:1349
DebugBits Butler
Definition: axis_view.h:42
void atomic_inc(std::atomic< T > &aval)
Definition: atomic.h:29
bool atomic_dec_and_test(std::atomic< T > &aval)
Definition: atomic.h:26
static const samplepos_t max_samplepos
TimecodeFormat
Definition: time.h:38
bool operator==(const ProcessorSelection &a, const ProcessorSelection &b)
AutoConnectRequest(std::shared_ptr< Route > r, bool ci, bool co, const ChanCount &is, const ChanCount &os, const ChanCount &io, const ChanCount &oo)
Definition: session.h:1716
std::weak_ptr< Route > route
Definition: session.h:1731
std::string final_session_folder_name
Definition: session.h:572
std::string failure_message
Definition: session.h:589
std::string new_parent_folder
Definition: session.h:565
std::string new_name
Definition: session.h:566
PBD::Signal< bool(float, int64_t, int64_t)> Progress
Definition: session.h:585
LocateTransportDisposition roll_disposition
Definition: session.h:1497
uint32_t blocks
4kB blocks
Definition: session.h:2036
bool blocks_unknown
true if blocks is unknown
Definition: session.h:2037