24 #ifndef ROUTINGSENDER_H_
25 #define ROUTINGSENDER_H_
31 #ifdef UNIT_TEST //this is needed to test RoutingSender
32 #include "../test/IAmRoutingBackdoor.h"
38 class CAmRoutingReceiver;
39 class IAmDatabaseHandler;
121 ,mSoundProperty(soundProperty) {}
135 ,mlistSoundProperties(listSoundProperties) {}
140 std::vector<am_SoundProperty_s> mlistSoundProperties;
149 ,mSoundProperty(soundProperty) {}
163 ,mlistSoundProperties(listSoundProperties) {}
168 std::vector<am_SoundProperty_s> mlistSoundProperties;
177 ,mSourceState(state) {}
190 ,mSourceID(sourceID) {}
214 ,mCrossfaderID(crossfaderID)
215 ,mHotSink(hotSink) {}
228 ,mConnectionID(connectionID)
229 ,mConnectionPending(true) {}
234 bool mConnectionPending;
242 ,mConnectionID(connectionID)
243 ,mRoutingSender(routingSender){}
256 ,mlistVolumes(listVolumes) {}
260 std::vector<am_Volumes_s> mlistVolumes;
269 ,mNotificationConfiguration(notificationConfiguration){}
283 ,mNotificationConfiguration(notificationConfiguration) {}
295 #ifdef UNIT_TEST //this is needed to test RoutingSender
296 friend class IAmRoutingBackdoor;
308 am_Handle_s createHandle(std::shared_ptr<handleDataBase> handleData,
const am_Handle_e type);
309 void unloadLibraries(
void);
311 typedef std::map<am_domainID_t, IAmRoutingSend*> DomainInterfaceMap;
312 typedef std::map<am_sinkID_t, IAmRoutingSend*> SinkInterfaceMap;
313 typedef std::map<am_sourceID_t, IAmRoutingSend*> SourceInterfaceMap;
314 typedef std::map<am_crossfaderID_t, IAmRoutingSend*> CrossfaderInterfaceMap;
315 typedef std::map<am_connectionID_t, IAmRoutingSend*> ConnectionInterfaceMap;
316 typedef std::map<am_Handle_s, std::shared_ptr<handleDataBase>, comparator> HandlesMap;
318 int16_t mHandleCount;
319 HandlesMap mlistActiveHandles;
320 std::vector<void*> mListLibraryHandles;
321 std::vector<InterfaceNamePairs> mListInterfaces;
322 CrossfaderInterfaceMap mMapCrossfaderInterface;
323 ConnectionInterfaceMap mMapConnectionInterface;
324 DomainInterfaceMap mMapDomainInterface;
325 SinkInterfaceMap mMapSinkInterface;
326 SourceInterfaceMap mMapSourceInterface;
327 CAmRoutingReceiver *mpRoutingReceiver;
328 IAmDatabaseHandler* mpDatabaseHandler;
am_Error_e writeDataToDatabase()
function to write the handle data to the database
Implements the RoutingSendInterface.
am_Error_e asyncAbort(const am_Handle_s &handle)
uint16_t am_connectionID_t
a connection ID
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 writeDataToDatabase()
function to write the handle data to the database
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...
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)
virtual am_Error_e writeDataToDatabase()=0
function to write the handle data to the database
am_Error_e addSinkLookup(const am_Sink_s &sinkData)
am_Error_e writeDataToDatabase()
function to write the handle data to the database
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 writeDataToDatabase()
function to write the handle data to the database
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 writeDataToDatabase()
function to write the handle data to the database
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)
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 ...
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
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)
am_Error_e writeDataToDatabase()
function to write the handle data to the database
~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 writeDataToDatabase()
function to write the handle data to the database
am_Error_e removeSinkLookup(const am_sinkID_t sinkID)
virtual ~handleVolumeBase()
uint16_t am_domainID_t
a domain ID
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)
~handleSourceSoundProperty()
This struct describes the attribiutes of a source.
uint16_t am_CustomRampType_t
The given ramp types here are just examples.
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)
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()