From 9ac6bb9befa047a6c349bed02d40da84600b67cc Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 24 Jul 2013 19:29:45 -0400 Subject: part-way through getting the audioengine changes to compile --- libs/ardour/ardour/port_manager.h | 60 ++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 29 deletions(-) (limited to 'libs/ardour/ardour/port_manager.h') diff --git a/libs/ardour/ardour/port_manager.h b/libs/ardour/ardour/port_manager.h index f6aedc02a1..399ab46b34 100644 --- a/libs/ardour/ardour/port_manager.h +++ b/libs/ardour/ardour/port_manager.h @@ -32,11 +32,11 @@ #include "pbd/rcu.h" #include "ardour/chan_count.h" +#include "ardour/port.h" +#include "ardour/port_engine.h" namespace ARDOUR { -class Port; - class PortManager { public: @@ -44,36 +44,44 @@ class PortManager PortManager(); virtual ~PortManager() {} + + PortEngine& port_engine() { return *_impl; } /* Port registration */ - virtual boost::shared_ptr register_input_port (DataType, const std::string& portname) = 0; - virtual boost::shared_ptr register_output_port (DataType, const std::string& portname) = 0; - virtual int unregister_port (boost::shared_ptr) = 0; + boost::shared_ptr register_input_port (DataType, const std::string& portname); + boost::shared_ptr register_output_port (DataType, const std::string& portname); + int unregister_port (boost::shared_ptr); /* Port connectivity */ - virtual int connect (const std::string& source, const std::string& destination) = 0; - virtual int disconnect (const std::string& source, const std::string& destination) = 0; - virtual int disconnect (boost::shared_ptr) = 0; - + int connect (const std::string& source, const std::string& destination); + int disconnect (const std::string& source, const std::string& destination); + int disconnect (boost::shared_ptr); + bool connected (const std::string&); + /* other Port management */ - virtual bool port_is_physical (const std::string&) const = 0; - virtual void get_physical_outputs (DataType type, std::vector&) = 0; - virtual void get_physical_inputs (DataType type, std::vector&) = 0; - virtual boost::shared_ptr get_port_by_name (const std::string &) = 0; - virtual void port_renamed (const std::string&, const std::string&) = 0; - virtual ChanCount n_physical_outputs () const = 0; - virtual ChanCount n_physical_inputs () const = 0; - virtual const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags) = 0; + bool port_is_physical (const std::string&) const; + void get_physical_outputs (DataType type, std::vector&); + void get_physical_inputs (DataType type, std::vector&); + boost::shared_ptr get_port_by_name (const std::string &); + void port_renamed (const std::string&, const std::string&); + ChanCount n_physical_outputs () const; + ChanCount n_physical_inputs () const; + const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags); void remove_all_ports (); /* per-Port monitoring */ - virtual bool can_request_input_monitoring () const = 0; - virtual void request_input_monitoring (const std::string&, bool) const = 0; + bool can_request_input_monitoring () const; + void request_input_monitoring (const std::string&, bool) const; + void ensure_input_monitoring (const std::string&, bool) const; + + std::string make_port_name_relative (const std::string&) const; + std::string make_port_name_non_relative (const std::string&) const; + bool port_is_mine (const std::string&) const; class PortRegistrationFailure : public std::exception { public: @@ -82,23 +90,17 @@ class PortManager ~PortRegistrationFailure () throw () {} - virtual const char *what() const throw () { return reason.c_str(); } + const char *what() const throw () { return reason.c_str(); } private: std::string reason; }; + protected: - typedef void* PortHandle; - PortHandle register (const std::string&, DataType type, Port::Flags); - void unregister (PortHandle); - bool connected (PortHandle); - int disconnect_all (PortHandle); - bool connected_to (PortHandle, const std::string); - int get_connections (PortHandle, std::vector&); - - private: + PortEngine* _impl; SerializedRCUManager ports; + boost::shared_ptr register_port (DataType type, const std::string& portname, bool input); void port_registration_failure (const std::string& portname); }; -- cgit v1.2.3