20 #ifndef _libardour_port_engine_shared_h_
21 #define _libardour_port_engine_shared_h_
39 class PortEngineSharedImpl;
55 const std::string&
name ()
const {
return _name; }
56 const std::string&
pretty_name ()
const {
return _pretty_name; }
100 return for_playback ? _playback_latency_range : _capture_latency_range;
128 virtual size_t size ()
const = 0;
130 virtual const uint8_t*
data ()
const = 0;
165 int connect (
const std::string& src,
const std::string& dst);
166 int disconnect (
const std::string& src,
const std::string& dst);
191 : a (a) , b (b) , c (c) {}
200 pthread_mutex_lock (&_port_callback_mutex);
202 pthread_mutex_unlock (&_port_callback_mutex);
208 _port_change_flag.store (1);
224 typedef std::map<std::string, BackendPortPtr>
PortMap;
225 typedef std::set<BackendPortPtr, SortByPortName>
PortIndex;
233 std::shared_ptr<PortRegistry const> p = _portregistry.
reader ();
234 return p->find (port) != p->end ();
238 std::shared_ptr<PortMap const> p = _portmap.
reader ();
239 PortMap::const_iterator it = p->find (port_name);
240 if (it == p->end ()) {
virtual size_t size() const =0
virtual pframes_t timestamp() const =0
virtual ~BackendMIDIEvent()
virtual const uint8_t * data() const =0
PortEngineSharedImpl & _backend
bool is_physically_connected() const
bool is_connected() const
int set_pretty_name(const std::string &name)
LatencyRange _capture_latency_range
const std::string & name() const
bool is_connected(BackendPortHandle port) const
int set_name(const std::string &name)
void set_latency_range(const LatencyRange &latency_range, bool for_playback)
virtual void * get_buffer(pframes_t nframes)=0
void remove_connection(BackendPortHandle)
int connect(BackendPortHandle port, BackendPortHandle self)
const std::set< BackendPortPtr > & get_connections() const
void store_connection(BackendPortHandle)
LatencyRange _playback_latency_range
virtual DataType type() const =0
void disconnect_all(BackendPortHandle self)
std::string _hw_port_name
const std::string & pretty_name() const
int disconnect(BackendPortHandle port, BackendPortHandle self)
std::set< BackendPortPtr > _connections
BackendPort(PortEngineSharedImpl &b, const std::string &, PortFlags)
void update_connected_latency(bool for_playback)
const std::string & hw_port_name() const
const LatencyRange latency_range(bool for_playback) const
int set_hw_port_name(const std::string &name)
std::vector< BackendPortPtr > _system_inputs
std::vector< BackendPortPtr > _system_outputs
std::vector< BackendPortPtr > _system_midi_out
int set_port_name(PortEngine::PortHandle, const std::string &)
int connect(PortEngine::PortHandle, const std::string &)
uint32_t port_name_size() const
virtual void unregister_port(PortEngine::PortHandle)
virtual ~PortEngineSharedImpl()
SerializedRCUManager< PortIndex > _ports
bool physically_connected(PortEngine::PortHandle, bool process_callback_safe)
std::set< BackendPortPtr, SortByPortName > PortIndex
virtual void update_system_port_latencies()
BackendPortPtr add_port(const std::string &shortname, ARDOUR::DataType, ARDOUR::PortFlags)
int disconnect(const std::string &src, const std::string &dst)
PortEngine::PortPtr get_port_by_name(const std::string &) const
int get_ports(const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &) const
int connect(const std::string &src, const std::string &dst)
ChanCount n_physical_outputs() const
std::string _instance_name
int disconnect(PortEngine::PortHandle, const std::string &)
PortFlags get_port_flags(PortEngine::PortHandle) const
bool connected_to(PortEngine::PortHandle, const std::string &, bool process_callback_safe)
void port_connect_callback(const std::string &a, const std::string &b, bool conn)
std::vector< BackendPortPtr > _system_midi_in
BackendPortPtr find_port(const std::string &port_name) const
std::atomic< int > _port_change_flag
bool valid_port(BackendPortHandle port) const
pthread_mutex_t _port_callback_mutex
bool connected(PortEngine::PortHandle, bool process_callback_safe)
std::map< std::string, BackendPortPtr > PortMap
void process_connection_queue_locked(PortManager &mgr)
int get_connections(PortEngine::PortHandle, std::vector< std::string > &, bool process_callback_safe)
std::string get_port_name(PortEngine::PortHandle) const
ChanCount n_physical_inputs() const
SerializedRCUManager< PortMap > _portmap
PortEngineSharedImpl(PortManager &mgr, std::string const &instance_name)
std::set< BackendPortPtr > PortRegistry
void get_physical_outputs(DataType type, std::vector< std::string > &)
void unregister_ports(bool system_only=false)
SerializedRCUManager< PortRegistry > _portregistry
void port_connect_add_remove_callback()
std::vector< PortConnectData * > _port_connection_queue
void get_physical_inputs(DataType type, std::vector< std::string > &)
DataType port_data_type(PortEngine::PortHandle) const
virtual BackendPort * port_factory(std::string const &name, ARDOUR::DataType dt, ARDOUR::PortFlags flags)=0
int disconnect_all(PortEngine::PortHandle)
bool port_is_physical(PortEngine::PortHandle) const
int get_port_property(PortEngine::PortHandle, const std::string &key, std::string &value, std::string &type) const
int set_port_property(PortEngine::PortHandle, const std::string &key, const std::string &value, const std::string &type)
PortEngine::PortPtr register_port(const std::string &shortname, ARDOUR::DataType, ARDOUR::PortFlags)
PortPtr const & PortHandle
std::shared_ptr< ProtoPort > PortPtr
std::shared_ptr< T const > reader() const
GtkImageIconNameData name
std::shared_ptr< BackendPort > const & BackendPortHandle
std::shared_ptr< BackendPort > BackendPortPtr
bool naturally_less(const char *a, const char *b)
PortConnectData(const std::string &a, const std::string &b, bool c)