-
- virtual DataType type() const = 0;
- virtual void cycle_start(nframes_t nframes) {}
- virtual void cycle_end() {}
- virtual Buffer& get_buffer() = 0;
- virtual std::string short_name() = 0;
- virtual int set_name (std::string str) = 0;
- virtual int reestablish () = 0;
- virtual int connected () const = 0;
- virtual bool connected_to (const std::string& portname) const = 0;
- virtual const char ** get_connections () const = 0;
- virtual bool monitoring_input () const = 0;
- virtual void ensure_monitor_input (bool yn) = 0;
- virtual void request_monitor_input (bool yn) = 0;
- virtual nframes_t latency () const = 0;
- virtual nframes_t total_latency () const = 0;
- virtual void set_latency (nframes_t nframes) = 0;
-
- sigc::signal<void,bool> MonitorInputChanged;
- sigc::signal<void,bool> ClockSyncChanged;
-
- protected:
- friend class AudioEngine;
-
- Port ();
-
- virtual int disconnect () = 0;
- virtual void recompute_total_latency() const = 0;
- virtual void reset ();
-
- /* engine isn't supposed to access below here */
-
- Flags _flags;
- std::string _type;
- std::string _name;
- unsigned short _metering;
- bool _last_monitor;
+ static void increment_global_port_buffer_offset (pframes_t n) {
+ _global_port_buffer_offset += n;
+ }
+
+ virtual void increment_port_buffer_offset (pframes_t n);
+
+ virtual XMLNode& get_state (void) const;
+ virtual int set_state (const XMLNode&, int version);
+
+ static std::string state_node_name;
+
+protected:
+
+ Port (std::string const &, DataType, PortFlags);
+
+ PortEngine::PortHandle _port_handle;
+
+ static bool _connecting_blocked;
+ static pframes_t _global_port_buffer_offset; /* access only from process() tree */
+ static pframes_t _cycle_nframes; /* access only from process() tree */
+
+ framecnt_t _port_buffer_offset; /* access only from process() tree */
+
+ LatencyRange _private_playback_latency;
+ LatencyRange _private_capture_latency;
+
+private:
+ std::string _name; ///< port short name
+ PortFlags _flags; ///< flags
+ bool _last_monitor;
+
+ /** ports that we are connected to, kept so that we can
+ reconnect to the backend when required
+ */
+ std::set<std::string> _connections;
+
+ void port_connected_or_disconnected (boost::weak_ptr<Port>, boost::weak_ptr<Port>, bool);
+ void signal_drop ();
+ void drop ();
+ PBD::ScopedConnection drop_connection;
+ PBD::ScopedConnection engine_connection;