save version string with session for informational purposes
[ardour.git] / libs / ardour / ardour / io.h
index 88706ecea11c30c49873a954b803fdfd6b09fbce..5511f64dd683b3becf62f58ac146134ab12135f4 100644 (file)
@@ -23,9 +23,8 @@
 #include <string>
 #include <vector>
 #include <cmath>
-#include <jack/jack.h>
 
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 
 #include "pbd/fastlog.h"
 #include "pbd/undo.h"
@@ -40,6 +39,7 @@
 #include "ardour/latent.h"
 #include "ardour/port_set.h"
 #include "ardour/session_object.h"
+#include "ardour/libardour_visibility.h"
 #include "ardour/types.h"
 #include "ardour/utils.h"
 #include "ardour/buffer_set.h"
@@ -64,7 +64,7 @@ class UserBundle;
  * An IO can contain ports of varying types, making routes/inserts/etc with
  * varied combinations of types (eg MIDI and audio) possible.
  */
-class IO : public SessionObject, public Latent
+class LIBARDOUR_API IO : public SessionObject, public Latent
 {
   public:
        static const std::string state_node_name;
@@ -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();
 
@@ -88,13 +88,15 @@ class IO : public SessionObject, public Latent
        void set_active(bool yn) { _active = yn; }
 
        bool set_name (const std::string& str);
+       void set_pretty_name (const std::string& str);
+       std::string pretty_name () const { return _pretty_name_prefix; }
 
        virtual void silence (framecnt_t);
        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<Bundle>, void *);
+       int connect_ports_to_bundle (boost::shared_ptr<Bundle>, bool exclusive, void *);
        int disconnect_ports_from_bundle (boost::shared_ptr<Bundle>, void *);
 
        BundleList bundles_connected ();
@@ -144,6 +146,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:
@@ -151,7 +154,7 @@ class IO : public SessionObject, public Latent
                typedef bool result_type;
 
                template <typename Iter>
-               bool operator() (Iter first, Iter last) const {
+               result_type operator() (Iter first, Iter last) const {
                        bool r = false;
                        while (first != last) {
                                if (*first) {
@@ -199,13 +202,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 ();
@@ -246,6 +250,8 @@ class IO : public SessionObject, public Latent
        void setup_bundle ();
        std::string bundle_channel_name (uint32_t, uint32_t, DataType) const;
 
+       void apply_pretty_name ();
+       std::string _pretty_name_prefix;
        BufferSet _buffers;
        void disconnect_check (boost::shared_ptr<ARDOUR::Port>, boost::shared_ptr<ARDOUR::Port>);
 };