3#include "audinate/dal/DAL.hpp"
4#include "audinate/dal/Audio.hpp"
5#include "audinate/dal/InstanceConfig.hpp"
9namespace Audinate {
namespace DAL {
14enum class InstanceState
33std::string toString(InstanceState state);
49 ComponentStatusChanged,
53 DeviceActivationStatusChanged
69 void set(
Type type, Component component) { mType = type; mComponent = component; }
72 void set(
Type type) { mType = type; }
89typedef std::function<void(
const InstanceEvent &)> InstanceEventFn;
100 Timestamp(Uint32 seconds, Uint32 nanoseconds) : mSeconds(seconds), mNanoseconds(nanoseconds) {}
102 bool operator==(
const Timestamp & t)
const {
return mSeconds == t.mSeconds && mNanoseconds == t.mNanoseconds; }
103 bool operator!=(
const Timestamp & t)
const {
return ! operator==(t); }
108 MaxControlThreadInterval,
109 MaxAudioThreadInterval,
111 NonSequentialPacketCount,
116 MonitoringEvent(Timestamp timestamp) : mTimestamp(timestamp), mTypes(), mMaxControlThreadIntervalUs(), mMaxAudioThreadIntervalUs(), mLatePacketCount(), mNonSequentialPacketCount() { mTypes.resize(
static_cast<size_t>(Type::NumTypes)); }
117 ~MonitoringEvent() {}
119 Timestamp getTimestamp()
const {
return mTimestamp; }
121 bool hasType(Type type)
const {
size_t index =
static_cast<size_t>(type);
return mTypes[index]; }
122 void setType(Type type) {
size_t index =
static_cast<size_t>(type); mTypes[index] =
true; }
125 Uint32 getMaxControlThreadIntervalUs()
const {
return mMaxControlThreadIntervalUs; }
126 void setMaxControlThreadIntervalUs(Uint32 interval) { setType(Type::MaxControlThreadInterval); mMaxControlThreadIntervalUs = interval; }
128 Uint32 getMaxAudioThreadIntervalUs()
const {
return mMaxAudioThreadIntervalUs; }
129 void setMaxAudioThreadIntervalUs(Uint32 interval) { setType(Type::MaxAudioThreadInterval); mMaxAudioThreadIntervalUs = interval; }
131 Uint32 getLatePacketCount()
const {
return mLatePacketCount; }
132 void setLatePacketCount(Uint32 count) { setType(Type::LatePacketCount); mLatePacketCount = count; }
134 Uint32 getNonSequentialPacketCount()
const {
return mNonSequentialPacketCount; }
135 void setNonSequentialPacketCount(Uint32 count) { setType(Type::NonSequentialPacketCount); mNonSequentialPacketCount = count; }
140 std::vector<bool> mTypes;
141 Uint32 mMaxControlThreadIntervalUs;
142 Uint32 mMaxAudioThreadIntervalUs;
143 Uint32 mLatePacketCount;
144 Uint32 mNonSequentialPacketCount;
168 virtual ~Instance() {}
255std::shared_ptr<Instance> createInstance(std::shared_ptr<DAL> dal,
const InstanceConfig & config);
A class encapsulating the information about DAL Instance's domain enrolment.
Definition Instance.hpp:154
std::string mDomainName
Name of the managed Dante Domain.
Definition Instance.hpp:158
bool mIsEnrolled
Is the DAL device currently enrolled in a managed Dante Domain.
Definition Instance.hpp:157
Configuration for a DAL instance.
Definition InstanceConfig.hpp:17
A class encapsulating events that are propagated by a DAL Instance.
Definition Instance.hpp:39
Component getComponent() const
Get the component (if any) associated with this event.
Definition Instance.hpp:66
Type
An enumeration of the different kinds of events that can occur.
Definition Instance.hpp:45
Type getType() const
Get the event type for this event.
Definition Instance.hpp:60
virtual void setMonitoringFn(MonitoringEventFn fn)=0
Set monitoring events callback function.
virtual ComponentStatus getComponentStatus(Component component)=0
Get the current status for the given component.
virtual void clearConfiguration()=0
Delete the configuration files of the child processes.
virtual bool isDeviceActivated() const =0
Get the device activation status.
virtual InstanceState getInstanceState() const =0
Get the current instance state.
virtual void start()=0
Start the instance.
virtual SocketDescriptor getProtocolSocketDescriptor(Protocol protocol)=0
Get the socket descriptor number for a protocol server socket.
virtual void clearDomainCredentials()=0
Delete the domain information.
virtual std::shared_ptr< Audio > getAudio()=0
Get the audio component object associated with this instance object.
virtual void stop()=0
Stop the instance.
virtual void setEventFn(InstanceEventFn fn)=0
Set the instance event function for this instance object.
virtual DomainInfo getDomainInfo() const =0
Get the domain info.
Definition Instance.hpp:95
Definition Instance.hpp:92