Remove some unused PostTransport enums and renumber others.
[ardour.git] / libs / ardour / ardour / io.h
index a7ba3a23a9c3acd30b9becf166306bcb43b4cd29..865971b3777adb39fbe29a85a2b2b9f2ff2fe0a2 100644 (file)
@@ -33,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"
@@ -43,6 +42,7 @@
 #include "ardour/session_object.h"
 #include "ardour/types.h"
 #include "ardour/utils.h"
+#include "ardour/buffer_set.h"
 
 class XMLNode;
 
@@ -51,7 +51,6 @@ namespace ARDOUR {
 class Amp;
 class AudioEngine;
 class AudioPort;
-class BufferSet;
 class Bundle;
 class MidiPort;
 class PeakMeter;
@@ -90,7 +89,8 @@ class IO : public SessionObject, public Latent
 
        bool set_name (const std::string& str);
 
-       virtual void silence  (nframes_t);
+       virtual void silence (framecnt_t);
+       void increment_port_buffer_offset (pframes_t offset);
 
        int ensure_io (ChanCount cnt, bool clear, void *src);
 
@@ -107,17 +107,17 @@ 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 connected () const;
+       bool physically_connected () const;
 
-       nframes_t signal_latency() const { return _own_latency; }
-       nframes_t latency() const;
-       void      set_port_latency (nframes_t);
-
-       void update_port_total_latencies ();
+       framecnt_t signal_latency () const { return _own_latency; }
+       framecnt_t latency () const;
 
        PortSet& ports() { return _ports; }
        const PortSet& ports() const { return _ports; }
 
+       bool has_port (Port *) const;
+
        Port *nth (uint32_t n) const {
                if (n < _ports.num_ports()) {
                        return _ports.port(n);
@@ -133,13 +133,42 @@ class IO : public SessionObject, public Latent
 
        const ChanCount& n_ports ()  const { return _ports.count(); }
 
-       PBD::Signal2<void,IOChange,void*> changed;
+       /* The process lock will be held on emission of this signal if
+        * IOChange contains ConfigurationChanged.  In other cases,
+        * the process lock status is undefined.
+        */
+       PBD::Signal2<void, IOChange, void *> changed;
 
        virtual XMLNode& state (bool full);
        XMLNode& get_state (void);
        int set_state (const XMLNode&, int version);
        int set_state_2X (const XMLNode&, int, bool);
 
+       class BoolCombiner {
+       public:
+
+               typedef bool result_type;
+
+               template <typename Iter>
+               bool operator() (Iter first, Iter last) const {
+                       bool r = false;
+                       while (first != last) {
+                               if (*first) {
+                                       r = true;
+                               }
+                               ++first;
+                       }
+
+                       return r;
+               }
+       };
+
+       /** Emitted when the port count is about to change.  Objects
+        *  can attach to this, and return `true' if they want to prevent
+        *  the change from happening.
+        */
+       PBD::Signal1<bool, ChanCount, BoolCombiner> PortCountChanging;
+
        static int  disable_connecting (void);
        static int  enable_connecting (void);
        static int  disable_ports (void);
@@ -162,9 +191,9 @@ class IO : public SessionObject, public Latent
 
        /* 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 copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset);
+       void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset);
+       void process_input (boost::shared_ptr<Processor>, framepos_t start_frame, framepos_t end_frame, pframes_t nframes);
+       void copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, framecnt_t offset);
 
        /* AudioTrack::deprecated_use_diskstream_connections() needs these */
 
@@ -190,13 +219,13 @@ class IO : public SessionObject, public Latent
            boost::shared_ptr<UserBundle> bundle;
            PBD::ScopedConnection changed;
        };
-       
+
        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);
 
-       int ensure_ports (ChanCount, bool clear, bool lockit, void *src);
+       int ensure_ports (ChanCount, bool clear, void *src);
 
        void check_bundles_connected ();
        void check_bundles (std::vector<UserBundleInfo*>&, const PortSet&);
@@ -217,7 +246,9 @@ class IO : public SessionObject, public Latent
        int32_t find_port_hole (const char* base);
 
        void setup_bundle ();
-       std::string bundle_channel_name (uint32_t, uint32_t) const;
+       std::string bundle_channel_name (uint32_t, uint32_t, DataType) const;
+
+       BufferSet _buffers;
 };
 
 } // namespace ARDOUR