29 #include <sys/types.h>
36 #include "TAmPluginTemplate.h"
43 #define REQUIRED_INTERFACE_VERSION_MAJOR 1
44 #define REQUIRED_INTERFACE_VERSION_MINOR 0
50 mMapConnectionInterface(),
51 mMapCrossfaderInterface(),
52 mMapDomainInterface(),
54 mMapSourceInterface(),
56 mpDatabaseHandler(databaseHandler)
59 if (listOfPluginDirectories.empty())
61 logError(__func__,
"List of routingplugins is empty");
64 std::vector<std::string> sharedLibraryNameList;
65 std::vector<std::string>::const_iterator dirIter = listOfPluginDirectories.begin();
66 std::vector<std::string>::const_iterator dirIterEnd = listOfPluginDirectories.end();
69 for (; dirIter < dirIterEnd; ++dirIter)
71 const char* directoryName = dirIter->c_str();
72 logInfo(
"Searching for HookPlugins in", directoryName);
73 DIR *directory = opendir(directoryName);
77 logError(
"RoutingSender::RoutingSender Error opening directory: ", directoryName);
82 struct dirent *itemInDirectory = 0;
83 while ((itemInDirectory = readdir(directory)))
85 unsigned char entryType = itemInDirectory->d_type;
86 std::string entryName = itemInDirectory->d_name;
87 std::string fullName = *dirIter +
"/" + entryName;
89 bool regularFile = (entryType == DT_REG || entryType == DT_LNK);
90 bool sharedLibExtension = (
"so" == entryName.substr(entryName.find_last_of(
".") + 1));
93 if (entryType == DT_UNKNOWN) {
96 if (stat(fullName.c_str(), &buf)) {
97 logInfo(__PRETTY_FUNCTION__,
"Failed to stat file: ", entryName, errno);
101 regularFile = S_ISREG(buf.st_mode);
104 if (regularFile && sharedLibExtension)
106 logInfo(
"RoutingSender::RoutingSender adding file: ", entryName);
107 std::string name(directoryName);
108 sharedLibraryNameList.push_back(name +
"/" + entryName);
112 logInfo(
"RoutingSender::RoutingSender PluginSearch ignoring file :", entryName);
120 std::vector<std::string>::iterator iter = sharedLibraryNameList.begin();
121 std::vector<std::string>::iterator iterEnd = sharedLibraryNameList.end();
123 for (; iter != iterEnd; ++iter)
125 logInfo(
"RoutingSender::RoutingSender try loading: ", *iter);
128 void* tempLibHandle = NULL;
129 createFunc = getCreateFunction<IAmRoutingSend*()>(*iter, tempLibHandle);
133 logError(
"RoutingSender::RoutingSender Entry point of RoutingPlugin not found");
141 logError(
"RoutingSender::RoutingSender RoutingPlugin initialization failed. Entry Function not callable");
142 dlclose(tempLibHandle);
152 uint16_t minorVersion, majorVersion, cMinorVersion, cMajorVersion;
153 std::istringstream(version.substr(0, 1)) >> majorVersion;
154 std::istringstream(version.substr(2, 1)) >> minorVersion;
155 std::istringstream(cVersion.substr(0, 1)) >> cMajorVersion;
156 std::istringstream(cVersion.substr(2, 1)) >> cMinorVersion;
160 if (majorVersion < cMajorVersion || ((majorVersion == cMajorVersion) && (minorVersion > cMinorVersion)))
162 logError(
"Routing initialization failed. Version of Interface to old");
163 dlclose(tempLibHandle);
169 assert(!routerInterface.
busName.empty());
170 mListInterfaces.push_back(routerInterface);
171 mListLibraryHandles.push_back(tempLibHandle);
178 HandlesMap::iterator it = mlistActiveHandles.begin();
181 for (; it != mlistActiveHandles.end(); ++it)
183 logError(__func__,
"The action for the handle",it->first,
"is still open");
189 mpRoutingReceiver = iRoutingReceiver;
192 std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
193 std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
194 for (; iter < iterEnd; ++iter)
196 am_Error_e error = (*iter).routingInterface->startupInterface(iRoutingReceiver);
202 return (returnError);
207 auto iter (mlistActiveHandles.find(handle));
208 if (iter == mlistActiveHandles.end())
210 logError(__func__,
"Could not find handle",handle);
213 logInfo(__func__,
" handle", handle);
214 return (iter->second->returnInterface()->asyncAbort(handle));
219 auto iter (mMapSinkInterface.find(sinkID));
220 if (iter == mMapSinkInterface.end())
222 logError(__func__,
"Could not find sink",sinkID);
230 logInfo(__func__,
"Resending for handle",handle);
234 logError(__func__,
"Handle exists but wrong type",handle);
242 tempConnection.
sinkID = sinkID;
246 tempConnection.
delay=-1;
253 mMapConnectionInterface.insert(std::make_pair(connectionID, iter->second));
254 auto handleData = std::make_shared<handleConnect>(iter->second,connectionID,mpDatabaseHandler);
258 logInfo(__func__,
"connectionID=",connectionID,
"connectionFormat=", connectionFormat,
"sourceID=", sourceID,
"sinkID=", sinkID,
"handle=",handle);
259 am_Error_e syncError(iter->second->asyncConnect(handle, connectionID, sourceID, sinkID, connectionFormat));
263 logError(__func__,
"Error while calling connect connectionID:",connectionID,
"sourceID:",sourceID,
"sinkID:",sinkID,
"connectionFormat:",connectionFormat,
"handle",handle);
271 auto iter(mMapConnectionInterface.find(connectionID));
272 if (iter == mMapConnectionInterface.end())
274 logError(__func__,
"Could not find connection",connectionID);
282 logInfo(__func__,
"Resending for handle",handle);
286 logError(__func__,
"Handle exists but wrong type",handle);
292 auto handleData = std::make_shared<handleDisconnect>(iter->second,connectionID,mpDatabaseHandler,
this);
296 logInfo(__func__,
"connectionID=", connectionID,
"handle=",handle);
297 am_Error_e syncError(iter->second->asyncDisconnect(handle, connectionID));
301 logError(__func__,
"Error while calling disconnect connectionID:",connectionID,
"handle",handle);
308 auto iter (mMapSinkInterface.find(sinkID));
309 if (iter == mMapSinkInterface.end())
311 logError(__func__,
"Could not find sink",sinkID);
319 logInfo(__func__,
"Resending for handle",handle);
323 logError(__func__,
"Handle exists but wrong type",handle);
329 auto handleData = std::make_shared<handleSinkVolume>(iter->second,sinkID,mpDatabaseHandler,volume);
333 logInfo(__func__,
"sinkID=", sinkID,
"volume=", volume,
"ramp=", ramp,
"time=", time,
"handle=",handle);
334 am_Error_e syncError(iter->second->asyncSetSinkVolume(handle, sinkID, volume, ramp, time));
338 logError(__func__,
"Error while calling asyncSetSinkVolume sinkID:",sinkID,
"handle:",handle,
"volume:",volume,
"ramp:",ramp,
"time:",time);
345 auto iter (mMapSourceInterface.find(sourceID));
346 if (iter == mMapSourceInterface.end())
348 logError(__func__,
"Could not find sourceID",sourceID);
356 logInfo(__func__,
"Resending for handle",handle);
360 logError(__func__,
"Handle exists but wrong type",handle);
366 auto handleData = std::make_shared<handleSourceVolume>(iter->second,sourceID,mpDatabaseHandler,volume);
370 logInfo(__func__,
"sourceID=", sourceID,
"volume=", volume,
"ramp=", ramp,
"time=", time,
"handle=",handle);
371 am_Error_e syncError(iter->second->asyncSetSourceVolume(handle, sourceID, volume, ramp, time));
375 logError(__func__,
"Error while calling asyncSetSourceVolume sourceID:",sourceID,
"handle:",handle,
"volume:",volume,
"ramp:",ramp,
"time:",time);
382 auto iter (mMapSourceInterface.find(sourceID));
383 if (iter == mMapSourceInterface.end())
385 logError(__func__,
"Could not find sourceID",sourceID);
393 logInfo(__func__,
"Resending for handle",handle);
397 logError(__func__,
"Handle exists but wrong type",handle);
403 auto handleData = std::make_shared<handleSourceState>(iter->second,sourceID,state,mpDatabaseHandler);
406 logInfo(__func__,
"sourceID=", sourceID,
"state=", state,
"handle=",handle);
407 am_Error_e syncError(iter->second->asyncSetSourceState(handle, sourceID, state));
411 logError(__func__,
"Error while calling asyncSetSourceState sourceID:",sourceID,
"handle:",handle,
"state:",state);
418 auto iter (mMapSinkInterface.find(sinkID));
419 if (iter == mMapSinkInterface.end())
421 logError(__func__,
"Could not find sink",sinkID);
429 logInfo(__func__,
"Resending for handle",handle);
433 logError(__func__,
"Handle exists but wrong type",handle);
439 auto handleData = std::make_shared<handleSinkSoundProperty>(iter->second,sinkID,soundProperty,mpDatabaseHandler);
443 logInfo(__func__,
"sinkID=", sinkID,
"soundProperty.Type=", soundProperty.
type,
"soundProperty.value=", soundProperty.
value,
"handle=",handle);
444 am_Error_e syncError(iter->second->asyncSetSinkSoundProperty(handle, sinkID, soundProperty));
448 logError(__func__,
"Error while calling asyncSetSinkSoundProperty sinkID:",sinkID,
"handle:",handle,
"soundProperty:",soundProperty.
type,soundProperty.
value);
455 auto iter (mMapSourceInterface.find(sourceID));
456 if (iter == mMapSourceInterface.end())
458 logError(__func__,
"Could not find sourceID",sourceID);
466 logInfo(__func__,
"Resending for handle",handle);
470 logError(__func__,
"Handle exists but wrong type",handle);
476 auto handleData = std::make_shared<handleSourceSoundProperty>(iter->second,sourceID,soundProperty,mpDatabaseHandler);
479 logInfo(__func__,
"sourceID=", sourceID,
"soundProperty.Type=", soundProperty.
type,
"soundProperty.value=", soundProperty.
value,
"handle=",handle);
480 am_Error_e syncError(iter->second->asyncSetSourceSoundProperty(handle, sourceID, soundProperty));
484 logError(__func__,
"Error while calling asyncSetSourceSoundProperty sourceID:",sourceID,
"handle:",handle,
"soundProperty:",soundProperty.
type,soundProperty.
value);
491 auto iter (mMapSourceInterface.find(sourceID));
492 if (iter == mMapSourceInterface.end())
494 logError(__func__,
"Could not find sourceID",sourceID);
502 logInfo(__func__,
"Resending for handle",handle);
506 logError(__func__,
"Handle exists but wrong type",handle);
512 auto handleData = std::make_shared<handleSourceSoundProperties>(iter->second,sourceID,listSoundProperties,mpDatabaseHandler);
516 logInfo(__func__,
"sourceID=", sourceID);
517 am_Error_e syncError(iter->second->asyncSetSourceSoundProperties(handle, sourceID, listSoundProperties));
521 logError(__func__,
"Error while calling asyncSetSourceSoundProperties sourceID:",sourceID,
"handle:",handle);
528 auto iter (mMapSinkInterface.find(sinkID));
529 if (iter == mMapSinkInterface.end())
531 logError(__func__,
"Could not find sink",sinkID);
539 logInfo(__func__,
"Resending for handle",handle);
543 logError(__func__,
"Handle exists but wrong type",handle);
549 auto handleData = std::make_shared<handleSinkSoundProperties>(iter->second,sinkID,listSoundProperties,mpDatabaseHandler);
553 logInfo(__func__,
"sinkID=", sinkID,
"handle=",handle);
554 am_Error_e syncError(iter->second->asyncSetSinkSoundProperties(handle, sinkID, listSoundProperties));
558 logError(__func__,
"Error while calling asyncSetSinkSoundProperties sinkID:",sinkID,
"handle:",handle);
565 auto iter (mMapCrossfaderInterface.find(crossfaderID));
566 if (iter == mMapCrossfaderInterface.end())
568 logError(__func__,
"Could not find crossfaderID",crossfaderID);
576 logInfo(__func__,
"Resending for handle",handle);
580 logError(__func__,
"Handle exists but wrong type",handle);
586 auto handleData = std::make_shared<handleCrossFader>(iter->second,crossfaderID,hotSink,mpDatabaseHandler);
590 logInfo(__func__,
"hotSource=", hotSink,
"crossfaderID=", crossfaderID,
"rampType=", rampType,
"rampTime=", time,
"handle=",handle);
591 am_Error_e syncError(iter->second->asyncCrossFade(handle, crossfaderID, hotSink, rampType, time));
601 logInfo(__func__,
"domainID=", domainID,
"domainState=", domainState);
602 DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
603 iter = mMapDomainInterface.find(domainID);
604 if (iter != mMapDomainInterface.end())
605 return (iter->second->setDomainState(domainID, domainState));
616 std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
617 std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
618 for (; iter < iterEnd; ++iter)
620 if ((*iter).busName.compare(domainData.
busname) == 0)
622 mMapDomainInterface.insert(std::make_pair(domainData.
domainID, (*iter).routingInterface));
626 logError(__PRETTY_FUNCTION__,
" Could not find busname for bus",domainData.
busname);
637 DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
638 iter = mMapDomainInterface.find(sourceData.
domainID);
639 if (iter != mMapDomainInterface.end())
641 mMapSourceInterface.insert(std::make_pair(sourceData.
sourceID, iter->second));
644 logError(__PRETTY_FUNCTION__,
" Could not find domainInterface for domainID",sourceData.
domainID);
655 DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
656 iter = mMapDomainInterface.find(sinkData.
domainID);
657 if (iter != mMapDomainInterface.end())
659 mMapSinkInterface.insert(std::make_pair(sinkData.
sinkID, iter->second));
662 logError(__PRETTY_FUNCTION__,
"Could not find domainInterface for domainID",sinkData.
domainID);
673 DomainInterfaceMap::iterator iter = mMapSourceInterface.begin();
674 iter = mMapSourceInterface.find(crossfaderData.
sourceID);
675 if (iter != mMapSourceInterface.end())
677 mMapSourceInterface.insert(std::make_pair(crossfaderData.
crossfaderID, iter->second));
680 logError(__PRETTY_FUNCTION__,
" Could not find sourceInterface for source",crossfaderData.
sourceID);
690 DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
691 iter = mMapDomainInterface.find(domainID);
692 if (iter != mMapDomainInterface.end())
694 mMapDomainInterface.erase(iter);
707 SourceInterfaceMap::iterator iter = mMapSourceInterface.begin();
708 iter = mMapSourceInterface.find(sourceID);
709 if (iter != mMapSourceInterface.end())
711 mMapSourceInterface.erase(iter);
724 SinkInterfaceMap::iterator iter = mMapSinkInterface.begin();
725 iter = mMapSinkInterface.find(sinkID);
726 if (iter != mMapSinkInterface.end())
728 mMapSinkInterface.erase(iter);
741 CrossfaderInterfaceMap::iterator iter = mMapCrossfaderInterface.begin();
742 iter = mMapCrossfaderInterface.find(crossfaderID);
743 if (iter != mMapCrossfaderInterface.end())
745 mMapCrossfaderInterface.erase(iter);
759 if (mlistActiveHandles.erase(handle))
770 HandlesMap::const_iterator it = mlistActiveHandles.begin();
771 for (; it != mlistActiveHandles.end(); ++it)
773 listHandles.push_back(it->first);
784 am_Handle_s CAmRoutingSender::createHandle(std::shared_ptr<handleDataBase> handleData,
const am_Handle_e type)
787 if (++mHandleCount>=1024)
789 handle.
handle = mHandleCount;
791 mlistActiveHandles.insert(std::make_pair(handle, handleData));
792 if ((mlistActiveHandles.size()%100) == 0)
794 logInfo(
"CAmRoutingSender::createHandle warning: too many open handles, number of handles: ", mlistActiveHandles.size());
805 std::vector<uint16_t> listStartupHandles;
806 for (
size_t i = 0; i < mListInterfaces.size(); i++)
814 std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
815 std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
816 std::vector<uint16_t>::const_iterator handleIter(listStartupHandles.begin());
817 for (; iter < iterEnd; ++iter)
819 (*iter).routingInterface->setRoutingReady(*(handleIter++));
827 std::vector<uint16_t> listStartupHandles;
828 for (
size_t i = 0; i < mListInterfaces.size(); i++)
836 std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin();
837 std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end();
838 std::vector<uint16_t>::const_iterator handleIter(listStartupHandles.begin());
839 for (; iter < iterEnd; ++iter)
841 (*iter).routingInterface->setRoutingRundown(*(handleIter++));
848 if (listVolumes.empty())
852 if (listVolumes[0].volumeType==
VT_SINK)
855 SinkInterfaceMap::iterator iter = mMapSinkInterface.begin();
856 iter = mMapSinkInterface.find(sinkID);
857 if(iter!=mMapSinkInterface.end())
858 pRoutingInterface=iter->second;
863 else if (listVolumes[0].volumeType==
VT_SOURCE)
866 SourceInterfaceMap::iterator iter = mMapSourceInterface.begin();
867 iter = mMapSourceInterface.find(sourceID);
868 if (iter!=mMapSourceInterface.end())
869 pRoutingInterface=iter->second;
876 auto handleData = std::make_shared<handleSetVolumes>(pRoutingInterface,listVolumes,mpDatabaseHandler);
879 logInfo(__func__,
"handle=", handle);
880 am_Error_e syncError(pRoutingInterface->asyncSetVolumes(handle, listVolumes));
891 auto iter (mMapSinkInterface.find(sinkID));
892 if (iter == mMapSinkInterface.end())
894 logError(__func__,
"Could not find sink",sinkID);
902 logInfo(__func__,
"Resending for handle",handle);
906 logError(__func__,
"Handle exists but wrong type",handle);
912 auto handleData = std::make_shared<handleSetSinkNotificationConfiguration>(iter->second,sinkID,notificationConfiguration,mpDatabaseHandler);
916 logInfo(__func__,
"sinkID=",sinkID,
"notificationConfiguration.type=",notificationConfiguration.
type,
"notificationConfiguration.status",notificationConfiguration.
status,
"notificationConfiguration.parameter",notificationConfiguration.
parameter);
917 am_Error_e syncError(iter->second->asyncSetSinkNotificationConfiguration(handle, sinkID, notificationConfiguration));
921 logError(__func__,
"Error while calling asyncSetSinkNotificationConfiguration sinkID:",sinkID,
"handle:",handle);
928 auto iter (mMapSourceInterface.find(sourceID));
929 if (iter == mMapSourceInterface.end())
931 logError(__func__,
"Could not find sourceID",sourceID);
939 logInfo(__func__,
"Resending for handle",handle);
943 logError(__func__,
"Handle exists but wrong type",handle);
949 auto handleData = std::make_shared<handleSetSourceNotificationConfiguration>(iter->second,sourceID,notificationConfiguration,mpDatabaseHandler);
953 logInfo(__func__,
"sourceID=",sourceID,
"notificationConfiguration.type=",notificationConfiguration.
type,
"notificationConfiguration.status",notificationConfiguration.
status,
"notificationConfiguration.parameter",notificationConfiguration.
parameter);
954 am_Error_e syncError(iter->second->asyncSetSourceNotificationConfiguration(handle, sourceID, notificationConfiguration));
958 logError(__func__,
"Error while calling asyncSetSourceNotificationConfiguration sourceID:",sourceID,
"handle:",handle);
963 void CAmRoutingSender::unloadLibraries(
void)
965 std::vector<void*>::iterator iterator = mListLibraryHandles.begin();
966 for (; iterator < mListLibraryHandles.end(); ++iterator)
970 mListLibraryHandles.clear();
975 std::vector<InterfaceNamePairs>::const_iterator it = mListInterfaces.begin();
976 for (; it != mListInterfaces.end(); ++it)
978 interfaces.push_back(it->busName);
989 DomainInterfaceMap::iterator iter = mMapDomainInterface.begin();
990 iter = mMapDomainInterface.find(domainID);
991 if (iter != mMapDomainInterface.end())
992 return (iter->second->resyncConnectionState(domainID, listOfExistingConnections));
998 auto it(mlistActiveHandles.find(handle));
999 if (it!=mlistActiveHandles.end())
1001 am_Error_e error(it->second->writeDataToDatabase());
1002 mlistActiveHandles.erase(handle);
1005 logError(__func__,
"could not find handle data for handle",handle);
1011 auto it(mlistActiveHandles.find(handle));
1012 if (it!=mlistActiveHandles.end())
1017 logError(__func__,
"volume returned for handle does not match: ",volume,
"expected:",basePtr->
returnVolume());
1021 logError(__func__,
"could not find handle data for handle",handle);
1026 auto iter(mlistActiveHandles.find(handle));
1027 if (iter!=mlistActiveHandles.end())
1041 std::vector<am_SoundProperty_s>::const_iterator it = mlistSoundProperties.begin();
1042 for (; it != mlistSoundProperties.end(); ++it)
1056 std::vector<am_SoundProperty_s>::const_iterator it = mlistSoundProperties.begin();
1057 for (; it != mlistSoundProperties.end(); ++it)
1086 mConnectionPending =
false;
1097 std::vector<am_Volumes_s>::const_iterator iterator (mlistVolumes.begin());
1099 for (;iterator!=mlistVolumes.end();++iterator)
1101 if (iterator->volumeType==
VT_SINK)
1103 return (mpDatabaseHandler->
changeSinkVolume(iterator->volumeID.sink,iterator->volume));
1105 else if (iterator->volumeType==
VT_SOURCE)
1107 return (mpDatabaseHandler->
changeSourceVolume(iterator->volumeID.source,iterator->volume));
1125 ConnectionInterfaceMap::iterator iter = mMapConnectionInterface.begin();
1126 iter = mMapConnectionInterface.find(connectionID);
1127 if (iter != mMapConnectionInterface.end())
1129 mMapConnectionInterface.erase(iter);
1137 if (mConnectionPending)
am_Error_e writeDataToDatabase()
function to write the handle data to the database
std::string busname
the busname.
This error is returned in case a connect is issued with a connectionFormat that cannot be selected fo...
am_Error_e asyncAbort(const am_Handle_s &handle)
uint16_t am_connectionID_t
a connection ID
am_timeSync_t delay
the delay of the conneciton
the desired object is non existent
virtual am_Error_e changeCrossFaderHotSink(const am_crossfaderID_t crossfaderID, const am_HotSink_e hotsink)=0
am_CustomNotificationType_t type
The notification type of the notification.
am_Error_e
the errors of the audiomanager.
This struct holds information about the configuration for notifications.
am_Error_e writeDataToDatabase()
function to write the handle data to the database
void logInfo(T value, TArgs...args)
logs given values with infolevel with the default context
am_Error_e getListHandles(std::vector< am_Handle_s > &listHandles) const
This struct describes the attribiutes of a sink.
am_Error_e writeDataToDatabase()
function to write the handle data to the database
This class implements everything from Audiomanager -> RoutingAdapter There are two rules that have to...
virtual am_Error_e changeSourceState(const am_sourceID_t sourceID, const am_SourceState_e sourceState)=0
void getInterfaceVersion(std::string &version) const
am_Error_e asyncCrossFade(am_Handle_s &handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_CustomRampType_t rampType, const am_time_t time)
am_sinkID_t sinkID
This is the ID of the sink, it is unique in the system.
void checkVolume(const am_Handle_s handle, const am_volume_t volume)
This struct describes the attribiutes of a domain.
void waitOnRundown(bool rundown)
tells the RoutingReceiver to start waiting for all handles to be confirmed
am_Error_e addSinkLookup(const am_Sink_s &sinkData)
am_Error_e writeDataToDatabase()
function to write the handle data to the database
virtual void getInterfaceVersion(std::string &version) const =0
This function returns the version of the interface.
uint16_t am_crossfaderID_t
a crossfader ID
uint16_t am_CustomConnectionFormat_t
This type classifies the format in which data is exchanged within a connection.
SPDX license identifier: MPL-2.0.
IAmDatabaseHandler * mpDatabaseHandler
am_Error_e writeDataToDatabase()
function to write the handle data to the database
am_crossfaderID_t crossfaderID
This is the ID of the crossfader, it is unique in the system.
am_Error_e asyncSetSinkSoundProperty(am_Handle_s &handle, const am_sinkID_t sinkID, const am_SoundProperty_s &soundProperty)
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
am_Error_e addCrossfaderLookup(const am_Crossfader_s &crossfaderData)
am_Error_e asyncDisconnect(am_Handle_s &handle, const am_connectionID_t connectionID)
am_Error_e addDomainLookup(const am_Domain_s &domainData)
SPDX license identifier: MPL-2.0.
Implements the Receiving side of the RoutingPlugins.
the following type is a sink
std::string busName
the busname
am_CustomConnectionFormat_t connectionFormat
the used connectionformat
am_Error_e writeDataToDatabase()
function to write the handle data to the database
virtual am_Error_e changeConnectionFinal(const am_connectionID_t connectionID)=0
am_sourceID_t sourceID
The sourceID of the crossfader source.
am_Error_e removeCrossfaderLookup(const am_crossfaderID_t crossfaderID)
am_Error_e asyncSetSourceVolume(am_Handle_s &handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time)
am_Error_e asyncSetSourceSoundProperty(am_Handle_s &handle, const am_sourceID_t sourceID, const am_SoundProperty_s &soundProperty)
SPDX license identifier: MPL-2.0.
am_domainID_t domainID
The domainID is the domain the source belongs to.
the following type is a source
am_Error_e addSourceLookup(const am_Source_s &sourceData)
am_Error_e resyncConnectionState(const am_domainID_t domainID, std::vector< am_Connection_s > &listOfExistingConnections)
am_Error_e asyncSetSourceSoundProperties(am_Handle_s &handle, const std::vector< am_SoundProperty_s > &listSoundProperties, const am_sourceID_t sourceID)
a handle is used for asynchronous operations and is uniquely assigned for each of this operations ...
am_Error_e writeDataToDatabase()
function to write the handle data to the database
am_Error_e writeDataToDatabase()
function to write the handle data to the database
IAmRoutingSend * routingInterface
pointer to the routingInterface
am_Error_e writeDataToDatabase()
function to write the handle data to the database
uint16_t am_sourceID_t
a source ID
am_Error_e asyncSetSinkSoundProperties(am_Handle_s &handle, const std::vector< am_SoundProperty_s > &listSoundProperties, const am_sinkID_t sinkID)
struct describing the sound property
am_Error_e asyncSetSourceState(am_Handle_s &handle, const am_sourceID_t sourceID, const am_SourceState_e state)
am_sourceID_t sourceID
the source the audio flows from
virtual am_Error_e removeConnection(const am_connectionID_t connectionID)=0
uint16_t getStartupHandle()
returns a startup handle
am_NotificationStatus_e status
The Notification status.
virtual am_Error_e returnBusName(std::string &BusName) const =0
this method is used to retrieve the busname during startup of the plugin.
This class handles and abstracts the database.
SPDX license identifier: MPL-2.0.
am_Error_e writeDataToDatabase()
function to write the handle data to the database
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.
am_Error_e asyncSetSinkVolume(am_Handle_s &handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time)
am_sourceID_t sourceID
This is the ID of the source, it is unique in the system.
am_CustomSoundPropertyType_t type
the type of the property - a project specific enum
bool handleExists(const am_Handle_s handle)
returns true if the handle exists
am_Handle_e handleType
the handletype
am_Error_e getListPlugins(std::vector< std::string > &interfaces) const
uint16_t getRundownHandle()
returns a rundown handle
am_Error_e writeToDatabaseAndRemove(const am_Handle_s handle)
write data to Database and remove handle
the desired action is not possible
virtual am_Error_e changeSinkSoundPropertyDB(const am_SoundProperty_s &soundProperty, const am_sinkID_t sinkID)=0
am_connectionID_t connectionID
the assigned ID
am_domainID_t domainID
the domain ID
virtual am_Error_e changeSinkNotificationConfigurationDB(const am_sinkID_t sinkID, const am_NotificationConfiguration_s notificationConfiguration)=0
am_Error_e startupInterfaces(CAmRoutingReceiver *iRoutingReceiver)
uint16_t handle
the handle as value
void logError(T value, TArgs...args)
logs given values with errorlevel with the default context
am_Error_e removeHandle(const am_Handle_s &handle)
removes a handle from the list
uint16_t am_time_t
time in ms!
am_Handle_e
This enumeration is used to define the type of the action that is correlated to a handle...
am_Error_e writeDataToDatabase()
function to write the handle data to the database
am_Error_e removeSinkLookup(const am_sinkID_t sinkID)
uint16_t am_domainID_t
a domain ID
no error - positive reply
virtual am_Error_e changeSourceVolume(const am_sourceID_t sourceID, const am_volume_t volume)=0
int16_t value
the actual value of the property
am_Error_e writeDataToDatabase()
function to write the handle data to the database
am_Error_e removeSourceLookup(const am_sourceID_t sourceID)
CAmRoutingSender(const std::vector< std::string > &listOfPluginDirectories, IAmDatabaseHandler *databaseHandler)
am_Error_e asyncSetVolumes(am_Handle_s &handle, const std::vector< am_Volumes_s > &listVolumes)
void waitOnStartup(bool startup)
tells the RoutingReceiver to start waiting for all handles to be confirmed
This struct describes the attribiutes of a source.
virtual am_Error_e changeSourceNotificationConfigurationDB(const am_sourceID_t sourceID, const am_NotificationConfiguration_s notificationConfiguration)=0
uint16_t am_CustomRampType_t
The given ramp types here are just examples.
virtual am_Error_e enterConnectionDB(const am_Connection_s &connection, am_connectionID_t &connectionID)=0
am_Error_e writeDataToDatabase()
function to write the handle data to the database
uint16_t am_sinkID_t
a sink ID
am_Error_e asyncSetSinkNotificationConfiguration(am_Handle_s &handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s ¬ificationConfiguration)
int16_t parameter
This gives additional information to the notification status.
am_domainID_t domainID
The domainID is the domain the sink belongs to.
am_SourceState_e
The source state reflects the state of the source.
am_Error_e removeConnectionLookup(const am_connectionID_t connectionID)
virtual am_Error_e changeSourceSoundPropertyDB(const am_SoundProperty_s &soundProperty, const am_sourceID_t sourceID)=0
am_Error_e asyncConnect(am_Handle_s &handle, am_connectionID_t &connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomConnectionFormat_t connectionFormat)
am_Error_e asyncSetSourceNotificationConfiguration(am_Handle_s &handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s ¬ificationConfiguration)
am_sinkID_t sinkID
the sink the audio flows to
< is used to pair interfaces with busnames
am_Error_e removeDomainLookup(const am_domainID_t domainID)
am_volume_t returnVolume()
virtual am_Error_e changeSinkVolume(const am_sinkID_t sinkID, const am_volume_t volume)=0