AudioManager  7.6.6
Native Application Runtime Environment
CAmControlSender.cpp
Go to the documentation of this file.
1 
24 #include "CAmControlSender.h"
25 #include <cassert>
26 #include <fstream>
27 #include <iostream>
28 #include <sstream>
29 #include <stdexcept>
30 #include <sys/stat.h>
31 #include <sys/types.h>
32 #include <dirent.h>
33 #include "TAmPluginTemplate.h"
34 #include "CAmDltWrapper.h"
35 
36 namespace am
37 {
38 
39 #define REQUIRED_INTERFACE_VERSION_MAJOR 1
40 #define REQUIRED_INTERFACE_VERSION_MINOR 0
41 
42 CAmControlSender* CAmControlSender::mInstance=NULL;
43 
44 CAmControlSender::CAmControlSender(std::string controlPluginFile,CAmSocketHandler* sockethandler) :
45  receiverCallbackT(this, &CAmControlSender::receiverCallback),//
46  checkerCallbackT(this, &CAmControlSender::checkerCallback),//
47  dispatcherCallbackT(this, &CAmControlSender::dispatcherCallback), //
48  mPipe(), //
49  mlibHandle(NULL), //
50  mController(NULL), //
51  mSignal(0)
52 {
53  assert(sockethandler);
54 
55  //Check if a folder is given, then select the first plugin
56  struct stat buf;
57  const char* conFile(controlPluginFile.c_str());
58  stat(conFile, &buf);
59  if (S_ISDIR(buf.st_mode))
60  {
61  std::string directoryName(controlPluginFile);
62  logInfo("Searching for ControlPlugin in", directoryName);
63  DIR *directory = opendir(directoryName.c_str());
64 
65  if (!directory)
66  {
67  logError("Error opening directory ", directoryName);
68  throw std::runtime_error("Controller directory could not be openend");
69  }
70 
71  // iterate content of directory
72  struct dirent *itemInDirectory = 0;
73  while ((itemInDirectory = readdir(directory)))
74  {
75  unsigned char entryType = itemInDirectory->d_type;
76  std::string entryName = itemInDirectory->d_name;
77  std::string fullName = directoryName + "/" + entryName;
78 
79  bool regularFile = (entryType == DT_REG || entryType == DT_LNK);
80  bool sharedLibExtension = ("so" == entryName.substr(entryName.find_last_of(".") + 1));
81 
82  // Handle cases where readdir() could not determine the file type
83  if (entryType == DT_UNKNOWN) {
84  struct stat buf;
85 
86  if (stat(fullName.c_str(), &buf)) {
87  logInfo(__PRETTY_FUNCTION__,"Failed to stat file: ", entryName, errno);
88  continue;
89  }
90 
91  regularFile = S_ISREG(buf.st_mode);
92  }
93 
94  if (regularFile && sharedLibExtension)
95  {
96  controlPluginFile=directoryName + "/" + entryName;
97  logInfo("Found ControlPlugin:", controlPluginFile);
98  break;
99  }
100  }
101  closedir(directory);
102 
103  }
104 
105  std::ifstream isfile(controlPluginFile.c_str());
106  if (!isfile)
107  {
108  logError("ControlSender::ControlSender: Controller plugin not found:", controlPluginFile);
109  throw std::runtime_error("Could not find controller plugin!");
110  }
111  else if (!controlPluginFile.empty())
112  {
113  mInstance=this;
114  IAmControlSend* (*createFunc)();
115  createFunc = getCreateFunction<IAmControlSend*()>(controlPluginFile, mlibHandle);
116  assert(createFunc!=NULL);
117  mController = createFunc();
118  mControlPluginFile = controlPluginFile;
119  //check libversion
120  std::string version, cVersion(ControlVersion);
121  mController->getInterfaceVersion(version);
122  uint16_t minorVersion, majorVersion, cMinorVersion, cMajorVersion;
123  std::istringstream(version.substr(0, 1)) >> majorVersion;
124  std::istringstream(version.substr(2, 1)) >> minorVersion;
125  std::istringstream(cVersion.substr(0, 1)) >> cMajorVersion;
126  std::istringstream(cVersion.substr(2, 1)) >> cMinorVersion;
127 
128 
129 
130  if (majorVersion < cMajorVersion || ((majorVersion == cMajorVersion) && (minorVersion < cMinorVersion)))
131  {
132  logError("ControlSender::ControlSender: Interface Version of Controller too old, required version:",ControlVersion," Controller Version:",version,"exiting now");
133  throw std::runtime_error("Interface Version of Controller too old");
134  }
135  }
136  else
137  {
138  logError("ControlSender::ControlSender: No controller loaded !");
139  }
140 
141  //here we need a pipe to be able to call the rundown function out of the mainloop
142  if (pipe(mPipe) == -1)
143  {
144  logError("CAmControlSender could not create pipe!");
145  }
146 
147  //add the pipe to the poll - nothing needs to be proccessed here we just need the pipe to trigger the ppoll
148  short event = 0;
149  sh_pollHandle_t handle;
150  event |= POLLIN;
151  sockethandler->addFDPoll(mPipe[0], event, NULL, &receiverCallbackT, &checkerCallbackT, &dispatcherCallbackT, NULL, handle);
152 }
153 
155 {
156  close(mPipe[0]);
157  close(mPipe[1]);
158 
159  if (mlibHandle)
160  {
161  void (*destroyFunc)(IAmControlSend*);
162  destroyFunc = getDestroyFunction<void(IAmControlSend*)>(mControlPluginFile, mlibHandle);
163  if (destroyFunc)
164  {
165  destroyFunc(mController);
166  }
167  else
168  {
169  logError("CAmControlSender Dtor: destroyFunc is invalid or not found");
170  }
171  dlclose(mlibHandle);
172  }
173 }
174 
176 {
177  assert(mController);
178  return (mController->hookUserConnectionRequest(sourceID, sinkID, mainConnectionID));
179 }
180 
182 {
183  assert(mController);
184  return (mController->hookUserDisconnectionRequest(connectionID));
185 }
186 
188 {
189  assert(mController);
190  return (mController->hookUserSetMainSinkSoundProperty(sinkID, soundProperty));
191 }
192 
194 {
195  assert(mController);
196  return (mController->hookUserSetMainSourceSoundProperty(sourceID, soundProperty));
197 }
198 
200 {
201  assert(mController);
202  return (mController->hookUserSetSystemProperty(property));
203 }
204 
206 {
207  assert(mController);
208  return (mController->hookUserVolumeChange(sinkID, newVolume));
209 }
210 
211 am_Error_e CAmControlSender::hookUserVolumeStep(const am_sinkID_t sinkID, const int16_t increment)
212 {
213  assert(mController);
214  return (mController->hookUserVolumeStep(sinkID, increment));
215 }
216 
218 {
219  assert(mController);
220  return (mController->hookUserSetSinkMuteState(sinkID, muteState));
221 }
222 
224 {
225  assert(mController);
226  return (mController->hookSystemRegisterDomain(domainData, domainID));
227 }
228 
230 {
231  assert(mController);
232  return (mController->hookSystemDeregisterDomain(domainID));
233 }
234 
236 {
237  assert(mController);
238  return (mController->hookSystemDomainRegistrationComplete(domainID));
239 }
240 
242 {
243  assert(mController);
244  return (mController->hookSystemRegisterSink(sinkData, sinkID));
245 }
246 
248 {
249  assert(mController);
250  return (mController->hookSystemDeregisterSink(sinkID));
251 }
252 
254 {
255  assert(mController);
256  return (mController->hookSystemRegisterSource(sourceData, sourceID));
257 }
258 
260 {
261  assert(mController);
262  return (mController->hookSystemDeregisterSource(sourceID));
263 }
264 
266 {
267  assert(mController);
268  return (mController->hookSystemRegisterGateway(gatewayData, gatewayID));
269 }
270 
272 {
273  assert(mController);
274  return (mController->hookSystemRegisterConverter(converterData, converterID));
275 }
276 
278 {
279  assert(mController);
280  return (mController->hookSystemDeregisterGateway(gatewayID));
281 }
282 
284 {
285  assert(mController);
286  return (mController->hookSystemDeregisterConverter(converterID));
287 }
288 
290 {
291  assert(mController);
292  return (mController->hookSystemRegisterCrossfader(crossfaderData, crossfaderID));
293 }
294 
296 {
297  assert(mController);
298  return (mController->hookSystemDeregisterCrossfader(crossfaderID));
299 }
300 
302 {
303  assert(mController);
304  mController->hookSystemSinkVolumeTick(handle, sinkID, volume);
305 }
306 
308 {
309  assert(mController);
310  mController->hookSystemSourceVolumeTick(handle, sourceID, volume);
311 }
312 
314 {
315  assert(mController);
316  mController->hookSystemInterruptStateChange(sourceID, interruptState);
317 }
318 
320 {
321  assert(mController);
322  mController->hookSystemSinkAvailablityStateChange(sinkID, availability);
323 }
324 
326 {
327  assert(mController);
328  mController->hookSystemSourceAvailablityStateChange(sourceID, availability);
329 }
330 
332 {
333  assert(mController);
334  mController->hookSystemDomainStateChange(domainID, state);
335 }
336 
337 void CAmControlSender::hookSystemReceiveEarlyData(const std::vector<am_EarlyData_s> & data)
338 {
339  assert(mController);
340  mController->hookSystemReceiveEarlyData(data);
341 }
342 
344 {
345  assert(mController);
346  mController->hookSystemSpeedChange(speed);
347 }
348 
350 {
351  assert(mController);
352  mController->hookSystemTimingInformationChanged(mainConnectionID, time);
353 }
354 
355 void CAmControlSender::cbAckConnect(const am_Handle_s handle, const am_Error_e errorID)
356 {
357  assert(mController);
358  mController->cbAckConnect(handle, errorID);
359 }
360 
362 {
363  assert(mController);
364  mController->cbAckDisconnect(handle, errorID);
365 }
366 
367 void CAmControlSender::cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)
368 {
369  assert(mController);
370  mController->cbAckCrossFade(handle, hostsink, error);
371 }
372 
374 {
375  assert(mController);
376  mController->cbAckSetSinkVolumeChange(handle, volume, error);
377 }
378 
380 {
381  assert(mController);
382  mController->cbAckSetSourceVolumeChange(handle, volume, error);
383 }
384 
386 {
387  assert(mController);
388  mController->cbAckSetSourceState(handle, error);
389 }
390 
392 {
393  assert(mController);
394  mController->cbAckSetSourceSoundProperty(handle, error);
395 }
396 
398 {
399  if (!mController)
400  {
401  logError("ControlSender::startupController: no Controller to startup!");
402  throw std::runtime_error("ControlSender::startupController: no Controller to startup! Exiting now ...");
403  return (E_NON_EXISTENT);
404  }
405  return (mController->startupController(controlreceiveinterface));
406 }
407 
409 {
410  assert(mController);
411  mController->cbAckSetSinkSoundProperty(handle, error);
412 }
413 
415 {
416  assert(mController);
417  mController->cbAckSetSinkSoundProperties(handle, error);
418 }
419 
421 {
422  assert(mController);
423  mController->cbAckSetSourceSoundProperties(handle, error);
424 }
425 
427 {
428  assert(mController);
429  mController->setControllerReady();
430 }
431 
432 void CAmControlSender::setControllerRundown(const int16_t signal)
433 {
434  assert(mController);
435  logInfo("CAmControlSender::setControllerRundown received, signal=",signal);
436  mController->setControllerRundown(signal);
437 }
438 
439 am_Error_e am::CAmControlSender::getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector<am_CustomConnectionFormat_t> listPossibleConnectionFormats, std::vector<am_CustomConnectionFormat_t> & listPrioConnectionFormats)
440 {
441  assert(mController);
442  return (mController->getConnectionFormatChoice(sourceID, sinkID, listRoute, listPossibleConnectionFormats, listPrioConnectionFormats));
443 }
444 
445 void CAmControlSender::getInterfaceVersion(std::string & version) const
446 {
447  version = ControlVersion;
448 }
449 
451 {
452  assert(mController);
453  mController->confirmCommandReady(error);
454 }
455 
457 {
458  assert(mController);
459  mController->confirmRoutingReady(error);
460 }
461 
463 {
464  assert(mController);
465  mController->confirmCommandRundown(error);
466 }
467 
469 {
470  assert(mController);
471  mController->confirmRoutingRundown(error);
472 }
473 
474 am_Error_e CAmControlSender::hookSystemUpdateSink(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
475 {
476  assert(mController);
477  return (mController->hookSystemUpdateSink(sinkID,sinkClassID,listSoundProperties,listConnectionFormats,listMainSoundProperties));
478 }
479 
480 am_Error_e CAmControlSender::hookSystemUpdateSource(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_SoundProperty_s>& listSoundProperties, const std::vector<am_CustomConnectionFormat_t>& listConnectionFormats, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties)
481 {
482  assert(mController);
483  return (mController->hookSystemUpdateSource(sourceID,sourceClassID,listSoundProperties,listConnectionFormats,listMainSoundProperties));
484 }
485 
486 am_Error_e CAmControlSender::hookSystemUpdateGateway(const am_gatewayID_t gatewayID, const std::vector<am_CustomConnectionFormat_t>& listSourceConnectionFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkConnectionFromats, const std::vector<bool>& convertionMatrix)
487 {
488  assert(mController);
489  return (mController->hookSystemUpdateGateway(gatewayID,listSourceConnectionFormats,listSinkConnectionFromats,convertionMatrix));
490 }
491 
492 am_Error_e CAmControlSender::hookSystemUpdateConverter(const am_converterID_t converterID, const std::vector<am_CustomConnectionFormat_t>& listSourceConnectionFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkConnectionFromats, const std::vector<bool>& convertionMatrix)
493 {
494  assert(mController);
495  return (mController->hookSystemUpdateConverter(converterID,listSourceConnectionFormats,listSinkConnectionFromats,convertionMatrix));
496 }
497 
498 void CAmControlSender::cbAckSetVolume(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes, const am_Error_e error)
499 {
500  assert(mController);
501  mController->cbAckSetVolumes(handle,listVolumes,error);
502 }
503 
505 {
506  assert(mController);
507  mController->cbAckSetSinkNotificationConfiguration(handle,error);
508 }
509 
511 {
512  assert(mController);
513  mController->cbAckSetSourceNotificationConfiguration(handle,error);
514 }
515 
517 {
518  assert(mController);
519  mController->hookSinkNotificationDataChanged(sinkID,payload);
520 }
521 
523 {
524  assert(mController);
525  mController->hookSourceNotificationDataChanged(sourceID,payload);
526 }
527 
529 {
530  assert(mController);
531  return (mController->hookUserSetMainSinkNotificationConfiguration(sinkID,notificationConfiguration));
532 }
533 
535 {
536  assert(mController);
537  return (mController->hookUserSetMainSourceNotificationConfiguration(sourceID,notificationConfiguration));
538 }
539 
540 void CAmControlSender::receiverCallback(const pollfd pollfd, const sh_pollHandle_t handle, void* userData)
541 {
542  (void) handle;
543  (void) userData;
544  //get the signal number from the socket
545  ssize_t result = read(pollfd.fd, &mSignal, sizeof(mSignal));
546 }
547 
548 bool CAmControlSender::checkerCallback(const sh_pollHandle_t handle, void* userData)
549 {
550  (void) handle;
551  (void) userData;
552  return (true);
553 }
554 
556 {
557  assert(mController);
558  mController->hookSystemSingleTimingInformationChanged(connectionID,time);
559 }
560 
568  mPipe(), //
569  mlibHandle(NULL), //
570  mController(NULL), //
571  mSignal(0)
572 {
573  logInfo("CAmControlSender was loaded in test mode!");
574 }
575 
576 bool CAmControlSender::dispatcherCallback(const sh_pollHandle_t handle, void* userData)
577 {
578  (void)handle;
579  (void)userData;
580  setControllerRundown(mSignal);
581  return (false);
582 }
583 
584 }
585 
586 
SPDX license identifier: MPL-2.0.
uint16_t am_connectionID_t
a connection ID
bool checkerCallback(const sh_pollHandle_t handle, void *userData)
bool dispatcherCallback(const sh_pollHandle_t handle, void *userData)
am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume)
void getInterfaceVersion(std::string &version) const
void hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s &availability)
am_Error_e hookSystemUpdateGateway(const am_gatewayID_t gatewayID, const std::vector< am_CustomConnectionFormat_t > &listSourceConnectionFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkConnectionFromats, const std::vector< bool > &convertionMatrix)
A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects...
virtual am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume)=0
sets a user volume
the desired object is non existent
void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)
uint16_t am_sinkClass_t
am_Error_e
the errors of the audiomanager.
am_InterruptState_e
am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s &soundProperty)
This struct holds information about the configuration for notifications.
am_Error_e hookSystemRegisterSink(const am_Sink_s &sinkData, am_sinkID_t &sinkID)
am_Error_e hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID)
void logInfo(T value, TArgs...args)
logs given values with infolevel with the default context
virtual void hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state)=0
id called when domainstate was changed
am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID)
void hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)
void hookSystemDomainRegistrationComplete(const am_domainID_t domainID)
This struct describes the attribiutes of a sink.
This struct holds the payload of a notification.
virtual am_Error_e hookSystemDeregisterCrossfader(const am_crossfaderID_t crossfaderID)=0
is called when a routing adaptor deregisters a crossfader
void cbAckSetSinkNotificationConfiguration(const am_Handle_s handle, const am_Error_e error)
void confirmRoutingReady(const am_Error_e error)
virtual void setControllerReady()=0
this message is used tell the controller that it should get ready.
virtual am_Error_e hookSystemUpdateSource(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector< am_SoundProperty_s > &listSoundProperties, const std::vector< am_CustomConnectionFormat_t > &listConnectionFormats, const std::vector< am_MainSoundProperty_s > &listMainSoundProperties)=0
update from the source Data
void hookSinkNotificationDataChanged(const am_sinkID_t sinkID, const am_NotificationPayload_s &payload)
virtual am_Error_e getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector< am_CustomConnectionFormat_t > listPossibleConnectionFormats, std::vector< am_CustomConnectionFormat_t > &listPrioConnectionFormats)=0
This function is used by the routing algorithm to retrieve a priorized list of connectionFormats from...
am_Error_e hookSystemDeregisterSink(const am_sinkID_t sinkID)
This struct describes the attribiutes of a domain.
virtual void cbAckConnect(const am_Handle_s handle, const am_Error_e errorID)=0
ack for connect
am_Error_e startupController(IAmControlReceive *controlreceiveinterface)
virtual void cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)=0
ack for sink volume changes
am_Error_e hookSystemUpdateSink(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector< am_SoundProperty_s > &listSoundProperties, const std::vector< am_CustomConnectionFormat_t > &listConnectionFormats, const std::vector< am_MainSoundProperty_s > &listMainSoundProperties)
#define ControlVersion
Definition: IAmControl.h:35
uint16_t am_crossfaderID_t
a crossfader ID
The am::CAmSocketHandler implements a mainloop for the AudioManager.
virtual void hookSinkNotificationDataChanged(const am_sinkID_t sinkID, const am_NotificationPayload_s &payload)=0
new sinkNotification data is there!
am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s &property)
void confirmCommandReady(const am_Error_e error)
virtual void hookSystemSpeedChange(const am_speed_t speed)=0
this hook provides information about speed changes.
TAmShPollCheck< CAmControlSender > checkerCallbackT
void hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s &availability)
int16_t am_timeSync_t
offset time that is introduced in milli seconds.
void hookSourceNotificationDataChanged(const am_sourceID_t sourceID, const am_NotificationPayload_s &payload)
virtual void hookSourceNotificationDataChanged(const am_sourceID_t sourceID, const am_NotificationPayload_s &payload)=0
new sourceNotification data is there!
am_Error_e hookSystemRegisterSource(const am_Source_s &sourceData, am_sourceID_t &sourceID)
uint16_t sh_pollHandle_t
this is a handle for a filedescriptor to be used with the SocketHandler
void receiverCallback(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
SPDX license identifier: MPL-2.0.
void hookSystemDomainStateChange(const am_domainID_t domainID, const am_DomainState_e state)
am_Error_e hookSystemRegisterConverter(const am_Converter_s &converterData, am_converterID_t &converterID)
virtual am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment)=0
sets a user volume as increment
am_Error_e getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector< am_CustomConnectionFormat_t > listPossibleConnectionFormats, std::vector< am_CustomConnectionFormat_t > &listPrioConnectionFormats)
virtual am_Error_e hookSystemRegisterConverter(const am_Converter_s &converterData, am_converterID_t &converterID)=0
is called when a routing adaptor registers a converter
void setControllerRundown(const int16_t signal)
virtual am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s &property)=0
sets a user SystemProperty
void cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)
void cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
virtual void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)=0
ack for setting of sinksoundproperties
virtual void cbAckSetSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error)=0
The acknowledge of the source notification configuration.
virtual am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s &soundProperty)=0
sets a user MainSinkSoundProperty
void cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID)
void cbAckSetSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error)
virtual am_Error_e hookUserSetMainSourceNotificationConfiguration(const am_sourceID_t sourceID, const am_NotificationConfiguration_s &notificationConfiguration)=0
sets a user MainSourceNotificationConfiguration
am_Error_e hookSystemUpdateConverter(const am_converterID_t converterID, const std::vector< am_CustomConnectionFormat_t > &listSourceConnectionFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkConnectionFromats, const std::vector< bool > &convertionMatrix)
CAmControlSender()
for testing only contructor - do not use !
struct describing system properties
void hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
uint16_t am_converterID_t
a converter ID
virtual void cbAckSetSinkNotificationConfiguration(const am_Handle_s handle, const am_Error_e error)=0
The acknowledge of the sink notification configuration.
virtual void confirmRoutingReady(const am_Error_e error)=0
confirms the setRoutingReady call
virtual am_Error_e hookSystemRegisterSource(const am_Source_s &sourceData, am_sourceID_t &sourceID)=0
is called when a routing adaptor registers a source
struct describung mainsound property
am_Error_e hookUserSetMainSourceNotificationConfiguration(const am_sourceID_t sourceID, const am_NotificationConfiguration_s &notificationConfiguration)
TAmShPollFired< CAmControlSender > receiverCallbackT
virtual void hookSystemInterruptStateChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)=0
is called when an low level interrupt changed its state
virtual void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error)=0
ack for setting of source states
virtual am_Error_e hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)=0
sets the mute state of a sink
am_Error_e hookUserSetMainSinkNotificationConfiguration(const am_sinkID_t sinkID, const am_NotificationConfiguration_s &notificationConfiguration)
void cbAckConnect(const am_Handle_s handle, const am_Error_e errorID)
void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
virtual am_Error_e hookSystemDeregisterSink(const am_sinkID_t sinkID)=0
is called when a routing adaptor deregisters a sink
virtual void cbAckSetVolumes(const am_Handle_s handle, const std::vector< am_Volumes_s > &listVolumes, const am_Error_e error)=0
ack for mulitple volume changes
a handle is used for asynchronous operations and is uniquely assigned for each of this operations ...
virtual void confirmCommandRundown(const am_Error_e error)=0
confirms the setCommandRundown call
void hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)
am_Error_e hookSystemRegisterCrossfader(const am_Crossfader_s &crossfaderData, am_crossfaderID_t &crossfaderID)
virtual void hookSystemReceiveEarlyData(const std::vector< am_EarlyData_s > &data)=0
when early data was received
uint16_t am_sourceID_t
a source ID
am_Error_e hookSystemRegisterGateway(const am_Gateway_s &gatewayData, am_gatewayID_t &gatewayID)
virtual void hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)=0
volumeticks.
virtual void hookSystemTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)=0
this hook is fired whenever the timing information of a mainconnection has changed.
virtual am_Error_e hookSystemDeregisterGateway(const am_gatewayID_t gatewayID)=0
is called when a routing adaptor deregisters a gateway
void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error)
am_Error_e hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
sends data to the commandInterface, takes the file of the library that needs to be loaded ...
am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t &mainConnectionID)
virtual void setControllerRundown(const int16_t signal)=0
This message tells the controller that he should prepare everything for the power to be switched off...
virtual void hookSystemDomainRegistrationComplete(const am_domainID_t domainID)=0
is called when a domain registered all the elements
void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
virtual void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)=0
ack for setting of sourcesoundproperties
am_Error_e hookSystemDeregisterDomain(const am_domainID_t domainID)
This struct describes the attributes of a converter.
virtual am_Error_e hookSystemUpdateGateway(const am_gatewayID_t gatewayID, const std::vector< am_CustomConnectionFormat_t > &listSourceConnectionFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkConnectionFormats, const std::vector< bool > &convertionMatrix)=0
updates the Gateway Data
This interface is presented by the AudioManager controller.
Definition: IAmControl.h:675
a list of routing elements that lead from source to sink
virtual void cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID)=0
ack for disconnect
am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s &soundProperty)
am_HotSink_e
describes the active sink of a crossfader.
int16_t am_volume_t
The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE).
This struct describes the attribiutes of a crossfader.
virtual void confirmCommandReady(const am_Error_e error)=0
confirms the setCommandReady call
am_Error_e hookSystemUpdateSource(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector< am_SoundProperty_s > &listSoundProperties, const std::vector< am_CustomConnectionFormat_t > &listConnectionFormats, const std::vector< am_MainSoundProperty_s > &listMainSoundProperties)
void hookSystemSpeedChange(const am_speed_t speed)
virtual am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID)=0
is called when a disconnection request comes in via the command interface
virtual void hookSystemSinkAvailablityStateChange(const am_sinkID_t sinkID, const am_Availability_s &availability)=0
id called when a sink changed its availability
void confirmCommandRundown(const am_Error_e error)
virtual am_Error_e hookSystemUpdateConverter(const am_converterID_t converterID, const std::vector< am_CustomConnectionFormat_t > &listSourceConnectionFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkConnectionFormats, const std::vector< bool > &convertionMatrix)=0
updates the Converter Data
am_Error_e addFDPoll(const int fd, const short event, std::function< void(const sh_pollHandle_t handle, void *userData)> prepare, std::function< void(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)> fired, std::function< bool(const sh_pollHandle_t handle, void *userData)> check, std::function< bool(const sh_pollHandle_t handle, void *userData)> dispatch, void *userData, sh_pollHandle_t &handle)
Adds a filedescriptor to the polling loop.
uint16_t am_sourceClass_t
virtual void confirmRoutingRundown(const am_Error_e error)=0
confirms the setRoutingRundown command
void cbAckSetVolume(const am_Handle_s handle, const std::vector< am_Volumes_s > &listVolumes, const am_Error_e error)
virtual void cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error)=0
ack for crossfading
void hookSystemSingleTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t time)
this describes the availability of a sink or a source together with the latest change ...
This struct describes the attributes of a gateway.
This interface gives access to all important functions of the audiomanager that are used by the Audio...
Definition: IAmControl.h:56
virtual am_Error_e hookSystemDeregisterDomain(const am_domainID_t domainID)=0
is called when a routing adaptor wants to derigister a domain
void logError(T value, TArgs...args)
logs given values with errorlevel with the default context
virtual am_Error_e hookSystemDeregisterConverter(const am_converterID_t converterID)=0
is called when a routing adaptor deregisters a converter
virtual am_Error_e hookSystemUpdateSink(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector< am_SoundProperty_s > &listSoundProperties, const std::vector< am_CustomConnectionFormat_t > &listConnectionFormats, const std::vector< am_MainSoundProperty_s > &listMainSoundProperties)=0
update form the SinkData
virtual am_Error_e hookSystemRegisterCrossfader(const am_Crossfader_s &crossfaderData, am_crossfaderID_t &crossfaderID)=0
is called when a routing adaptor registers a crossfader
virtual am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t &mainConnectionID)=0
is called when a connection request comes in via the command interface
virtual void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error)=0
ack for source volume changes
am_Error_e hookSystemDeregisterConverter(const am_converterID_t converterID)
virtual am_Error_e startupController(IAmControlReceive *controlreceiveinterface)=0
Starts up the controller.
TAmShPollDispatch< CAmControlSender > dispatcherCallbackT
virtual void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)=0
ack for setting of sinksoundproperties
am_Error_e hookSystemDeregisterGateway(const am_gatewayID_t gatewayID)
uint16_t am_speed_t
speed
uint16_t am_domainID_t
a domain ID
void hookSystemSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)
int16_t am_mainVolume_t
This is the volume presented on the command interface.
void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
am_Error_e hookSystemDeregisterSource(const am_sourceID_t sourceID)
SPDX license identifier: MPL-2.0.
virtual am_Error_e hookUserSetMainSinkNotificationConfiguration(const am_sinkID_t sinkID, const am_NotificationConfiguration_s &notificationConfiguration)=0
sets a user MainSinkNotificationConfiguration
virtual void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)=0
ack for setting of sourcesoundproperties
void confirmRoutingRundown(const am_Error_e error)
virtual am_Error_e hookSystemDeregisterSource(const am_sourceID_t sourceID)=0
is called when a routing adaptor deregisters a source
uint16_t am_gatewayID_t
a gateway ID
This struct describes the attribiutes of a source.
virtual void hookSystemSourceAvailablityStateChange(const am_sourceID_t sourceID, const am_Availability_s &availability)=0
id called when a source changed its availability
uint16_t am_sinkID_t
a sink ID
uint16_t am_mainConnectionID_t
a mainConnection ID
void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error)
virtual am_Error_e hookSystemRegisterDomain(const am_Domain_s &domainData, am_domainID_t &domainID)=0
is called when a routing adaptor registers its domain
virtual void hookSystemSingleTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t time)=0
This hook is fired whenever the timing information of a connection has changed.
am_Error_e hookSystemRegisterDomain(const am_Domain_s &domainData, am_domainID_t &domainID)
virtual am_Error_e hookSystemRegisterSink(const am_Sink_s &sinkData, am_sinkID_t &sinkID)=0
is called when a routing adaptor registers a sink
virtual void hookSystemSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)=0
volumeticks.
am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment)
virtual am_Error_e hookSystemRegisterGateway(const am_Gateway_s &gatewayData, am_gatewayID_t &gatewayID)=0
is called when a routing adaptor registers a gateway
void hookSystemReceiveEarlyData(const std::vector< am_EarlyData_s > &data)
virtual void getInterfaceVersion(std::string &version) const =0
This function returns the version of the interface returns E_OK, E_UNKOWN if version is unknown...
virtual am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s &soundProperty)=0
sets a user MainSourceSoundProperty