diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-07-23 22:14:52 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-07-23 22:14:52 -0400 |
commit | f8ef1e94c30d4db0c8e7a648e5f81c113593e3d3 (patch) | |
tree | f97d2ad51742f7b4fa41b214f3c847a117fc90af /libs/ardour/ardour/port_manager.h | |
parent | 8da6a70ead63767b701a00aeaf859569b0d31ee4 (diff) |
inch-like progress on defining the API for AudioBackend and separating AudioEngine from this
Diffstat (limited to 'libs/ardour/ardour/port_manager.h')
-rw-r--r-- | libs/ardour/ardour/port_manager.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libs/ardour/ardour/port_manager.h b/libs/ardour/ardour/port_manager.h new file mode 100644 index 0000000000..8a363899ea --- /dev/null +++ b/libs/ardour/ardour/port_manager.h @@ -0,0 +1,50 @@ +namespace ARDOUR + +class PortManager +{ + public: + PortManager() {} + virtual ~PortManager() {} + + /* Port registration */ + + virtual boost::shared_ptr<Port> register_input_port (DataType, const std::string& portname) = 0; + virtual boost::shared_ptr<Port> register_output_port (DataType, const std::string& portname) = 0; + virtual int unregister_port (boost::shared_ptr<Port>) = 0; + + /* 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<Port>) = 0; + + /* other Port management */ + + virtual bool port_is_physical (const std::string&) const = 0; + virtual void get_physical_outputs (DataType type, std::vector<std::string>&) = 0; + virtual void get_physical_inputs (DataType type, std::vector<std::string>&) = 0; + virtual boost::shared_ptr<Port> 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; + + /* per-Port monitoring */ + + virtual bool can_request_input_monitoring () const = 0; + virtual void request_input_monitoring (const std::string&, bool) const = 0; + + class PortRegistrationFailure : public std::exception { + public: + PortRegistrationFailure (std::string const & why = "") + : reason (why) {} + + ~PortRegistrationFailure () throw () {} + + virtual const char *what() const throw () { return reason.c_str(); } + + private: + std::string reason; + }; + +}; |