diff options
author | Martin Koch <mkoch@de.adit-jv.com> | 2020-01-17 09:07:47 +0100 |
---|---|---|
committer | Martin Koch <mkoch@de.adit-jv.com> | 2020-01-17 09:14:51 +0100 |
commit | c1e284360ec02b06ccb0a97a00fed05ef0bb2c60 (patch) | |
tree | 752b600be063bd3938e7e8fc7b304ac46f53ef1d /AudioManagerCore/src | |
parent | a2af83777be4860d554bceaf28c87218729cf309 (diff) | |
download | audiomanager-c1e284360ec02b06ccb0a97a00fed05ef0bb2c60.tar.gz |
AM: add plural form of setSystemProperties for global configuration attributes to command and control interface
- implement plural form of requests and acknowledgments in core
- provide empty default implementations in interfaces to ensure backward compatibility with older plugins
- accommodate extension in module tests
Main purpose of this extension is to allow for one-shot (uninterrupted), consistent change of multiple, possibly interrelated configuration attributes.
Signed-off-by: Martin Koch <mkoch@de.adit-jv.com>
Diffstat (limited to 'AudioManagerCore/src')
-rw-r--r-- | AudioManagerCore/src/CAmCommandReceiver.cpp | 5 | ||||
-rw-r--r-- | AudioManagerCore/src/CAmCommandSender.cpp | 8 | ||||
-rw-r--r-- | AudioManagerCore/src/CAmControlReceiver.cpp | 5 | ||||
-rw-r--r-- | AudioManagerCore/src/CAmControlSender.cpp | 6 | ||||
-rw-r--r-- | AudioManagerCore/src/CAmDatabaseHandlerMap.cpp | 26 |
5 files changed, 50 insertions, 0 deletions
diff --git a/AudioManagerCore/src/CAmCommandReceiver.cpp b/AudioManagerCore/src/CAmCommandReceiver.cpp index 1937f32..028b6ef 100644 --- a/AudioManagerCore/src/CAmCommandReceiver.cpp +++ b/AudioManagerCore/src/CAmCommandReceiver.cpp @@ -135,6 +135,11 @@ am_Error_e CAmCommandReceiver::setSystemProperty(const am_SystemProperty_s &prop return (mControlSender->hookUserSetSystemProperty(property)); } +am_Error_e CAmCommandReceiver::setSystemProperties(const std::vector<am_SystemProperty_s> &listSystemProperties) +{ + return (mControlSender->hookUserSetSystemProperties(listSystemProperties)); +} + am_Error_e CAmCommandReceiver::getVolume(const am_sinkID_t sinkID, am_mainVolume_t &mainVolume) const { return (mDatabaseHandler->getSinkMainVolume(sinkID, mainVolume)); diff --git a/AudioManagerCore/src/CAmCommandSender.cpp b/AudioManagerCore/src/CAmCommandSender.cpp index 622e5fd..fd1be69 100644 --- a/AudioManagerCore/src/CAmCommandSender.cpp +++ b/AudioManagerCore/src/CAmCommandSender.cpp @@ -142,6 +142,9 @@ CAmCommandSender::CAmCommandSender(const std::vector<std::string> &listOfPluginD dboSystemPropertyChanged = [&](const am_SystemProperty_s &SystemProperty) { mSerializer.asyncCall(this, &CAmCommandSender::cbSystemPropertyChanged, SystemProperty); }; + dboSystemPropertiesChanged = [&](const std::vector<am_SystemProperty_s> &SystemProperties) { + mSerializer.asyncCall(this, &CAmCommandSender::cbSystemPropertiesChanged, SystemProperties); + }; dboTimingInformationChanged = [&](const am_mainConnectionID_t mainConnection, const am_timeSync_t time) { mSerializer.asyncCall(this, &CAmCommandSender::cbTimingInformationChanged, mainConnection, time); }; @@ -356,6 +359,11 @@ void CAmCommandSender::cbSystemPropertyChanged(const am_SystemProperty_s &System CALL_ALL_INTERFACES(cbSystemPropertyChanged(SystemProperty)) } +void CAmCommandSender::cbSystemPropertiesChanged(const std::vector<am_SystemProperty_s> &listSystemProperties) +{ + CALL_ALL_INTERFACES(cbSystemPropertiesChanged(listSystemProperties)) +} + void CAmCommandSender::cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) { CALL_ALL_INTERFACES(cbTimingInformationChanged(mainConnection, time)) diff --git a/AudioManagerCore/src/CAmControlReceiver.cpp b/AudioManagerCore/src/CAmControlReceiver.cpp index 0fe9b03..c72d733 100644 --- a/AudioManagerCore/src/CAmControlReceiver.cpp +++ b/AudioManagerCore/src/CAmControlReceiver.cpp @@ -231,6 +231,11 @@ am_Error_e CAmControlReceiver::changeSystemPropertyDB(const am_SystemProperty_s return (mDatabaseHandler->changeSystemPropertyDB(property)); } +am_Error_e CAmControlReceiver::changeSystemPropertiesDB(const std::vector<am_SystemProperty_s> &listSystemProperties) +{ + return (mDatabaseHandler->changeSystemPropertiesDB(listSystemProperties)); +} + am_Error_e CAmControlReceiver::removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID) { return (mDatabaseHandler->removeMainConnectionDB(mainConnectionID)); diff --git a/AudioManagerCore/src/CAmControlSender.cpp b/AudioManagerCore/src/CAmControlSender.cpp index e8f2285..a683a42 100644 --- a/AudioManagerCore/src/CAmControlSender.cpp +++ b/AudioManagerCore/src/CAmControlSender.cpp @@ -217,6 +217,12 @@ am_Error_e CAmControlSender::hookUserSetSystemProperty(const am_SystemProperty_s return (mController->hookUserSetSystemProperty(property)); } +am_Error_e CAmControlSender::hookUserSetSystemProperties(const std::vector<am_SystemProperty_s> &listSystemProperties) +{ + assert(mController); + return (mController->hookUserSetSystemProperties(listSystemProperties)); +} + am_Error_e CAmControlSender::hookUserVolumeChange(const am_sinkID_t sinkID, const am_mainVolume_t newVolume) { assert(mController); diff --git a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp index eabcb18..928ce8f 100644 --- a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp +++ b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp @@ -1689,6 +1689,32 @@ am_Error_e CAmDatabaseHandlerMap::changeSystemPropertyDB(const am_SystemProperty } } +am_Error_e CAmDatabaseHandlerMap::changeSystemPropertiesDB(const std::vector<am_SystemProperty_s> &listSystemProperties) +{ + std::vector<am_SystemProperty_s>::iterator elementIterator; + + for (auto &itlistSystemProperties : listSystemProperties) + { + for (elementIterator = mMappedData.mSystemProperties.begin(); elementIterator != mMappedData.mSystemProperties.end(); + ++elementIterator) + { + if (elementIterator->type == itlistSystemProperties.type) + { + DB_COND_UPDATE_RIE(elementIterator->value, itlistSystemProperties.value); + } + else + logVerbose("DatabaseHandler::changeSystemPropertiesDB system property does not match the internal list"); + } + + } + + logVerbose("DatabaseHandler::changeSystemPropertiesDB changed system property"); + + NOTIFY_OBSERVERS1(dboSystemPropertiesChanged, listSystemProperties) + + return (E_OK); +} + am_Error_e CAmDatabaseHandlerMap::removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID) { |