X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fsession.h;h=0e543462aef36b4b1992e351e1fb85ef28a0e6ad;hb=a6b735abdbcfc375db314e7f3a4ffb9cee503a48;hp=8b291dd75bbbac753c2b54c26d4879c27b7572ae;hpb=47e56905523cb9269a19300d2b468118dda3a161;p=ardour.git diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 8b291dd75b..0e543462ae 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -178,7 +178,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable std::list audio_range; std::list music_range; - + boost::shared_ptr region; Event(Type t, Action a, nframes_t when, nframes_t where, double spd, bool yn = false) @@ -206,11 +206,11 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable return e1->before (*e2); } - void *operator new (size_t ignored) { + void *operator new (size_t) { return pool.alloc (); } - void operator delete(void *ptr, size_t size) { + void operator delete (void *ptr, size_t /*size*/) { pool.release (ptr); } @@ -223,15 +223,15 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable /* creating from an XML file */ Session (AudioEngine&, - const std::string& fullpath, - const std::string& snapshot_name, - std::string mix_template = ""); + const std::string& fullpath, + const std::string& snapshot_name, + std::string mix_template = ""); /* creating a new Session */ Session (AudioEngine&, - std::string fullpath, - std::string snapshot_name, + std::string fullpath, + std::string snapshot_name, AutoConnectOption input_auto_connect, AutoConnectOption output_auto_connect, uint32_t control_out_channels, @@ -249,6 +249,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable void set_snap_name (); + bool writable() const { return _writable; } void set_dirty (); void set_clean (); bool dirty() const { return _state_of_the_state & Dirty; } @@ -304,7 +305,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable typedef std::list > DiskstreamList; - int load_routes (const XMLNode&); + int load_routes (const XMLNode&, int); boost::shared_ptr get_routes() const { return routes.reader (); } @@ -318,10 +319,10 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable } struct RoutePublicOrderSorter { - bool operator() (boost::shared_ptr, boost::shared_ptr b); + bool operator() (boost::shared_ptr, boost::shared_ptr b); }; - - void sync_order_keys (const char* base); + + void sync_order_keys (std::string const &); template void foreach_route (T *obj, void (T::*func)(Route&)); template void foreach_route (T *obj, void (T::*func)(boost::shared_ptr)); @@ -418,7 +419,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable double frames_per_smpte_frame() const { return _frames_per_smpte_frame; } nframes_t smpte_frames_per_hour() const { return _smpte_frames_per_hour; } - MIDI::byte get_mtc_smpte_bits() const { + MIDI::byte get_mtc_smpte_bits() const { return mtc_smpte_bits; /* encoding of SMTPE type for MTC */ } @@ -467,7 +468,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable static std::vector* possible_states (std::string path); XMLNode& get_state(); - int set_state(const XMLNode& node); // not idempotent + int set_state(const XMLNode& node, int version); // not idempotent XMLNode& get_template(); /// The instant xml file is written to the session directory @@ -505,7 +506,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable std::list > new_audio_track ( int input_channels, int output_channels, TrackMode mode = Normal, RouteGroup* route_group = 0, uint32_t how_many = 1 ); - + RouteList new_audio_route (int input_channels, int output_channels, RouteGroup* route_group, uint32_t how_many); std::list > new_midi_track ( @@ -581,7 +582,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable /// signals the current transport position in frames, bbt and smpte time (in that order) sigc::signal tick; - + /* region info */ void add_regions (std::vector >&); @@ -627,7 +628,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable boost::shared_ptr get_export_handler (); boost::shared_ptr get_export_status (); - int start_audio_export (nframes_t position, bool realtime); + int start_audio_export (nframes_t position, bool realtime); sigc::signal ProcessExport; sigc::signal ExportReadFinished; @@ -716,16 +717,18 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable /* flattening stuff */ boost::shared_ptr write_one_track (AudioTrack&, nframes_t start, nframes_t end, - bool overwrite, std::vector >&, InterThreadInfo& wot, - bool enable_processing = true); + bool overwrite, std::vector >&, InterThreadInfo& wot, + bool enable_processing = true); int freeze (InterThreadInfo&); /* session-wide solo/mute/rec-enable */ bool soloing() const { return _non_soloed_outs_muted; } - + bool listening() const { return _listen_cnt > 0; } + void set_all_solo (bool); void set_all_mute (bool); + void set_all_listen (bool); sigc::signal SoloActive; sigc::signal SoloChanged; @@ -738,6 +741,12 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable boost::shared_ptr control_out() const { return _control_out; } boost::shared_ptr master_out() const { return _master_out; } + void globally_add_internal_sends (boost::shared_ptr dest, Placement p); + void globally_set_send_gains_from_track (boost::shared_ptr dest); + void globally_set_send_gains_to_zero (boost::shared_ptr dest); + void globally_set_send_gains_to_unity (boost::shared_ptr dest); + void add_internal_sends (boost::shared_ptr dest, Placement p, boost::shared_ptr senders); + static void set_disable_all_loaded_plugins (bool yn) { _disable_all_loaded_plugins = yn; } @@ -837,22 +846,21 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable class GlobalRouteStateCommand : public Command { - public: + public: GlobalRouteStateCommand (Session&, void*); GlobalRouteStateCommand (Session&, const XMLNode& node); - int set_state (const XMLNode&); + int set_state (const XMLNode&, int version); XMLNode& get_state (); - protected: + protected: GlobalRouteBooleanState before, after; Session& sess; void* src; - }; class GlobalSoloStateCommand : public GlobalRouteStateCommand { - public: + public: GlobalSoloStateCommand (Session &, void *src); GlobalSoloStateCommand (Session&, const XMLNode&); void operator()(); //redo @@ -863,7 +871,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable class GlobalMuteStateCommand : public GlobalRouteStateCommand { - public: + public: GlobalMuteStateCommand(Session &, void *src); GlobalMuteStateCommand (Session&, const XMLNode&); void operator()(); // redo @@ -874,7 +882,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable class GlobalRecordEnableStateCommand : public GlobalRouteStateCommand { - public: + public: GlobalRecordEnableStateCommand(Session &, void *src); GlobalRecordEnableStateCommand (Session&, const XMLNode&); void operator()(); // redo @@ -885,16 +893,16 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable class GlobalMeteringStateCommand : public Command { - public: + public: GlobalMeteringStateCommand(Session &, void *src); GlobalMeteringStateCommand (Session&, const XMLNode&); void operator()(); void undo(); XMLNode &get_state(); - int set_state (const XMLNode&); + int set_state (const XMLNode&, int version); void mark(); - protected: + protected: Session& sess; void* src; GlobalRouteMeterState before; @@ -930,7 +938,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable gain_t* gain_automation_buffer () const { return _gain_automation_buffer; } pan_t** pan_automation_buffer () const { return _pan_automation_buffer; } - + void ensure_buffer_set (BufferSet& buffers, const ChanCount& howmany); /* VST support */ @@ -955,6 +963,10 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable SessionConfiguration config; + bool exporting () const { + return _exporting; + } + protected: friend class AudioEngine; void set_block_size (nframes_t nframes); @@ -1006,13 +1018,13 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable Location* start_location; Slave* _slave; bool _silent; - + // varispeed playback volatile double _transport_speed; double _last_transport_speed; double _target_transport_speed; - LibSamplerateInterpolation interpolation; - + CubicInterpolation interpolation; + bool auto_play_legal; nframes_t _last_slave_transport_frame; nframes_t maximum_output_latency; @@ -1028,9 +1040,11 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable float _meter_hold; float _meter_falloff; bool _non_soloed_outs_muted; + uint32_t _listen_cnt; + bool _writable; void set_worst_io_latencies (); - void set_worst_io_latencies_x (IOChange asifwecare, void *ignored) { + void set_worst_io_latencies_x (IOChange, void *) { set_worst_io_latencies (); } @@ -1070,10 +1084,10 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable void reset_slave_state (); bool follow_slave (nframes_t); void calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta); - void track_slave_state(float slave_speed, nframes_t slave_transport_frame, - nframes_t this_delta, bool starting); + void track_slave_state(float slave_speed, nframes_t slave_transport_frame, + nframes_t this_delta, bool starting); void follow_slave_silently(nframes_t nframes, float slave_speed); - + void set_slave_source (SlaveSource); SlaveSource post_export_slave; @@ -1081,14 +1095,14 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable bool _exporting; bool _exporting_realtime; - + boost::shared_ptr export_handler; boost::shared_ptr export_status; int pre_export (); int stop_audio_export (); void finalize_audio_export (); - + sigc::connection export_freewheel_connection; void prepare_diskstreams (); @@ -1120,8 +1134,8 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable } bool maybe_stop (nframes_t limit) { - if ( (_transport_speed > 0.0f && _transport_frame >= limit) - || (_transport_speed < 0.0f && _transport_frame == 0) ) { + if ( (_transport_speed > 0.0f && _transport_frame >= limit) + || (_transport_speed < 0.0f && _transport_frame == 0) ) { stop_transport (); return true; } @@ -1156,8 +1170,8 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable std::string _current_snapshot_name; - XMLTree* state_tree; - bool state_was_pending; + XMLTree* state_tree; + bool state_was_pending; StateOfTheState _state_of_the_state; void auto_save(); @@ -1173,8 +1187,6 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable bool pending_abort; bool pending_auto_loop; - Sample* butler_mixdown_buffer; - float* butler_gain_buffer; pthread_t butler_thread; Glib::Mutex butler_request_lock; Glib::Cond butler_paused; @@ -1425,7 +1437,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable /* edit/mix groups */ - int load_route_groups (const XMLNode&); + int load_route_groups (const XMLNode&, int); std::list _route_groups; @@ -1444,20 +1456,19 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable void add_routes (RouteList&, bool save); uint32_t destructive_index; - boost::shared_ptr XMLRouteFactory (const XMLNode&); + boost::shared_ptr XMLRouteFactory (const XMLNode&, int); /* mixer stuff */ - bool solo_update_disabled; + bool solo_update_disabled; + void route_listen_changed (void *src, boost::weak_ptr); void route_mute_changed (void *src); void route_solo_changed (void *src, boost::weak_ptr); - void catch_up_on_solo (); - void catch_up_on_solo_mute_override (); - void solo_model_changed (); void update_route_solo_state (boost::shared_ptr r = boost::shared_ptr()); - void modify_solo_mute (bool, bool); - void strip_portname_for_solo (std::string& portname); + + void listen_position_changed (); + void solo_control_mode_changed (); /* REGION MANAGEMENT */ @@ -1622,15 +1633,15 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable Click (nframes_t s, nframes_t d, const Sample *b) : start (s), duration (d), data (b) { offset = 0; } - void *operator new(size_t ignored) { + void *operator new (size_t) { return pool.alloc (); }; - void operator delete(void *ptr, size_t size) { + void operator delete(void *ptr, size_t /*size*/) { pool.release (ptr); } - private: + private: static Pool pool; }; @@ -1716,7 +1727,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable void sync_order_keys (); static bool _disable_all_loaded_plugins; - + SessionMetadata * _metadata; mutable bool have_looped; ///< Used in ::audible_frame(*)