summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/src/CommandReceiver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AudioManagerDaemon/src/CommandReceiver.cpp')
-rw-r--r--AudioManagerDaemon/src/CommandReceiver.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/AudioManagerDaemon/src/CommandReceiver.cpp b/AudioManagerDaemon/src/CommandReceiver.cpp
index 604a659..a970f6b 100644
--- a/AudioManagerDaemon/src/CommandReceiver.cpp
+++ b/AudioManagerDaemon/src/CommandReceiver.cpp
@@ -6,10 +6,19 @@
*/
#include "CommandReceiver.h"
+#include <dlt/dlt.h>
+#include <assert.h>
-CommandReceiver::CommandReceiver(DatabaseHandler* iDatabaseHandler, DBusWrapper* iDBusWrapper)
-: mDatabaseHandler(iDatabaseHandler), mDBusWrapper(iDBusWrapper)
+DLT_IMPORT_CONTEXT(AudioManager)
+
+CommandReceiver::CommandReceiver (DatabaseHandler* iDatabaseHandler, DBusWrapper* iDBusWrapper, ControlSender* iControlSender)
+ : mDatabaseHandler(iDatabaseHandler),
+ mDBusWrapper(iDBusWrapper),
+ mControlSender(iControlSender)
{
+ assert(mDatabaseHandler!=NULL);
+ assert(mDBusWrapper!=NULL);
+ assert(mControlSender!=NULL);
}
CommandReceiver::~CommandReceiver()
@@ -18,50 +27,64 @@ CommandReceiver::~CommandReceiver()
am_Error_e CommandReceiver::connect(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
{
- mainConnectionID=4;
- return E_OK;
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::connect got called:"),DLT_STRING("sourceID"),DLT_INT(sourceID), DLT_STRING("sinkID"), DLT_INT(sinkID));
+ return mControlSender->hookUserConnectionRequest(sourceID,sinkID,mainConnectionID);
}
am_Error_e CommandReceiver::disconnect(const am_mainConnectionID_t mainConnectionID)
{
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::disconnect got called, mainConnectionID="),DLT_INT(mainConnectionID));
+ return mControlSender->hookUserDisconnectionRequest(mainConnectionID);
}
am_Error_e CommandReceiver::setVolume(const am_sinkID_t sinkID, const am_mainVolume_t volume)
{
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::setVolume got called, sinkID="),DLT_INT(sinkID),DLT_STRING("volume="),DLT_INT(volume));
+ return mControlSender->hookUserVolumeChange(sinkID,volume);
}
am_Error_e CommandReceiver::volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep)
{
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::volumeStep got called, sinkID="),DLT_INT(sinkID),DLT_STRING("volumeStep="),DLT_INT(volumeStep));
+ return mControlSender->hookUserVolumeStep(sinkID,volumeStep);
}
am_Error_e CommandReceiver::setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState)
{
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("CommandReceiver::setSinkMuteState got called, sinkID="),DLT_INT(sinkID),DLT_STRING("muteState="),DLT_INT(muteState));
+ return mControlSender->hookUserSetSinkMuteState(sinkID,muteState);
}
am_Error_e CommandReceiver::setMainSinkSoundProperty(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
{
+ 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));
+ return mControlSender->hookUserSetMainSinkSoundProperty(sinkID,soundProperty);
}
am_Error_e CommandReceiver::setMainSourceSoundProperty(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
{
+ 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));
+ return mControlSender->hookUserSetMainSourceSoundProperty(sourceID,soundProperty);
}
am_Error_e CommandReceiver::setSystemProperty(const am_SystemProperty_s & property)
{
+ 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));
+ return mControlSender->hookUserSetSystemProperty(property);
}