36 mDatabaseHandler(iDatabaseHandler),
37 mControlSender(iControlSender),
39 mSocketHandler(iSocketHandler),
41 mListStartupHandles(),
42 mListRundownHandles(),
45 mLastErrorStartup(
E_OK),
46 mLastErrorRundown(
E_OK)
49 assert(mDatabaseHandler!=NULL);
50 assert(mSocketHandler!=NULL);
51 assert(mControlSender!=NULL);
55 mDatabaseHandler(iDatabaseHandler),
56 mControlSender(iControlSender),
57 mDBusWrapper(iDBusWrapper),
58 mSocketHandler(iSocketHandler),
60 mListStartupHandles(),
61 mListRundownHandles(),
67 assert(mDatabaseHandler!=NULL);
68 assert(mSocketHandler!=NULL);
69 assert(mControlSender!=NULL);
70 assert(mDBusWrapper!=NULL);
79 logInfo(
"CommandReceiver::connect got called, sourceID=", sourceID,
"sinkID=", sinkID);
85 logInfo(
"CommandReceiver::disconnect got called, mainConnectionID=", mainConnectionID);
91 logInfo(
"CommandReceiver::setVolume got called, sinkID=", sinkID,
"volume=", volume);
97 logInfo(
"CommandReceiver::volumeStep got called, sinkID=", sinkID,
"volumeStep=", volumeStep);
103 logInfo(
"CommandReceiver::setSinkMuteState got called, sinkID=", sinkID,
"muteState=", muteState);
109 logInfo(
"CommandReceiver::setMainSinkSoundProperty got called, sinkID=", sinkID,
"soundPropertyType=", soundProperty.
type,
"soundPropertyValue=", soundProperty.
value);
115 logInfo(
"CommandReceiver::setMainSourceSoundProperty got called, sourceID=", sourceID,
"soundPropertyType=", soundProperty.
type,
"soundPropertyValue=", soundProperty.
value);
121 logInfo(
"CommandReceiver::setSystemProperty got called",
"type=", property.
type,
"soundPropertyValue=", property.
value);
178 #ifdef WITH_DBUS_WRAPPER
179 dbusConnectionWrapper = mDBusWrapper;
182 dbusConnectionWrapper = NULL;
189 socketHandler = mSocketHandler;
201 mLastErrorStartup=error;
202 mListStartupHandles.erase(std::remove(mListStartupHandles.begin(), mListStartupHandles.end(), handle), mListStartupHandles.end());
203 if (mWaitStartup && mListStartupHandles.empty())
210 mLastErrorRundown=error;
211 mListRundownHandles.erase(std::remove(mListRundownHandles.begin(), mListRundownHandles.end(), handle), mListRundownHandles.end());
212 if (mWaitRundown && mListRundownHandles.empty())
218 uint16_t handle = ++handleCount;
219 mListStartupHandles.push_back(handle);
225 uint16_t handle = ++handleCount;
226 mListRundownHandles.push_back(handle);
232 mWaitStartup = startup;
233 mLastErrorStartup=
E_OK;
248 logInfo(
"CommandReceiver::setMainSinkNotificationConfiguration got called, sinkID=", sinkID,
" type=",mainNotificationConfiguration.
type,
" parameter=", mainNotificationConfiguration.
parameter,
"status=",mainNotificationConfiguration.
status);
254 logInfo(
"CommandReceiver::setMainSourceNotificationConfiguration got called, sourceID=", sourceID,
" type=",mainNotificationConfiguration.
type,
" parameter=", mainNotificationConfiguration.
parameter,
"status=",mainNotificationConfiguration.
status);
260 mWaitRundown = rundown;
261 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)
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.