|
Dante Application Library API
|
3 #include "audinate/dal/Common.hpp"
4 #include "audinate/dal/ConnectionsConfig.hpp"
5 #include "audinate/dal/DAL.hpp"
11 namespace Audinate {
namespace DAL {
23 LocalDevice() : mNumTxChannels(), mNumRxChannels() {}
25 bool operator==(
const LocalDevice & other)
const {
return mNumTxChannels == other.mNumTxChannels && mNumRxChannels == other.mNumRxChannels; }
26 bool operator!=(
const LocalDevice & other)
const {
return !(operator==(other)); }
28 unsigned int mNumTxChannels;
29 unsigned int mNumRxChannels;
38 DeviceChannels() : mDeviceName(), mChannelNames(), mIpv4Address(), mIdentifiable(), mSending() {}
39 bool operator==(
const DeviceChannels & other)
const {
return mDeviceName == other.mDeviceName && mChannelNames == other.mChannelNames && mIpv4Address == other.mIpv4Address && mIdentifiable == other.mIdentifiable && mSending == other.mSending; }
40 bool operator!=(
const DeviceChannels & other)
const {
return !(operator==(other)); }
42 std::string mDeviceName;
43 std::vector<std::string> mChannelNames;
58 bool operator==(
const AvailableChannels & other)
const {
return mDevices == other.mDevices; }
59 bool operator!=(
const AvailableChannels & other)
const {
return !(operator==(other)); }
61 std::vector<DeviceChannels> mDevices;
64 enum class ConnectionStatus
76 DestinationDeviceNotFound,
79 DestinationChannelNotFound,
94 std::string toString(ConnectionStatus status);
96 typedef Uint8 SubscriptionStatus;
98 std::string subscriptionStatusToString(uint8_t subscriptionStatus);
117 typedef std::function<void()> LocalDeviceChangedFn;
124 typedef std::function<void(std::vector<unsigned int> txChannelIds, std::vector<unsigned int> rxChannelIds)> AvailableChannelsChangedFn;
131 typedef std::function<void(ChannelDirection dir, std::vector<unsigned int> channelIds)> ConnectionChangedFn;
161 virtual void identify(
const std::string & deviceName) = 0;
168 virtual void setReceiveChannelSource(
unsigned int rxChannelId,
const std::string & remoteChannelName,
const std::string & remoteDeviceName) = 0;
181 virtual void setTransmitChannelDestination(
unsigned int txChannelId,
const std::string & remoteChannelName,
const std::string & remoteDeviceName) = 0;
231 std::shared_ptr<Connections> createConnections(std::shared_ptr<DAL> dal,
const ConnectionsConfig & config);
std::string mRemoteChannelName
Channel name for the remote channel of the subscribed device.
Definition: Connections.hpp:107
The local device's current settings.
Definition: Connections.hpp:20
virtual void setLocalDeviceChangedFn(LocalDeviceChangedFn fn)=0
Add a handler to be notified when the set of local device changes.
SubscriptionStatus mSubscriptionStatus
Current subscription status of the connection.
Definition: Connections.hpp:111
virtual void clearRemoteSubscriptionsToLocalDevice()=0
Remove all remote rx channels subscriptions to the local device that are not part of a currently conf...
virtual void setTransmitChannelDestination(unsigned int txChannelId, const std::string &remoteChannelName, const std::string &remoteDeviceName)=0
Specify a remote channel that will receive audio from the given local transmit channel.
virtual AvailableChannels getAvailableDestinations(unsigned int txChannelId)=0
Get the list of available destinations for the given transmit channel.
Connection class for managing connections between other Dante devices and the DAL device.
Definition: Connections.hpp:103
virtual Connection getReceiveChannelState(unsigned int rxChannelId)=0
Get the connection state for the given receive channel.
Definition: ConnectionsConfig.hpp:7
unsigned int mLocalChannelId
Channel ID for the local channel of the DAL device.
Definition: Connections.hpp:106
Definition: Common.hpp:27
ConnectionStatus mConnectionStatus
Current status of the connection.
Definition: Connections.hpp:110
virtual LocalDevice getLocalDevice()=0
Get information about the local device.
virtual void setAvailableChannelsChangedFn(AvailableChannelsChangedFn fn)=0
Add a handler to be notified when the set of available channels changes.
virtual void identify(const std::string &deviceName)=0
Attempt to identify a given device.
virtual Connection getTransmitChannelState(unsigned int txChannelId)=0
Get the connection state for the given transmit channel.
Definition: Connections.hpp:133
std::string mRemoteDeviceName
Device name for the remote device the channel is subscribed to.
Definition: Connections.hpp:108
A device name and list of channel names for that device.
Definition: Connections.hpp:35
virtual void setConnectionChangedFn(ConnectionChangedFn fn)=0
Add a handler to be notified when connection state changes for one or more channels.
A list of channels on the network, grouped by device.
Definition: Connections.hpp:54
virtual void setReceiveChannelSource(unsigned int rxChannelId, const std::string &remoteChannelName, const std::string &remoteDeviceName)=0
Specify the remote channel from which the local receive channel will receive audio To clear the confi...
virtual AvailableChannels getAvailableSources(unsigned int rxChannelId)=0
Get the list of available sources for the given receive channel.