VCA API-change: return created VCAs (handy for Lua scripts)
[ardour.git] / libs / ardour / ardour / bundle.h
index 2bf614e75f86015cd3bf76864da2b559e893dc38..a84ae624f6e0f7062ba1b347f8b4267a6966cf31 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <string>
 #include <vector>
-#include <glibmm/thread.h>
+#include <glibmm/threads.h>
 #include <boost/shared_ptr.hpp>
 
 #include "pbd/signals.h"
@@ -40,7 +40,7 @@ class AudioEngine;
  *  `Channel' is a rather overloaded term but I can't think of a better
  *  one right now.
  */
-class Bundle : public PBD::ScopedConnectionList
+class LIBARDOUR_API Bundle : public PBD::ScopedConnectionList
 {
   public:
 
@@ -73,6 +73,7 @@ class Bundle : public PBD::ScopedConnectionList
 
        /** @return Number of channels that this Bundle has */
        ChanCount nchannels () const;
+       uint32_t n_total () const; /* shortcut for nchannels().n_total() */
 
        /** @param Channel index.
         *  @return Ports associated with this channel.
@@ -96,9 +97,12 @@ class Bundle : public PBD::ScopedConnectionList
        void remove_channel (uint32_t);
        void remove_channels ();
        void add_channels_from_bundle (boost::shared_ptr<Bundle>);
-       void connect (boost::shared_ptr<Bundle>, AudioEngine &);
+       void connect (boost::shared_ptr<Bundle>, AudioEngine &,
+                     bool allow_partial = false);
        void disconnect (boost::shared_ptr<Bundle>, AudioEngine &);
-       bool connected_to (boost::shared_ptr<Bundle>, AudioEngine &);
+       bool connected_to (boost::shared_ptr<Bundle>, AudioEngine &,
+                          DataType type = DataType::NIL,
+                          bool exclusive = false);
        bool connected_to_anything (AudioEngine &);
        bool has_same_ports (boost::shared_ptr<Bundle>) const;
        uint32_t type_channel_to_overall (DataType, uint32_t) const;
@@ -134,7 +138,7 @@ class Bundle : public PBD::ScopedConnectionList
 
        /// mutex for _channel_ports and _channel_names
        /// XXX: is this necessary?
-       mutable Glib::Mutex _channel_mutex;
+       mutable Glib::Threads::Mutex _channel_mutex;
        std::vector<Channel> _channel;
 
   private:
@@ -149,8 +153,9 @@ class Bundle : public PBD::ScopedConnectionList
        Change _pending_change;
 };
 
-struct BundleChannel
+class LIBARDOUR_API BundleChannel
 {
+public:
        BundleChannel () : channel (-1) {}
 
        BundleChannel (boost::shared_ptr<Bundle> b, int c)