24 #ifndef ROUTINGSENDER_H_ 25 #define ROUTINGSENDER_H_ 31 #ifdef UNIT_TEST //this is needed to test RoutingSender 32 #include "../test/IAmRoutingBackdoor.h" 40 class CAmRoutingReceiver;
122 ,mSoundProperty(soundProperty) {}
136 ,mlistSoundProperties(listSoundProperties) {}
141 std::vector<am_SoundProperty_s> mlistSoundProperties;
150 ,mSoundProperty(soundProperty) {}
164 ,mlistSoundProperties(listSoundProperties) {}
169 std::vector<am_SoundProperty_s> mlistSoundProperties;
178 ,mSourceState(state) {}
191 ,mSourceID(sourceID) {}
215 ,mCrossfaderID(crossfaderID)
216 ,mHotSink(hotSink) {}
229 ,mConnectionID(connectionID)
230 ,mConnectionPending(true) {}
235 bool mConnectionPending;
243 ,mConnectionID(connectionID)
244 ,mRoutingSender(routingSender){}
257 ,mlistVolumes(listVolumes) {}
261 std::vector<am_Volumes_s> mlistVolumes;
270 ,mNotificationConfiguration(notificationConfiguration){}
284 ,mNotificationConfiguration(notificationConfiguration) {}
296 #ifdef UNIT_TEST //this is needed to test RoutingSender 297 friend class IAmRoutingBackdoor;
309 void loadPlugins(
const std::vector<std::string>& listOfPluginDirectories);
311 void unloadLibraries(
void);
313 typedef std::map<am_domainID_t, IAmRoutingSend*> DomainInterfaceMap;
314 typedef std::map<am_sinkID_t, IAmRoutingSend*> SinkInterfaceMap;
315 typedef std::map<am_sourceID_t, IAmRoutingSend*> SourceInterfaceMap;
316 typedef std::map<am_crossfaderID_t, IAmRoutingSend*> CrossfaderInterfaceMap;
317 typedef std::map<am_connectionID_t, IAmRoutingSend*> ConnectionInterfaceMap;
318 typedef std::map<am_Handle_s, std::shared_ptr<handleDataBase>, comparator> HandlesMap;
320 int16_t mHandleCount;
321 HandlesMap mlistActiveHandles;
322 std::vector<void*> mListLibraryHandles;
323 std::vector<InterfaceNamePairs> mListInterfaces;
324 CrossfaderInterfaceMap mMapCrossfaderInterface;
325 ConnectionInterfaceMap mMapConnectionInterface;
326 DomainInterfaceMap mMapDomainInterface;
327 SinkInterfaceMap mMapSinkInterface;
328 SourceInterfaceMap mMapSourceInterface;
Implements the RoutingSendInterface.
am_Error_e asyncAbort(const am_Handle_s &handle)
uint16_t am_connectionID_t
a connection ID
A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects...
handleCrossFader(IAmRoutingSend *interface, const am_crossfaderID_t crossfaderID, const am_HotSink_e &hotSink, IAmDatabaseHandler *databaseHandler)
Copyright (C) 2012 - 2014, BMW AG.
handleSourceVolume(IAmRoutingSend *interface, const am_sourceID_t sourceID, IAmDatabaseHandler *databaseHandler, const am_volume_t &volume)
am_Error_e
the errors of the audiomanager.
handleSourceSoundProperty(IAmRoutingSend *interface, const am_sourceID_t sourceID, const am_SoundProperty_s &soundProperty, IAmDatabaseHandler *databaseHandler)
This struct holds information about the configuration for notifications.
am_Error_e getListHandles(std::vector< am_Handle_s > &listHandles) const
This struct describes the attribiutes of a sink.
This class implements everything from Audiomanager -> RoutingAdapter There are two rules that have to...
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)
handleSinkSoundProperty(IAmRoutingSend *interface, const am_sinkID_t sinkID, const am_SoundProperty_s &soundProperty, IAmDatabaseHandler *databaseHandler)
void checkVolume(const am_Handle_s handle, const am_volume_t volume)
This struct describes the attribiutes of a domain.
handleSetSinkNotificationConfiguration(IAmRoutingSend *interface, const am_sinkID_t sinkID, const am_NotificationConfiguration_s notificationConfiguration, IAmDatabaseHandler *databaseHandler)
am_Error_e addSinkLookup(const am_Sink_s &sinkData)
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.
IAmDatabaseHandler * mpDatabaseHandler
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)
~handleSourceSoundProperties()
Implements the Receiving side of the RoutingPlugins.
handleSourceSoundProperties(IAmRoutingSend *interface, const am_sourceID_t sourceID, const std::vector< am_SoundProperty_s > &listSoundProperties, IAmDatabaseHandler *databaseHandler)
std::string busName
the busname
virtual ~handleDataBase()
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)
SPDX license identifier: MPL-2.0.
am_Error_e asyncSetSourceSoundProperty(am_Handle_s &handle, const am_sourceID_t sourceID, const am_SoundProperty_s &soundProperty)
handleSinkSoundProperties(IAmRoutingSend *interface, const am_sinkID_t sinkID, const std::vector< am_SoundProperty_s > &listSoundProperties, IAmDatabaseHandler *databaseHandler)
~handleSetSourceNotificationConfiguration()
am_Error_e addSourceLookup(const am_Source_s &sourceData)
~handleSinkSoundProperties()
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 ...
IAmRoutingSend * routingInterface
pointer to the routingInterface
uint16_t am_sourceID_t
a source ID
handleVolumeBase(IAmRoutingSend *interface, IAmDatabaseHandler *databaseHandler, am_volume_t volume)
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)
~handleSinkSoundProperty()
handleSetSourceNotificationConfiguration(IAmRoutingSend *interface, const am_sourceID_t sourceID, const am_NotificationConfiguration_s notificationConfiguration, IAmDatabaseHandler *databaseHandler)
This class handles and abstracts the database.
IAmRoutingSend * returnInterface()
handleDataBase(IAmRoutingSend *interface, IAmDatabaseHandler *databaseHandler)
~handleSetSinkNotificationConfiguration()
handleDisconnect(IAmRoutingSend *interface, const am_connectionID_t connectionID, IAmDatabaseHandler *databaseHandler, CAmRoutingSender *routingSender)
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)
handleSetVolumes(IAmRoutingSend *interface, const std::vector< am_Volumes_s > listVolumes, IAmDatabaseHandler *databaseHandler)
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
am_Error_e writeToDatabaseAndRemove(const am_Handle_s handle)
write data to Database and remove handle
am_Error_e startupInterfaces(CAmRoutingReceiver *iRoutingReceiver)
uint16_t handle
the handle as value
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 removeSinkLookup(const am_sinkID_t sinkID)
virtual ~handleVolumeBase()
uint16_t am_domainID_t
a domain ID
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)
~handleSourceSoundProperty()
This struct describes the attribiutes of a source.
uint16_t am_CustomRampType_t
The given ramp types here are just examples.
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)
handleSinkVolume(IAmRoutingSend *interface, const am_sinkID_t sinkID, IAmDatabaseHandler *databaseHandler, const am_volume_t &volume)
am_SourceState_e
The source state reflects the state of the source.
am_Error_e removeConnectionLookup(const am_connectionID_t connectionID)
handleSourceState(IAmRoutingSend *interface, const am_sourceID_t sourceID, const am_SourceState_e &state, IAmDatabaseHandler *databaseHandler)
handleConnect(IAmRoutingSend *interface, const am_connectionID_t connectionID, IAmDatabaseHandler *databaseHandler)
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)
< is used to pair interfaces with busnames
am_Error_e removeDomainLookup(const am_domainID_t domainID)
am_volume_t returnVolume()