32 #define __METHOD_NAME__ std::string (std::string("CAmCommandReceiver::") + __func__) 38 mDatabaseHandler(iDatabaseHandler),
39 mControlSender(iControlSender),
41 mSocketHandler(iSocketHandler),
43 mListStartupHandles(),
44 mListRundownHandles(),
47 mLastErrorStartup(
E_OK),
48 mLastErrorRundown(
E_OK)
51 assert(mDatabaseHandler!=NULL);
52 assert(mSocketHandler!=NULL);
53 assert(mControlSender!=NULL);
57 mDatabaseHandler(iDatabaseHandler),
58 mControlSender(iControlSender),
59 mDBusWrapper(iDBusWrapper),
60 mSocketHandler(iSocketHandler),
62 mListStartupHandles(),
63 mListRundownHandles(),
69 assert(mDatabaseHandler!=NULL);
70 assert(mSocketHandler!=NULL);
71 assert(mControlSender!=NULL);
72 assert(mDBusWrapper!=NULL);
179 #ifdef WITH_DBUS_WRAPPER 180 dbusConnectionWrapper = mDBusWrapper;
183 dbusConnectionWrapper = NULL;
190 socketHandler = mSocketHandler;
202 mLastErrorStartup=error;
203 mListStartupHandles.erase(std::remove(mListStartupHandles.begin(), mListStartupHandles.end(), handle), mListStartupHandles.end());
204 if (mWaitStartup && mListStartupHandles.empty())
211 mLastErrorRundown=error;
212 mListRundownHandles.erase(std::remove(mListRundownHandles.begin(), mListRundownHandles.end(), handle), mListRundownHandles.end());
213 if (mWaitRundown && mListRundownHandles.empty())
219 uint16_t handle = ++handleCount;
220 mListStartupHandles.push_back(handle);
226 uint16_t handle = ++handleCount;
227 mListRundownHandles.push_back(handle);
233 mWaitStartup = startup;
234 mLastErrorStartup=
E_OK;
261 mWaitRundown = rundown;
262 mLastErrorStartup=
E_OK;
am_Error_e connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t &mainConnectionID)
connects a source to sink
uint16_t getRundownHandle()
returns a rundown handle
am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume)
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_CustomNotificationType_t type
The notification type of the notification.
am_Error_e
the errors of the audiomanager.
am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s &soundProperty)
This struct holds information about the configuration for notifications.
void logInfo(T value, TArgs...args)
logs given values with infolevel with the default context
void getInterfaceVersion(std::string &version) const
This function returns the version of the interface.
am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID)
int16_t value
the actual value
virtual am_Error_e getListSourceClasses(std::vector< am_SourceClass_s > &listSourceClasses) const =0
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
virtual am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector< am_MainSoundProperty_s > &listSourceProperties) const =0
The am::CAmSocketHandler implements a mainloop for the AudioManager.
am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s &property)
virtual am_Error_e getListMainSourceNotificationConfigurations(const am_sourceID_t sourceID, std::vector< am_NotificationConfiguration_s > &listMainNotificationConfigurations)=0
void confirmCommandReady(const am_Error_e error)
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
virtual am_Error_e getListMainSinks(std::vector< am_SinkType_s > &listMainSinks) const =0
am_Error_e getListMainSourceNotificationConfigurations(const am_sourceID_t sourceID, std::vector< am_NotificationConfiguration_s > &listMainNotificationConfigurations) const
Retrieves the list of MainNotifications for a source.
SPDX license identifier: MPL-2.0.
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
SPDX license identifier: MPL-2.0.
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 hookUserSetMainSourceNotificationConfiguration(const am_sourceID_t sourceID, const am_NotificationConfiguration_s ¬ificationConfiguration)
virtual am_Error_e getListMainSources(std::vector< am_SourceType_s > &listMainSources) const =0
am_Error_e hookUserSetMainSinkNotificationConfiguration(const am_sinkID_t sinkID, const am_NotificationConfiguration_s ¬ificationConfiguration)
SPDX license identifier: MPL-2.0.
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
am_CustomMainSoundPropertyType_t type
the type of the property
am_CustomSystemPropertyType_t type
the type that is set
CAmCommandReceiver(IAmDatabaseHandler *iDatabaseHandler, CAmControlSender *iControlSender, CAmSocketHandler *iSocketHandler)
am_Error_e hookUserSetSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
sends data to the commandInterface, takes the file of the library that needs to be loaded ...
am_NotificationStatus_e status
The Notification status.
am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t &mainConnectionID)
This class handles and abstracts the database.
virtual am_Error_e getListSinkClasses(std::vector< am_SinkClass_s > &listSinkClasses) const =0
virtual am_Error_e getSinkMainVolume(const am_sinkID_t sinkID, am_mainVolume_t &mainVolume) const =0
am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s &soundProperty)
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
virtual am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector< am_MainSoundProperty_s > &listSoundProperties) const =0
void confirmCommandRundown(const am_Error_e error)
SPDX license identifier: MPL-2.0.
virtual am_Error_e getListSystemProperties(std::vector< am_SystemProperty_s > &listSystemProperties) const =0
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
virtual am_Error_e getListMainSinkNotificationConfigurations(const am_sinkID_t sinkID, std::vector< am_NotificationConfiguration_s > &listMainNotificationConfigurations)=0
This wraps dbus and provides everything needed to anyone who wants to use dbus (including plugins)...
virtual am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t &delay) const =0
int16_t am_mainVolume_t
This is the volume presented on the command interface.
no error - positive reply
SPDX license identifier: MPL-2.0.
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.
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.
int16_t parameter
This gives additional information to the notification status.
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.
virtual am_Error_e getListVisibleMainConnections(std::vector< am_MainConnectionType_s > &listConnections) const =0
am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment)
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.