Dante Application Library API
Loading...
Searching...
No Matches
InstanceConfig.hpp
1#pragma once
2
3#include "audinate/dal/Common.hpp"
4
5#include <map>
6
7namespace Audinate { namespace DAL {
8
16class InstanceConfig
17{
18public:
19 // Constructor
20 InstanceConfig();
21
22 // Destructor
23 ~InstanceConfig();
24
25 //------------------------------------------------------
26 // Identity
27 //------------------------------------------------------
28
33 void setManufacturerName(const std::string & manufacturerName);
34
39 std::string getManufacturerName() const;
40
45 void setManufacturerVersion(const Version & manufacturerVersion);
46
52
57 void setModelName(const std::string & modelName);
58
63 std::string getModelName() const;
64
69 void setModelId(const Id64 & modelId);
70
76
82 void setDefaultName(const std::string & name);
83
88 std::string getDefaultName() const;
89
90 //------------------------------------------------------
91 // General Dante capabilities.
92 //------------------------------------------------------
93
98 void setNumTxChannels(unsigned int numTxChannels);
99
104 unsigned int getNumTxChannels() const;
105
112 void setTxChannelName(unsigned int txChannelIndex, const std::string & name);
113
119 std::string getTxChannelName(unsigned int txChannelIndex) const;
120
125 void setNumRxChannels(unsigned int numRxChannels);
126
131 unsigned int getNumRxChannels() const;
132
139 void setRxChannelName(unsigned int rxChannelIndex, const std::string & name);
140
146 std::string getRxChannelName(unsigned int rxChannelIndex) const;
147
152 void setNumTxFlows(unsigned int numTxFlows);
153
158 unsigned int getNumTxFlows() const;
159
164 void setNumRxFlows(unsigned int numRxFlows);
165
170 unsigned int getNumRxFlows() const;
171
179 void setSamplerate(Samplerate samplerate);
180
185 Samplerate getSamplerate() const;
186
187 //------------------------------------------------------
188 // Platform
189 //------------------------------------------------------
190
197 void setInterfaceName(InterfaceName name);
198
203 InterfaceName getInterfaceName() const;
204
210 void setInterfaceIndex(InterfaceIndex index);
211
216 InterfaceIndex getInterfaceIndex() const;
217
218 //------------------------------------------------------
219 // Port configuration
220 //------------------------------------------------------
221
227 void setProtocolSocketDescriptor(Protocol protocol, SocketDescriptor socketDescriptor);
228
234
239 void setAudioPortRange(uint16_t range);
240
245 uint16_t getAudioPortRange() const;
246
247 //------------------------------------------------------
248 // Network time configuration
249 //------------------------------------------------------
250
255 void setTimeSource(TimeSource timeSource);
256
261 TimeSource getTimeSource() const;
262
269
275
276 //------------------------------------------------------
277 // Process and file management configuration
278 //------------------------------------------------------
279
284 void setProcessPath(std::string processPath);
285
290 std::string getProcessPath() const;
291
296 void setConfigurationPath(std::string configurationPath);
297
302 std::string getConfigurationPath() const;
303
308 void setLoggingPath(std::string loggingPath);
309
314 std::string getLoggingPath() const;
315
316 //------------------------------------------------------
317 // Audio Buffer configuration
318 //------------------------------------------------------
319
324 void setSamplesPerPeriod(unsigned int samplesPerPeriod);
325
330 unsigned int getSamplesPerPeriod() const;
331
336 void setPeriodsPerBuffer(unsigned int periodsPerBuffer);
337
342 unsigned int getPeriodsPerBuffer() const;
343
348 void setEncoding(unsigned int encoding);
349
354 unsigned int getEncoding() const;
355
361 void setPerChannelEncodingFile(const std::string & fileName);
362
368 std::string getPerChannelEncodingFile() const;
369
374 void setLogLevel(LogLevel logLevel);
375
380 LogLevel getLogLevel() const;
381
387 void setNetworkLatency(unsigned int networkLatency);
388
393 unsigned int getNetworkLatency() const;
394
400 void setActivationDirectory(const std::string & path);
401
406 std::string getActivationDirectory() const;
407
412 void setCloseWebSocketOnActivation(bool closeWebSocketOnActivation);
413
419
420private:
421 std::string mManufacturerName;
422 Version mManufacturerVersion;
423 std::string mModelName;
424 Id64 mModelId;
425 std::string mDefaultName;
426 std::vector<std::string> mTxChannels;
427 std::vector<std::string> mRxChannels;
428 unsigned int mNumTxFlows;
429 unsigned int mNumRxFlows;
430 Samplerate mSamplerate;
431 InterfaceName mInterfaceName;
432 InterfaceIndex mInterfaceIndex;
433 std::map<Protocol, SocketDescriptor> mProtocolSocketDescriptors;
434 unsigned int mAudioPortRange;
435 TimeSource mTimeSource;
436 bool mAllowAudioProcessingBeforeNetworkTimeSync;
437 unsigned int mSamplesPerPeriod;
438 unsigned int mPeriodsPerBuffer;
439 unsigned int mEncoding;
440 std::string mPerChannelEncodingFile;
441 std::string mProcessPath;
442 std::string mConfigurationPath;
443 std::string mLoggingPath;
444 LogLevel mLogLevel;
445 unsigned int mNetworkLatency;
446 std::string mActivationDirectory;
447 bool mCloseWebSocketOnActivation;
448};
449
450
451
452};};
Definition Types.hpp:91
void setNumTxChannels(unsigned int numTxChannels)
Set the number of transmit channels for the DAL instance.
void setProtocolSocketDescriptor(Protocol protocol, SocketDescriptor socketDescriptor)
Set the socket descriptor (port number or socket path) to be used by DAL for the given protocol.
Version getManufacturerVersion() const
Get the manufacturer product version for the DAL Instance.
Samplerate getSamplerate() const
Get the samplerate for the DAL instance.
void setPeriodsPerBuffer(unsigned int periodsPerBuffer)
Set the number of periods to be stored in each channel buffer.
void setProcessPath(std::string processPath)
Set the local filesystem path where the DAL instance's supporting binaries can be found.
void setNumTxFlows(unsigned int numTxFlows)
Override the default number of the transmit flows for the DAL instance.
void setInterfaceIndex(InterfaceIndex index)
Set the index of the local network interface on which DAL will run.
void setRxChannelName(unsigned int rxChannelIndex, const std::string &name)
Set the default name for the given receive (rx) channel.
unsigned int getNumTxChannels() const
Get the number of transmit channels for the DAL instance.
void setNumRxChannels(unsigned int numRxChannels)
Set the number of receive channels for the DAL instance.
std::string getTxChannelName(unsigned int txChannelIndex) const
Get the default name for the given tx channel.
void setModelId(const Id64 &modelId)
Set the model id for the DAL Instance.
std::string getPerChannelEncodingFile() const
Get the path to per-channel encoding file used by DAL instance.
unsigned int getPeriodsPerBuffer() const
Get the number of periods for each channel buffer.
std::string getDefaultName() const
Get the default device name for the DAL instance.
unsigned int getNumTxFlows() const
Get the number of transmit (tx) flows.
std::string getManufacturerName() const
Get the manufacturer friendly name for the DAL Instance.
std::string getProcessPath() const
Get the local filesystem path where the DAL instance's supporting binaries can be found.
unsigned int getEncoding() const
Get the encoding used by the DAL instance.
std::string getRxChannelName(unsigned int rxChannelIndex) const
Get the default name for the given receive (rx) channel.
LogLevel getLogLevel() const
Get the log level for DAL instance.
void setInterfaceName(InterfaceName name)
Set the name of the local network interface on which DAL will run.
void setNumRxFlows(unsigned int numRxFlows)
Override the default number of receive flows for the DAL instance.
std::string getLoggingPath() const
Get the logging path used by the child processes for storing log information.
void setTxChannelName(unsigned int txChannelIndex, const std::string &name)
Set the default name for the given transmit (tx) channel.
void setTimeSource(TimeSource timeSource)
Set the time source for the DAL instance.
unsigned int getNumRxFlows() const
Get the number of receive (rx) flows.
InterfaceName getInterfaceName() const
Get the name of the local network interface on which DAL will run.
void setActivationDirectory(const std::string &path)
Set the activation directory path for the DAL instance.
void setManufacturerName(const std::string &manufacturerName)
Set the manufacturer friendly name for the DAL Instance.
SocketDescriptor getProtocolSocketDescriptor(Protocol protocol) const
Get the socket descriptor (port number or socket path) to be used by DAL for the given protocol.
void setEncoding(unsigned int encoding)
Set the encoding used by the DAL instance.
void setDefaultName(const std::string &name)
Set the default device name for the DAL instance.
void setNetworkLatency(unsigned int networkLatency)
Set the DAL device network latency.
unsigned int getSamplesPerPeriod() const
Get the number of samples between audio period events.
unsigned int getNetworkLatency() const
Get DAL device network latency.
uint16_t getAudioPortRange() const
Get the audio port range to be used by DAL instance.
void setLoggingPath(std::string loggingPath)
Set the logging path used by the child processes for storing log information.
Id64 getModelId() const
Get the model id for the DAL Instance.
void setModelName(const std::string &modelName)
Set the model name for the DAL Instance.
void setAudioPortRange(uint16_t range)
Set the audio port range to be used by DAL instance.
InterfaceIndex getInterfaceIndex() const
Get the index of the local network interface on which DAL will run.
void setSamplerate(Samplerate samplerate)
Set the samplerate for the DAL instance.
void setSamplesPerPeriod(unsigned int samplesPerPeriod)
Set the number of samples between audio period events.
std::string getModelName() const
Get the model name for the DAL Instance.
unsigned int getNumRxChannels() const
Get the number of receive channels for the DAL instance.
void setCloseWebSocketOnActivation(bool closeWebSocketOnActivation)
Set whether the activation websocket should be closed after device activation.
void setManufacturerVersion(const Version &manufacturerVersion)
Set the manufacturer product version for the DAL Instance.
bool getAllowAudioProcessingBeforeNetworkTimeSync() const
Get whether DAL can process audio before network time is synced.
TimeSource getTimeSource() const
Get the time source for the DAL instance.
std::string getConfigurationPath() const
Get the configuration path used by the child processes for storing configuration data.
std::string getActivationDirectory() const
Get the activation directory path for the DAL instance.
void setConfigurationPath(std::string configurationPath)
Set the configuration path used by the DAL instance (including its child processes) for storing confi...
bool getCloseWebSocketOnActivation() const
Get whether the activation websocket is closed after device activation.
void setAllowAudioProcessingBeforeNetworkTimeSync(bool enabled)
Set whether DAL can process audio before network time is synced.
void setPerChannelEncodingFile(const std::string &fileName)
Set per-channel encoding configuration in DAL.
void setLogLevel(LogLevel logLevel)
Set the log level for DAL instance.
Definition Common.hpp:72
A Version class used for tracking updates to your DAL Dante device.
Definition Types.hpp:53