AudioManager  7.6.6
Native Application Runtime Environment
CAmCommandReceiver.h
Go to the documentation of this file.
1 
24 #ifndef COMMANDRECEIVER_H_
25 #define COMMANDRECEIVER_H_
26 
27 #include "IAmCommand.h"
28 
29 namespace am
30 {
31 
32 class IAmDatabaseHandler;
33 class CAmControlSender;
34 class CAmDbusWrapper;
35 class CAmSocketHandler;
36 
41 {
42 public:
43  CAmCommandReceiver(IAmDatabaseHandler* iDatabaseHandler, CAmControlSender* iControlSender, CAmSocketHandler* iSocketHandler);
44  CAmCommandReceiver(IAmDatabaseHandler* iDatabaseHandler, CAmControlSender* iControlSender, CAmSocketHandler* iSocketHandler, CAmDbusWrapper* iDBusWrapper);
46  am_Error_e connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID);
47  am_Error_e disconnect(const am_mainConnectionID_t mainConnectionID);
48  am_Error_e setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume);
49  am_Error_e volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep);
50  am_Error_e setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState);
51  am_Error_e setMainSinkSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID);
52  am_Error_e setMainSourceSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID);
54  am_Error_e getVolume(const am_sinkID_t sinkID, am_mainVolume_t& mainVolume) const;
55  am_Error_e getListMainConnections(std::vector<am_MainConnectionType_s>& listConnections) const;
56  am_Error_e getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const;
57  am_Error_e getListMainSources(std::vector<am_SourceType_s>& listMainSources) const;
58  am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties) const;
59  am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties) const;
60  am_Error_e getListSourceClasses(std::vector<am_SourceClass_s>& listSourceClasses) const;
61  am_Error_e getListSinkClasses(std::vector<am_SinkClass_s>& listSinkClasses) const;
62  am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const;
63  am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const;
64  am_Error_e getDBusConnectionWrapper(CAmDbusWrapper*& dbusConnectionWrapper) const;
65  am_Error_e getSocketHandler(CAmSocketHandler*& socketHandler) const;
66  void confirmCommandReady(const uint16_t handle, const am_Error_e error);
67  void confirmCommandRundown(const uint16_t handle, const am_Error_e error);
68  void getInterfaceVersion(std::string& version) const;
69  am_Error_e getListMainSinkNotificationConfigurations(const am_sinkID_t sinkID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations) const ;
70  am_Error_e getListMainSourceNotificationConfigurations(const am_sourceID_t sourceID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations) const ;
71  am_Error_e setMainSinkNotificationConfiguration(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration) ;
72  am_Error_e setMainSourceNotificationConfiguration(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration) ;
73 
74  uint16_t getStartupHandle();
75  uint16_t getRundownHandle();
76 
77  void waitOnStartup(bool startup);
78  void waitOnRundown(bool rundown);
79 
80 private:
81  IAmDatabaseHandler* mDatabaseHandler;
82  CAmControlSender* mControlSender;
83  CAmDbusWrapper* mDBusWrapper;
84  CAmSocketHandler* mSocketHandler;
85 
86  uint16_t handleCount;
87  std::vector<uint16_t> mListStartupHandles;
88  std::vector<uint16_t> mListRundownHandles;
89  bool mWaitStartup;
90  bool mWaitRundown;
91  am_Error_e mLastErrorStartup;
92  am_Error_e mLastErrorRundown;
93 };
94 
95 }
96 
97 #endif /* COMMANDRECEIVER_H_ */
am_Error_e connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t &mainConnectionID)
connects a source to sink
This class realizes the command Interface.
uint16_t getRundownHandle()
returns a rundown handle
A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects...
am_Error_e setMainSourceNotificationConfiguration(const am_sourceID_t sourceID, const am_NotificationConfiguration_s &mainNotificationConfiguration)
sets a MainNotificationConfiuration.
am_Error_e
the errors of the audiomanager.
This struct holds information about the configuration for notifications.
void getInterfaceVersion(std::string &version) const
This function returns the version of the interface.
The interface towards the Controlling Instance (e.g HMI).
Definition: IAmCommand.h:56
void confirmCommandRundown(const uint16_t handle, const am_Error_e error)
asynchronous confirmation of setCommandRundown
am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t &delay) const
returns the delay in ms that the audiopath for the given mainConnection has
The am::CAmSocketHandler implements a mainloop for the AudioManager.
int16_t am_timeSync_t
offset time that is introduced in milli seconds.
am_Error_e getDBusConnectionWrapper(CAmDbusWrapper *&dbusConnectionWrapper) const
this function is used to retrieve a pointer to the dBusConnectionWrapper
am_Error_e getListMainSourceNotificationConfigurations(const am_sourceID_t sourceID, std::vector< am_NotificationConfiguration_s > &listMainNotificationConfigurations) const
Retrieves the list of MainNotifications for a source.
am_Error_e setMainSourceSoundProperty(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID)
This method is used to set sound properties, e.g.
void confirmCommandReady(const uint16_t handle, const am_Error_e error)
asynchronous confirmation of setCommandReady.
am_Error_e getListMainSinks(std::vector< am_SinkType_s > &listMainSinks) const
returns the actual list of Sinks
struct describing system properties
void waitOnRundown(bool rundown)
tells the ComandReceiver to start waiting for all handles to be confirmed
am_Error_e getListSinkClasses(std::vector< am_SinkClass_s > &listSinkClasses) const
This is used to retrieve SinkClass Information of all sink classes.
am_Error_e setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume)
sets the volume for a sink
struct describung mainsound property
am_Error_e volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep)
This function is used to increment or decrement the current volume for a sink.
am_Error_e getListMainSources(std::vector< am_SourceType_s > &listMainSources) const
returns the actual list of Sources
am_Error_e setMainSinkNotificationConfiguration(const am_sinkID_t sinkID, const am_NotificationConfiguration_s &mainNotificationConfiguration)
sets a MainNotificationConfiuration.
uint16_t am_sourceID_t
a source ID
CAmCommandReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmControlSender *iControlSender, CAmSocketHandler *iSocketHandler)
sends data to the commandInterface, takes the file of the library that needs to be loaded ...
This class handles and abstracts the database.
am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector< am_MainSoundProperty_s > &listSourceProperties) const
This is used to retrieve all source sound properties related to a source.
am_Error_e setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
sets the mute state of a sink
am_Error_e getListSystemProperties(std::vector< am_SystemProperty_s > &listSystemProperties) const
Retrieves a complete list of all systemProperties.
am_Error_e getSocketHandler(CAmSocketHandler *&socketHandler) const
This function returns the pointer to the socketHandler.
am_Error_e getListSourceClasses(std::vector< am_SourceClass_s > &listSourceClasses) const
This is used to retrieve SourceClass Information of all source classes.
void waitOnStartup(bool startup)
tells the ComandReceiver to start waiting for all handles to be confirmed
This wraps dbus and provides everything needed to anyone who wants to use dbus (including plugins)...
int16_t am_mainVolume_t
This is the volume presented on the command interface.
am_Error_e getListMainSinkNotificationConfigurations(const am_sinkID_t sinkID, std::vector< am_NotificationConfiguration_s > &listMainNotificationConfigurations) const
Retrieves the list of MainNotifications for a sink.
uint16_t getStartupHandle()
returns a startup handle
am_Error_e getVolume(const am_sinkID_t sinkID, am_mainVolume_t &mainVolume) const
Returns the current volume for the sink directly out of the database.
Copyright (C) 2012 - 2014, BMW AG.
uint16_t am_sinkID_t
a sink ID
uint16_t am_mainConnectionID_t
a mainConnection ID
am_Error_e getListMainConnections(std::vector< am_MainConnectionType_s > &listConnections) const
returns the actual list of MainConnections
am_Error_e setMainSinkSoundProperty(const am_MainSoundProperty_s &soundProperty, const am_sinkID_t sinkID)
This method is used to set sound properties, e.g.
am_Error_e disconnect(const am_mainConnectionID_t mainConnectionID)
disconnects a mainConnection
am_Error_e setSystemProperty(const am_SystemProperty_s &property)
is used to set a specific system property.
am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector< am_MainSoundProperty_s > &listSoundProperties) const
This is used to retrieve all source sound properties related to a source.