X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fardour%2Fardour%2Fsession.h;h=c3342b7a63a69977fed3fdc25be72096ae8b955f;hb=7ffeb70b1b29df553b3b3d49b0215c7a0d5d4a4c;hp=6b71e3c1edde9c8b829882a1d47e1bb41cdbdbf9;hpb=04e7cfabbe58605e6770adbd9e27bf871a957bef;p=ardour.git diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 6b71e3c1ed..c3342b7a63 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -173,6 +173,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop virtual ~Session (); static int get_info_from_path (const std::string& xmlpath, float& sample_rate, SampleFormat& data_format); + static std::string get_snapshot_from_instant (const std::string& session_dir); std::string path() const { return _path; } std::string name() const { return _name; } @@ -180,8 +181,6 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop std::string raid_path () const; bool path_is_within_session (const std::string&); - void set_snap_name (); - bool writable() const { return _writable; } void set_dirty (); void set_clean (); @@ -218,7 +217,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop std::string new_audio_source_path_for_embedded (const std::string& existing_path); std::string new_audio_source_path (const std::string&, uint32_t nchans, uint32_t chan, bool destructive, bool take_required); std::string new_midi_source_path (const std::string&); - RouteList new_route_from_template (uint32_t how_many, const std::string& template_path, const std::string& name); + RouteList new_route_from_template (uint32_t how_many, const std::string& template_path, const std::string& name, PlaylistDisposition pd = NewPlaylist); + RouteList new_route_from_template (uint32_t how_many, XMLNode&, const std::string& name, PlaylistDisposition pd = NewPlaylist); std::vector get_paths_for_new_sources (bool allow_replacing, const std::string& import_file_path, uint32_t channels); int bring_all_sources_into_session (boost::function callback); @@ -312,7 +312,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /* Timecode status signals */ PBD::Signal1 MTCSyncStateChanged; - PBD::Signal1 LTCSyncStateChanged; + PBD::Signal1 LTCSyncStateChanged; /* Record status signals */ @@ -362,7 +362,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /* Timecode state signals */ PBD::Signal0 MtcOrLtcInputPortChanged; - + void queue_event (SessionEvent*); void request_roll_at_and_return (framepos_t start, framepos_t return_to); @@ -378,7 +378,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void goto_start (); void use_rf_shuttle_speed (); void allow_auto_play (bool yn); - void request_transport_speed (double speed, bool as_default = false); + void request_transport_speed (double speed, bool as_default = true); void request_transport_speed_nonzero (double, bool as_default = false); void request_overwrite_buffer (Track *); void adjust_playback_buffering(); @@ -427,7 +427,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop framecnt_t worst_input_latency () const { return _worst_input_latency; } framecnt_t worst_track_latency () const { return _worst_track_latency; } framecnt_t worst_playback_latency () const { return _worst_output_latency + _worst_track_latency; } - + struct SaveAs { std::string new_parent_folder; /* parent folder where new session folder will be created */ std::string new_name; /* name of newly saved session */ @@ -437,7 +437,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop bool copy_external; /* true if external media should be consolidated into the newly saved session; false otherwise */ std::string final_session_folder_name; /* filled in by * Session::save_as(), provides full path to newly saved session */ - + /* emitted as we make progress. 3 arguments passed to signal * handler: * @@ -459,7 +459,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop int save_as (SaveAs&); int save_state (std::string snapshot_name, bool pending = false, bool switch_to_snapshot = false, bool template_only = false); int restore_state (std::string snapshot_name); - int save_template (std::string template_name); + int save_template (std::string template_name, bool replace_existing = false); int save_history (std::string snapshot_name = ""); int restore_history (std::string snapshot_name); void remove_state (std::string snapshot_name); @@ -481,10 +481,10 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop * * Argument is the snapshot name to use when saving. */ - PBD::Signal1 SaveSessionRequested; + PBD::Signal1 SaveSessionRequested; /* emitted during a session save to allow other entities to add state, via - * extra XML, to the session state + * extra XML, to the session state */ PBD::Signal0 SessionSaveUnderway; @@ -568,7 +568,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop std::list > new_midi_track ( const ChanCount& input, const ChanCount& output, boost::shared_ptr instrument = boost::shared_ptr(), - TrackMode mode = Normal, + TrackMode mode = Normal, RouteGroup* route_group = 0, uint32_t how_many = 1, std::string name_template = "" ); @@ -582,7 +582,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop AudioEngine const & engine () const { return _engine; } static std::string default_track_name_pattern (DataType); - + /* Time */ framepos_t transport_frame () const {return _transport_frame; } @@ -625,7 +625,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop bool synced_to_engine() const { return _slave && config.get_external_sync() && Config->get_sync_source() == Engine; } bool synced_to_mtc () const { return config.get_external_sync() && Config->get_sync_source() == MTC && g_atomic_int_get (const_cast(&_mtc_active)); } bool synced_to_ltc () const { return config.get_external_sync() && Config->get_sync_source() == LTC && g_atomic_int_get (const_cast(&_ltc_active)); } - + double transport_speed() const { return _transport_speed; } bool transport_stopped() const { return _transport_speed == 0.0f; } bool transport_rolling() const { return _transport_speed != 0.0f; } @@ -736,8 +736,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop static const SessionEvent::RTeventCallback rt_cleanup; void set_solo (boost::shared_ptr, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); + void clear_all_solo_state (boost::shared_ptr); void set_just_one_solo (boost::shared_ptr, bool, SessionEvent::RTeventCallback after = rt_cleanup); - void cancel_solo_after_disconnect (boost::shared_ptr, bool upstream, SessionEvent::RTeventCallback after = rt_cleanup); void set_mute (boost::shared_ptr, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); void set_listen (boost::shared_ptr, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); void set_record_enabled (boost::shared_ptr, bool, SessionEvent::RTeventCallback after = rt_cleanup, bool group_override = false); @@ -877,7 +877,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void set_object_selection (framepos_t start, framepos_t end); void clear_range_selection (); void clear_object_selection (); - + /* buffers for gain and pan */ gain_t* gain_automation_buffer () const; @@ -901,7 +901,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void* ptr, float opt ); - + static PBD::Signal0 SendFeedback; /* Speakers */ @@ -1009,28 +1009,27 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop SceneChanger* scene_changer() const { return _scene_changer; } - boost::shared_ptr ltc_input_port() const; - boost::shared_ptr ltc_output_port() const; - - boost::shared_ptr ltc_input_io() { return _ltc_input; } - boost::shared_ptr ltc_output_io() { return _ltc_output; } + /* asynchronous MIDI control ports */ - MIDI::Port* midi_input_port () const; - MIDI::Port* midi_output_port () const; - MIDI::Port* mmc_output_port () const; - MIDI::Port* mmc_input_port () const; + boost::shared_ptr midi_input_port () const; + boost::shared_ptr midi_output_port () const; + boost::shared_ptr mmc_output_port () const; + boost::shared_ptr mmc_input_port () const; + boost::shared_ptr scene_input_port () const; + boost::shared_ptr scene_output_port () const; - MIDI::Port* scene_input_port () const; - MIDI::Port* scene_output_port () const; + /* synchronous MIDI ports used for synchronization */ - boost::shared_ptr scene_in () const; - boost::shared_ptr scene_out () const; - boost::shared_ptr midi_clock_output_port () const; boost::shared_ptr midi_clock_input_port () const; boost::shared_ptr mtc_output_port () const; boost::shared_ptr mtc_input_port () const; - + boost::shared_ptr ltc_input_port() const; + boost::shared_ptr ltc_output_port() const; + + boost::shared_ptr ltc_input_io() { return _ltc_input; } + boost::shared_ptr ltc_output_io() { return _ltc_output; } + MIDI::MachineControl& mmc() { return *_mmc; } void reconnect_midi_scene_ports (bool); @@ -1039,7 +1038,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void reconnect_ltc_input (); void reconnect_ltc_output (); - + protected: friend class AudioEngine; void set_block_size (pframes_t nframes); @@ -1115,7 +1114,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop PBD::ScopedConnection mtc_status_connection; void ltc_status_changed (bool); PBD::ScopedConnection ltc_status_connection; - + void initialize_latencies (); void set_worst_io_latencies (); void set_worst_playback_latency (); @@ -1237,6 +1236,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void graph_reordered (); /** current snapshot name, without the .ardour suffix */ + void set_snapshot_name (const std::string &); + void save_snapshot_name (const std::string &); std::string _current_snapshot_name; XMLTree* state_tree; @@ -1301,7 +1302,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void consolidate_skips (Location*); void sync_locations_to_skips (); void _sync_locations_to_skips (); - + PBD::ScopedConnectionList skip_update_connections; bool _ignore_skips_updates; @@ -1319,7 +1320,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop int post_engine_init (); int immediately_post_engine (); void remove_empty_sounds (); - + void session_loaded (); void setup_midi_control (); @@ -1466,7 +1467,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void flush_all_inserts (); int micro_locate (framecnt_t distance); void locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false, bool with_mmc=true); - void start_locate (framepos_t, bool with_roll, bool with_flush, bool with_loop=false, bool force=false); + void start_locate (framepos_t, bool with_roll, bool with_flush, bool for_loop_enabled=false, bool force=false); void force_locate (framepos_t frame, bool with_roll = false); void set_track_speed (Track *, double speed); void set_transport_speed (double speed, framepos_t destination_frame, bool abort = false, bool clear_state = false, bool as_default = false); @@ -1485,7 +1486,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void set_track_loop (bool); bool select_playhead_priority_target (framepos_t&); void follow_playhead_priority (); - + /* These are synchronous and so can only be called from within the process * cycle */ @@ -1536,12 +1537,9 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /* mixer stuff */ - bool solo_update_disabled; - - void route_listen_changed (void *src, boost::weak_ptr); + void route_listen_changed (bool group_override, boost::weak_ptr); void route_mute_changed (void *src); - void route_solo_changed (bool self_solo_change, void *src, boost::weak_ptr); - void routes_solo_changed (boost::shared_ptr solo_change_routes); + void route_solo_changed (bool self_solo_change, bool group_override, boost::weak_ptr); void route_solo_isolated_changed (void *src, boost::weak_ptr); void update_route_solo_state (boost::shared_ptr r = boost::shared_ptr()); @@ -1715,7 +1713,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop */ Evoral::Range _range_selection; Evoral::Range _object_selection; - + /* main outs */ uint32_t main_outs; @@ -1773,12 +1771,12 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop ev->rt_slot = boost::bind (method, this, rl, targ, group_override); ev->rt_return = after; ev->event_loop = PBD::EventLoop::get_event_loop_for_thread (); - + return ev; } - void rt_cancel_solo_after_disconnect (boost::shared_ptr, bool upstream, bool /* ignored*/ ); void rt_set_solo (boost::shared_ptr, bool yn, bool group_override); + void rt_clear_all_solo_state (boost::shared_ptr, bool yn, bool group_override); void rt_set_just_one_solo (boost::shared_ptr, bool yn, bool /* ignored*/ ); void rt_set_mute (boost::shared_ptr, bool yn, bool group_override); void rt_set_listen (boost::shared_ptr, bool yn, bool group_override); @@ -1827,16 +1825,16 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /* Scene Changing */ SceneChanger* _scene_changer; - + /* persistent, non-track related MIDI ports */ MidiPortManager* _midi_ports; MIDI::MachineControl* _mmc; - + void setup_ltc (); void setup_click (); void setup_click_state (const XMLNode*); void setup_bundles (); - + void save_as_bring_callback (uint32_t, uint32_t, std::string); static int get_session_info_from_path (XMLTree& state_tree, const std::string& xmlpath);