AudioManager  7.6.6
Native Application Runtime Environment
CAmRoutingReceiver.h
Go to the documentation of this file.
1 
24 #ifndef ROUTINGRECEIVER_H_
25 #define ROUTINGRECEIVER_H_
26 
27 #include "IAmRouting.h"
28 
29 namespace am
30 {
31 
32 class CAmSocketHandler;
33 class CAmDbusWrapper;
34 class IAmDatabaseHandler;
35 class CAmRoutingSender;
36 class CAmControlSender;
37 
42 {
43 public:
44  CAmRoutingReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmControlSender *iControlSender, CAmSocketHandler *iSocketHandler);
45  CAmRoutingReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmControlSender *iControlSender, CAmSocketHandler *iSocketHandler, CAmDbusWrapper *iDBusWrapper);
47  void ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error);
48  void ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error);
49  void ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
50  void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error);
51  void ackSetSourceState(const am_Handle_s handle, const am_Error_e error);
52  void ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error);
53  void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error);
54  void ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error);
55  void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error);
56  void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error);
57  void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume);
58  void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume);
59  am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID);
60  am_Error_e registerDomain(const am_Domain_s& domainData, am_domainID_t& domainID);
62  am_Error_e registerGateway(const am_Gateway_s& gatewayData, am_gatewayID_t& gatewayID);
63  am_Error_e registerConverter(const am_Converter_s& converterData, am_converterID_t& converterID);
66  am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID);
67  am_Error_e registerSink(const am_Sink_s& sinkData, am_sinkID_t& sinkID);
69  am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID);
70  am_Error_e registerSource(const am_Source_s& sourceData, am_sourceID_t& sourceID);
72  am_Error_e registerCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID);
74  am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID);
75  am_Error_e peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID);
76  void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState);
77  void hookDomainRegistrationComplete(const am_domainID_t domainID);
78  void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s& availability);
79  void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s& availability);
80  void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState);
81  void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay);
82  void sendChangedData(const std::vector<am_EarlyData_s>& earlyData);
83  am_Error_e getDBusConnectionWrapper(CAmDbusWrapper*& dbusConnectionWrapper) const;
84  am_Error_e getSocketHandler(CAmSocketHandler*& socketHandler) const;
85  void getInterfaceVersion(std::string& version) const;
86  void confirmRoutingReady(const uint16_t handle, const am_Error_e error);
87  void confirmRoutingRundown(const uint16_t handle, const am_Error_e error);
88  am_Error_e updateGateway(const am_gatewayID_t gatewayID, const std::vector<am_CustomConnectionFormat_t>& listSourceFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkFormats, const std::vector<bool>& convertionMatrix) ;
89  am_Error_e updateConverter(const am_converterID_t converterID, const std::vector<am_CustomConnectionFormat_t>& listSourceFormats, const std::vector<am_CustomConnectionFormat_t>& listSinkFormats, const std::vector<bool>& convertionMatrix);
90  am_Error_e updateSink(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) ;
91  am_Error_e updateSource(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) ;
92  void ackSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listvolumes, const am_Error_e error) ;
93  void ackSinkNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) ;
94  void ackSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) ;
95  void hookSinkNotificationDataChange(const am_sinkID_t sinkID, const am_NotificationPayload_s& payload) ;
96  void hookSourceNotificationDataChange(const am_sourceID_t sourceID, const am_NotificationPayload_s& payload) ;
97  am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const;
98  am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const;
99  am_Error_e getDomainOfCrossfader(const am_crossfaderID_t crossfader, am_domainID_t& domainID) const;
100 
101  uint16_t getStartupHandle();
102  uint16_t getRundownHandle();
103 
104  void waitOnStartup(bool startup);
105  void waitOnRundown(bool rundown);
106 
107 private:
108 
109  void handleCallback(const am_Handle_s handle, const am_Error_e error);
110 
111  IAmDatabaseHandler *mpDatabaseHandler;
112  CAmRoutingSender *mpRoutingSender;
113  CAmControlSender *mpControlSender;
114  CAmSocketHandler *mpSocketHandler;
115  CAmDbusWrapper *mpDBusWrapper;
116 
117  std::vector<uint16_t> mListStartupHandles;
118  std::vector<uint16_t> mListRundownHandles;
119  uint16_t handleCount;
120  bool mWaitStartup;
121  bool mWaitRundown;
122 
123  am_Error_e mLastStartupError;
124  am_Error_e mLastRundownError;
125 
126 };
127 
128 }
129 
130 #endif /* ROUTINGRECEIVER_H_ */
Implements the RoutingSendInterface.
am_Error_e getDBusConnectionWrapper(CAmDbusWrapper *&dbusConnectionWrapper) const
this function is used to retrieve a pointer to the dBusConnectionWrapper
uint16_t am_connectionID_t
a connection ID
A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects...
Copyright (C) 2012 - 2014, BMW AG.
void hookSourceNotificationDataChange(const am_sourceID_t sourceID, const am_NotificationPayload_s &payload)
is called whenever a notified value needs to be send
uint16_t am_sinkClass_t
am_Error_e
the errors of the audiomanager.
am_InterruptState_e
void ackSetVolumes(const am_Handle_s handle, const std::vector< am_Volumes_s > &listvolumes, const am_Error_e error)
acknowledges a asyncSetSinkVolumes
void confirmRoutingReady(const uint16_t handle, const am_Error_e error)
confirms the setRoutingReady Command
void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay)
is called when the timinginformation (delay) changed for a connection.
This struct describes the attribiutes of a sink.
This struct holds the payload of a notification.
am_Error_e registerSource(const am_Source_s &sourceData, am_sourceID_t &sourceID)
registers a source.
void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error)
acknowledges asyncCrossFade
am_Error_e registerConverter(const am_Converter_s &converterData, am_converterID_t &converterID)
registers a converter.
This struct describes the attribiutes of a domain.
void waitOnRundown(bool rundown)
tells the RoutingReceiver to start waiting for all handles to be confirmed
uint16_t am_crossfaderID_t
a crossfader ID
The am::CAmSocketHandler implements a mainloop for the AudioManager.
am_Error_e updateSink(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)
updates data of an gateway.
am_Error_e updateConverter(const am_converterID_t converterID, const std::vector< am_CustomConnectionFormat_t > &listSourceFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkFormats, const std::vector< bool > &convertionMatrix)
updates data of an converter.
int16_t am_timeSync_t
offset time that is introduced in milli seconds.
void confirmRoutingRundown(const uint16_t handle, const am_Error_e error)
confirms the setRoutingRundown Command
am_Error_e deregisterGateway(const am_gatewayID_t gatewayID)
deregisters a gateway.
am_Error_e updateSource(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)
updates data of an source.
void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)
acknowledges a volume tick.
Implements the Receiving side of the RoutingPlugins.
am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t &domainID) const
E_OK in case of success.
am_Error_e peekSourceClassID(const std::string &name, am_sourceClass_t &sourceClassID)
this function peeks a sourceclassID.
am_Error_e peekSink(const std::string &name, am_sinkID_t &sinkID)
This function returns the ID to the given sinkName.
uint16_t am_converterID_t
a converter ID
void ackSetSourceState(const am_Handle_s handle, const am_Error_e error)
acknowlegde for asyncSetSourceState
am_Error_e registerGateway(const am_Gateway_s &gatewayData, am_gatewayID_t &gatewayID)
registers a gateway.
void getInterfaceVersion(std::string &version) const
This function returns the version of the interface.
am_Error_e peekSinkClassID(const std::string &name, am_sinkClass_t &sinkClassID)
this function peeks a sourceclassID.
void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState)
is called when a low level interrupt changes it status.
a handle is used for asynchronous operations and is uniquely assigned for each of this operations ...
void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
acknowledges asyncSetSinkSoundProperty
uint16_t am_sourceID_t
a source ID
void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s &availability)
is called when a source changes its availability
void ackSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error)
The acknowledge of the SourceNotificationConfiguration.
void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
acknowledges a asyncsetSourceVolume
am_Error_e deregisterConverter(const am_converterID_t converterID)
deregisters a converter.
uint16_t getStartupHandle()
returns a startup handle
sends data to the commandInterface, takes the file of the library that needs to be loaded ...
CAmRoutingReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmRoutingSender *iRoutingSender, CAmControlSender *iControlSender, CAmSocketHandler *iSocketHandler)
Routing Receive sendInterface description.
Definition: IAmRouting.h:56
This class handles and abstracts the database.
void ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)
acknowledges asyncSetSinkSoundProperties
void ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
acknowledges a asyncsetSinkVolume
This struct describes the attributes of a converter.
void hookDomainRegistrationComplete(const am_domainID_t domainID)
This hook is called when all elements from a domain are registered.
am_Error_e peekSource(const std::string &name, am_sourceID_t &sourceID)
This function returns the ID to the given sourceName.
am_Error_e registerDomain(const am_Domain_s &domainData, am_domainID_t &domainID)
registers a domain
am_Error_e deregisterSink(const am_sinkID_t sinkID)
deregisters a sink.
am_Error_e registerSink(const am_Sink_s &sinkData, am_sinkID_t &sinkID)
Registers a sink.
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 getSocketHandler(CAmSocketHandler *&socketHandler) const
This function returns the pointer to the socketHandler.
uint16_t getRundownHandle()
returns a rundown handle
am_Error_e deregisterSource(const am_sourceID_t sourceID)
deregisters a source
uint16_t am_sourceClass_t
void ackSinkNotificationConfiguration(const am_Handle_s handle, const am_Error_e error)
The acknowledge of the SinkNotificationConfiguration.
void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s &availability)
is called when a sink changes its availability
this describes the availability of a sink or a source together with the latest change ...
This struct describes the attributes of a gateway.
am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t &domainID) const
E_OK in case of success.
void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState)
is called when a domain changes its status.
am_Error_e updateGateway(const am_gatewayID_t gatewayID, const std::vector< am_CustomConnectionFormat_t > &listSourceFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkFormats, const std::vector< bool > &convertionMatrix)
updates data of an gateway.
am_Error_e registerCrossfader(const am_Crossfader_s &crossfaderData, am_crossfaderID_t &crossfaderID)
this function registers a crossfader.
am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID)
this function deregisters a crossfader.
This wraps dbus and provides everything needed to anyone who wants to use dbus (including plugins)...
void sendChangedData(const std::vector< am_EarlyData_s > &earlyData)
this function is used to send out all data that has been changed in an early state.
uint16_t am_domainID_t
a domain ID
void ackConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error)
acknowledges a asyncConnect
am_Error_e peekDomain(const std::string &name, am_domainID_t &domainID)
This function returns the ID to the given domainName.
void ackDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_Error_e error)
acknowledges a asyncDisconnect
void waitOnStartup(bool startup)
tells the RoutingReceiver to start waiting for all handles to be confirmed
uint16_t am_gatewayID_t
a gateway ID
This struct describes the attribiutes of a source.
am_Error_e getDomainOfCrossfader(const am_crossfaderID_t crossfader, am_domainID_t &domainID) const
E_OK in case of success.
uint16_t am_sinkID_t
a sink ID
void ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
acknowledges asyncSetSourceSoundProperties
am_Error_e deregisterDomain(const am_domainID_t domainID)
deregisters a domain.
void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
acknowledges a volume tick.
void hookSinkNotificationDataChange(const am_sinkID_t sinkID, const am_NotificationPayload_s &payload)
is called whenever a notified value needs to be send
void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
acknowledges asyncSetSourceSoundProperty