4 * Created on: Oct 24, 2011
8 #include "CommandReceiver.h"
12 DLT_IMPORT_CONTEXT(AudioManager)
14 CommandReceiver::CommandReceiver (DatabaseHandler* iDatabaseHandler, DBusWrapper* iDBusWrapper, ControlSender* iControlSender)
15 : mDatabaseHandler(iDatabaseHandler),
16 mDBusWrapper(iDBusWrapper),
17 mControlSender(iControlSender)
19 assert(mDatabaseHandler!=NULL);
20 assert(mDBusWrapper!=NULL);
21 assert(mControlSender!=NULL);
24 CommandReceiver::~CommandReceiver()
28 am_Error_e CommandReceiver::connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
30 DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::connect got called:"),DLT_STRING("sourceID"),DLT_INT(sourceID), DLT_STRING("sinkID"), DLT_INT(sinkID));
31 return mControlSender->hookUserConnectionRequest(sourceID,sinkID,mainConnectionID);
36 am_Error_e CommandReceiver::disconnect(const am_mainConnectionID_t mainConnectionID)
38 DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::disconnect got called, mainConnectionID="),DLT_INT(mainConnectionID));
39 return mControlSender->hookUserDisconnectionRequest(mainConnectionID);
44 am_Error_e CommandReceiver::setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume)
46 DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::setVolume got called, sinkID="),DLT_INT(sinkID),DLT_STRING("volume="),DLT_INT(volume));
47 return mControlSender->hookUserVolumeChange(sinkID,volume);
52 am_Error_e CommandReceiver::volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep)
54 DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::volumeStep got called, sinkID="),DLT_INT(sinkID),DLT_STRING("volumeStep="),DLT_INT(volumeStep));
55 return mControlSender->hookUserVolumeStep(sinkID,volumeStep);
60 am_Error_e CommandReceiver::setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
62 DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::setSinkMuteState got called, sinkID="),DLT_INT(sinkID),DLT_STRING("muteState="),DLT_INT(muteState));
63 return mControlSender->hookUserSetSinkMuteState(sinkID,muteState);
68 am_Error_e CommandReceiver::setMainSinkSoundProperty(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
70 DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::setMainSinkSoundProperty got called, sinkID="),DLT_INT(sinkID),DLT_STRING("soundPropertyType="),DLT_INT(soundProperty.type),DLT_STRING("soundPropertyValue="),DLT_INT(soundProperty.value));
71 return mControlSender->hookUserSetMainSinkSoundProperty(sinkID,soundProperty);
76 am_Error_e CommandReceiver::setMainSourceSoundProperty(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
78 DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::setMainSourceSoundProperty got called, sourceID="),DLT_INT(sourceID),DLT_STRING("soundPropertyType="),DLT_INT(soundProperty.type),DLT_STRING("soundPropertyValue="),DLT_INT(soundProperty.value));
79 return mControlSender->hookUserSetMainSourceSoundProperty(sourceID,soundProperty);
84 am_Error_e CommandReceiver::setSystemProperty(const am_SystemProperty_s & property)
86 DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::setSystemProperty got called"),DLT_STRING("type="),DLT_INT(property.type),DLT_STRING("soundPropertyValue="),DLT_INT(property.value));
87 return mControlSender->hookUserSetSystemProperty(property);
92 am_Error_e CommandReceiver::getListMainConnections(std::vector<am_MainConnectionType_s> & listConnections) const
94 return mDatabaseHandler->getListVisibleMainConnections(listConnections);
100 am_Error_e CommandReceiver::getListMainSinks(std::vector<am_SinkType_s>& listMainSinks) const
102 return mDatabaseHandler->getListMainSinks(listMainSinks);
107 am_Error_e CommandReceiver::getListMainSources(std::vector<am_SourceType_s>& listMainSources) const
109 return mDatabaseHandler->getListMainSources(listMainSources);
114 am_Error_e CommandReceiver::getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s> & listSoundProperties) const
116 return mDatabaseHandler->getListMainSinkSoundProperties(sinkID,listSoundProperties);
121 am_Error_e CommandReceiver::getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s> & listSourceProperties) const
123 return mDatabaseHandler->getListMainSourceSoundProperties(sourceID,listSourceProperties);
128 am_Error_e CommandReceiver::getListSourceClasses(std::vector<am_SourceClass_s> & listSourceClasses) const
130 return mDatabaseHandler->getListSourceClasses(listSourceClasses);
135 am_Error_e CommandReceiver::getListSinkClasses(std::vector<am_SinkClass_s> & listSinkClasses) const
137 return mDatabaseHandler->getListSinkClasses(listSinkClasses);
142 am_Error_e CommandReceiver::getListSystemProperties(std::vector<am_SystemProperty_s> & listSystemProperties) const
144 return mDatabaseHandler->getListSystemProperties(listSystemProperties);
149 am_Error_e CommandReceiver::getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t & delay) const
151 return mDatabaseHandler->getTimingInformation(mainConnectionID,delay);
156 am_Error_e CommandReceiver::getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const
158 dbusConnectionWrapper=mDBusWrapper;