nominally add MIDI input support for AudioUnit plugins
[ardour.git] / libs / ardour / ardour / io.h
index 0be1493dbb4eeaa0162e8159a15a7cbcfda681bd..6793072cba8a710eb6c0da477e95cc210224c77d 100644 (file)
@@ -23,7 +23,6 @@
 #include <string>
 #include <vector>
 #include <cmath>
-#include <sigc++/signal.h>
 #include <jack/jack.h>
 
 #include <glibmm/thread.h>
@@ -34,7 +33,6 @@
 #include "pbd/controllable.h"
 
 #include "ardour/ardour.h"
-#include "ardour/automatable_controls.h"
 #include "ardour/automation_control.h"
 #include "ardour/bundle.h"
 #include "ardour/chan_count.h"
@@ -108,7 +106,9 @@ class IO : public SessionObject, public Latent
        int disconnect (Port *our_port, std::string other_port, void *src);
        int disconnect (void *src);
        bool connected_to (boost::shared_ptr<const IO>) const;
-
+        bool connected () const;
+        bool physically_connected () const;
+        
        nframes_t signal_latency() const { return _own_latency; }
        nframes_t latency() const;
        void      set_port_latency (nframes_t);
@@ -133,18 +133,19 @@ class IO : public SessionObject, public Latent
 
        const ChanCount& n_ports ()  const { return _ports.count(); }
 
-       sigc::signal<void,IOChange,void*> changed;
+       PBD::Signal2<void,IOChange,void*> changed;
 
        virtual XMLNode& state (bool full);
        XMLNode& get_state (void);
-       int set_state (const XMLNode&);
+       int set_state (const XMLNode&, int version);
+       int set_state_2X (const XMLNode&, int, bool);
 
        static int  disable_connecting (void);
        static int  enable_connecting (void);
        static int  disable_ports (void);
        static int  enable_ports (void);
 
-       static sigc::signal<void,ChanCount> PortCountChanged; // emitted when the number of ports changes
+       static PBD::Signal1<void,ChanCount> 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&);
@@ -152,15 +153,17 @@ class IO : public SessionObject, public Latent
        /* we have to defer/order port connection. this is how we do it.
        */
 
-       static sigc::signal<int> ConnectingLegal;
+       static PBD::Signal0<int> ConnectingLegal;
        static bool              connecting_legal;
 
        XMLNode *pending_state_node;
+       int pending_state_node_version;
+       bool pending_state_node_in;
 
        /* three utility functions - this just seems to be simplest place to put them */
 
        void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset);
-       void process_input (boost::shared_ptr<Processor>, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
+       void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, nframes_t nframes);
        void copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset);
 
        /* AudioTrack::deprecated_use_diskstream_connections() needs these */
@@ -177,20 +180,18 @@ class IO : public SessionObject, public Latent
        bool     _active;
 
   private:
-
        int connecting_became_legal ();
-       sigc::connection connection_legal_c;
+       PBD::ScopedConnection connection_legal_c;
 
        boost::shared_ptr<Bundle> _bundle; ///< a bundle representing our ports
 
        struct UserBundleInfo {
-               UserBundleInfo (IO*, boost::shared_ptr<UserBundle> b);
-
-               boost::shared_ptr<UserBundle> bundle;
-               sigc::connection changed;
+           UserBundleInfo (IO*, boost::shared_ptr<UserBundle> b);
+           boost::shared_ptr<UserBundle> bundle;
+           PBD::ScopedConnection changed;
        };
-
-       std::vector<UserBundleInfo> _bundles_connected; ///< user bundles connected to our ports
+       
+       std::vector<UserBundleInfo*> _bundles_connected; ///< user bundles connected to our ports
 
        static int parse_io_string (const std::string&, std::vector<std::string>& chns);
        static int parse_gain_string (const std::string&, std::vector<std::string>& chns);
@@ -198,14 +199,15 @@ class IO : public SessionObject, public Latent
        int ensure_ports (ChanCount, bool clear, bool lockit, void *src);
 
        void check_bundles_connected ();
-       void check_bundles (std::vector<UserBundleInfo>&, const PortSet&);
+       void check_bundles (std::vector<UserBundleInfo*>&, const PortSet&);
 
        void bundle_changed (Bundle::Change);
 
-
-       int get_port_counts (const XMLNode& node, ChanCount& n, boost::shared_ptr<Bundle>& c);
-       int create_ports (const XMLNode&);
-       int make_connections (const XMLNode&);
+       int get_port_counts (const XMLNode& node, int version, ChanCount& n, boost::shared_ptr<Bundle>& c);
+       int get_port_counts_2X (const XMLNode& node, int version, ChanCount& n, boost::shared_ptr<Bundle>& c);
+       int create_ports (const XMLNode&, int version);
+       int make_connections (const XMLNode&, int, bool);
+       int make_connections_2X (const XMLNode &, int, bool);
 
        boost::shared_ptr<Bundle> find_possible_bundle (const std::string &desired_name);
 
@@ -214,8 +216,8 @@ class IO : public SessionObject, public Latent
        std::string build_legal_port_name (DataType type);
        int32_t find_port_hole (const char* base);
 
-       void setup_bundles ();
-       std::string bundle_channel_name (uint32_t, uint32_t) const;
+       void setup_bundle ();
+       std::string bundle_channel_name (uint32_t, uint32_t, DataType) const;
 };
 
 } // namespace ARDOUR