X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fsession.h;h=15af67ada7421e452be4b83f593093428f888f37;hb=3131ab8bbd9f57b6c59ff0a13460db634d5dafee;hp=d0cd3fa06e7d34de063c9a73974092ab98f42f9d;hpb=5cf1f7f3b28abd36f9390014016def94f4e1468d;p=ardour.git diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index d0cd3fa06e..15af67ada7 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -36,6 +36,8 @@ #include +#include + #include "pbd/error.h" #include "pbd/event_loop.h" #include "pbd/rcu.h" @@ -48,7 +50,6 @@ #include "midi++/types.h" #include "timecode/time.h" -#include "ltc/ltc.h" #include "ardour/ardour.h" #include "ardour/chan_count.h" @@ -140,7 +141,7 @@ class WindowsVSTPlugin; extern void setup_enum_writer (); -class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager +class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager { public: enum RecordState { @@ -161,6 +162,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi virtual ~Session (); + static int get_info_from_path (const std::string& xmlpath, float& sample_rate, SampleFormat& data_format); + std::string path() const { return _path; } std::string name() const { return _name; } std::string snap_name() const { return _current_snapshot_name; } @@ -191,8 +194,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi std::string peak_path (std::string) const; - std::string change_source_path_by_name (std::string oldpath, std::string oldname, std::string newname, bool destructive); - std::string peak_path_from_audio_path (std::string) const; std::string new_audio_source_name (const std::string&, uint32_t nchans, uint32_t chan, bool destructive); std::string new_midi_source_name (const std::string&); @@ -235,12 +236,13 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi return _bundles.reader (); } - struct RoutePublicOrderSorter { + struct LIBARDOUR_API RoutePublicOrderSorter { bool operator() (boost::shared_ptr, boost::shared_ptr b); }; + void set_order_hint (uint32_t order_hint) {_order_hint = order_hint;}; void notify_remote_id_change (); - void sync_order_keys (RouteSortOrderKey); + void sync_order_keys (); template void foreach_route (T *obj, void (T::*func)(Route&)); template void foreach_route (T *obj, void (T::*func)(boost::shared_ptr)); @@ -500,7 +502,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void timecode_time_subframes (framepos_t when, Timecode::Time&); void timecode_duration (framecnt_t, Timecode::Time&) const; - void timecode_duration_string (char *, framecnt_t) const; + void timecode_duration_string (char *, size_t len, framecnt_t) const; framecnt_t convert_to_frames (AnyTime const & position); framecnt_t any_duration_to_frames (framepos_t position, AnyTime const & duration); @@ -509,7 +511,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi static PBD::Signal1 EndTimeChanged; void request_sync_source (Slave*); - bool synced_to_jack() const { return config.get_external_sync() && Config->get_sync_source() == JACK; } + bool synced_to_engine() const { return config.get_external_sync() && Config->get_sync_source() == Engine; } double transport_speed() const { return _transport_speed; } bool transport_stopped() const { return _transport_speed == 0.0f; } @@ -578,11 +580,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi boost::shared_ptr create_audio_source_for_session ( size_t, std::string const &, uint32_t, bool destructive); - boost::shared_ptr create_midi_source_for_session ( - Track*, std::string const &); + boost::shared_ptr create_midi_source_for_session (std::string const &); + boost::shared_ptr create_midi_source_by_stealing_name (boost::shared_ptr); boost::shared_ptr source_by_id (const PBD::ID&); - boost::shared_ptr source_by_path_and_channel (const std::string&, uint16_t); + boost::shared_ptr source_by_path_and_channel (const std::string&, uint16_t) const; + boost::shared_ptr source_by_path (const std::string&) const; uint32_t count_sources_by_origin (const std::string&); void add_playlist (boost::shared_ptr, bool unused = false); @@ -752,6 +755,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /* VST support */ + static int vst_current_loading_id; + static const char* vst_can_do_strings[]; + static const int vst_can_do_string_count; + static intptr_t vst_callback ( AEffect* effect, int32_t opcode, @@ -879,15 +886,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi MIDI::MachineControl& mmc() { return *_mmc; } - /* Callbacks specifically related to JACK, and called directly - * from the JACK audio backend. - */ - -#ifdef HAVE_JACK_SESSION - void jack_session_event (jack_session_event_t* event); -#endif - void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int); - protected: friend class AudioEngine; void set_block_size (pframes_t nframes); @@ -1071,7 +1069,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi boost::scoped_ptr _session_dir; void hookup_io (); - int when_engine_running (); void graph_reordered (); /** current snapshot name, without the .ardour suffix */ @@ -1137,8 +1134,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void auto_loop_changed (Location *); void auto_loop_declick_range (Location *, framepos_t &, framepos_t &); + int ensure_engine (uint32_t desired_sample_rate); void pre_engine_init (std::string path); int post_engine_init (); + int immediately_post_engine (); void remove_empty_sounds (); void setup_midi_control (); @@ -1263,7 +1262,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi int start_midi_thread (); - void set_play_loop (bool yn); + void set_play_loop (bool yn, double speed); void unset_play_loop (); void overwrite_some_buffers (Track *); void flush_all_inserts (); @@ -1360,9 +1359,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi private: SourceMap sources; - public: - SourceMap get_sources() { return sources; } - private: int load_sources (const XMLNode& node); XMLNode& get_sources_as_xml (); @@ -1521,13 +1517,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi float opt ); - /* number of hardware ports we're using, - based on max (requested,available) - */ - - ChanCount n_physical_outputs; - ChanCount n_physical_inputs; - int find_all_sources (std::string path, std::set& result); int find_all_sources_across_snapshots (std::set& result, bool exclude_this_snapshot); @@ -1607,6 +1596,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi GraphEdges _current_route_graph; uint32_t next_control_id () const; + uint32_t _order_hint; bool ignore_route_processor_changes; MidiClockTicker* midi_clock; @@ -1623,8 +1613,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void setup_ltc (); void setup_click (); + void setup_click_state (const XMLNode*); void setup_bundles (); - int ensure_engine (uint32_t desired_sample_rate); + + static int get_session_info_from_path (XMLTree& state_tree, const std::string& xmlpath); }; } // namespace ARDOUR