X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fio.h;h=adad0c753fa1036f1a2e8474530e8b5a2e9d040b;hb=83e05ec0ec236f4dc327935377206966836027eb;hp=90544450efa0c7d1f16eb618fadcb80031c92e59;hpb=d155f32039570e9e0cde11b42e395ca2bcc89ffd;p=ardour.git diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 90544450ef..adad0c753f 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "pbd/fastlog.h" #include "pbd/undo.h" @@ -74,8 +74,8 @@ class IO : public SessionObject, public Latent Output }; - IO (Session&, const std::string& name, Direction, DataType default_type = DataType::AUDIO); - IO (Session&, const XMLNode&, DataType default_type = DataType::AUDIO); + IO (Session&, const std::string& name, Direction, DataType default_type = DataType::AUDIO, bool sendish = false); + IO (Session&, const XMLNode&, DataType default_type = DataType::AUDIO, bool sendish = false); virtual ~IO(); @@ -90,11 +90,11 @@ class IO : public SessionObject, public Latent bool set_name (const std::string& str); virtual void silence (framecnt_t); - void increment_port_buffer_offset (pframes_t offset); + void increment_port_buffer_offset (pframes_t offset); int ensure_io (ChanCount cnt, bool clear, void *src); - int connect_ports_to_bundle (boost::shared_ptr, void *); + int connect_ports_to_bundle (boost::shared_ptr, bool exclusive, void *); int disconnect_ports_from_bundle (boost::shared_ptr, void *); BundleList bundles_connected (); @@ -102,34 +102,35 @@ class IO : public SessionObject, public Latent boost::shared_ptr bundle () { return _bundle; } int add_port (std::string connection, void *src, DataType type = DataType::NIL); - int remove_port (Port *, void *src); - int connect (Port *our_port, std::string other_port, void *src); - int disconnect (Port *our_port, std::string other_port, void *src); + int remove_port (boost::shared_ptr, void *src); + int connect (boost::shared_ptr our_port, std::string other_port, void *src); + int disconnect (boost::shared_ptr our_port, std::string other_port, void *src); int disconnect (void *src); bool connected_to (boost::shared_ptr) const; - bool connected () const; - bool physically_connected () const; - - framecnt_t signal_latency () const { return _own_latency; } + bool connected_to (const std::string&) const; + bool connected () const; + bool physically_connected () const; + + framecnt_t signal_latency () const { return 0; } framecnt_t latency () const; PortSet& ports() { return _ports; } const PortSet& ports() const { return _ports; } - bool has_port (Port *) const; + bool has_port (boost::shared_ptr) const; - Port *nth (uint32_t n) const { + boost::shared_ptr nth (uint32_t n) const { if (n < _ports.num_ports()) { return _ports.port(n); } else { - return 0; + return boost::shared_ptr (); } } - Port* port_by_name (const std::string& str) const; + boost::shared_ptr port_by_name (const std::string& str) const; - AudioPort* audio(uint32_t n) const; - MidiPort* midi(uint32_t n) const; + boost::shared_ptr audio(uint32_t n) const; + boost::shared_ptr midi(uint32_t n) const; const ChanCount& n_ports () const { return _ports.count(); } @@ -143,6 +144,7 @@ class IO : public SessionObject, public Latent XMLNode& get_state (void); int set_state (const XMLNode&, int version); int set_state_2X (const XMLNode&, int, bool); + static void prepare_for_reset (XMLNode&, const std::string&); class BoolCombiner { public: @@ -150,7 +152,7 @@ class IO : public SessionObject, public Latent typedef bool result_type; template - bool operator() (Iter first, Iter last) const { + result_type operator() (Iter first, Iter last) const { bool r = false; while (first != last) { if (*first) { @@ -168,13 +170,11 @@ class IO : public SessionObject, public Latent * the change from happening. */ PBD::Signal1 PortCountChanging; - - static int disable_connecting (void); - static int enable_connecting (void); - static int disable_ports (void); - static int enable_ports (void); - static PBD::Signal1 PortCountChanged; // emitted when the number of ports changes + static int disable_connecting (); + static int enable_connecting (); + + static PBD::Signal1 PortCountChanged; // emitted when the number of ports changes static std::string name_from_state (const XMLNode&); static void set_name_in_state (XMLNode&, const std::string&); @@ -200,13 +200,14 @@ class IO : public SessionObject, public Latent int set_ports (const std::string& str); private: - mutable Glib::Mutex io_lock; + mutable Glib::Threads::Mutex io_lock; protected: PortSet _ports; Direction _direction; DataType _default_type; bool _active; + bool _sendish; private: int connecting_became_legal (); @@ -215,11 +216,11 @@ class IO : public SessionObject, public Latent boost::shared_ptr _bundle; ///< a bundle representing our ports struct UserBundleInfo { - UserBundleInfo (IO*, boost::shared_ptr b); - boost::shared_ptr bundle; - PBD::ScopedConnection changed; + UserBundleInfo (IO*, boost::shared_ptr b); + boost::shared_ptr bundle; + PBD::ScopedConnection changed; }; - + std::vector _bundles_connected; ///< user bundles connected to our ports static int parse_io_string (const std::string&, std::vector& chns); @@ -228,7 +229,6 @@ class IO : public SessionObject, public Latent int ensure_ports (ChanCount, bool clear, void *src); void check_bundles_connected (); - void check_bundles (std::vector&, const PortSet&); void bundle_changed (Bundle::Change); @@ -240,7 +240,7 @@ class IO : public SessionObject, public Latent boost::shared_ptr find_possible_bundle (const std::string &desired_name); - bool ensure_ports_locked (ChanCount, bool clear, void *src); + int ensure_ports_locked (ChanCount, bool clear, bool& changed); std::string build_legal_port_name (DataType type); int32_t find_port_hole (const char* base); @@ -249,6 +249,7 @@ class IO : public SessionObject, public Latent std::string bundle_channel_name (uint32_t, uint32_t, DataType) const; BufferSet _buffers; + void disconnect_check (boost::shared_ptr, boost::shared_ptr); }; } // namespace ARDOUR