diff options
Diffstat (limited to 'AudioManagerCore/src')
-rw-r--r-- | AudioManagerCore/src/CAmCommandReceiver.cpp | 17 | ||||
-rw-r--r-- | AudioManagerCore/src/CAmCommandSender.cpp | 24 | ||||
-rw-r--r-- | AudioManagerCore/src/CAmControlReceiver.cpp | 15 | ||||
-rw-r--r-- | AudioManagerCore/src/CAmControlSender.cpp | 18 | ||||
-rw-r--r-- | AudioManagerCore/src/CAmDatabaseHandlerMap.cpp | 97 |
5 files changed, 171 insertions, 0 deletions
diff --git a/AudioManagerCore/src/CAmCommandReceiver.cpp b/AudioManagerCore/src/CAmCommandReceiver.cpp index 78d8cbe..028b6ef 100644 --- a/AudioManagerCore/src/CAmCommandReceiver.cpp +++ b/AudioManagerCore/src/CAmCommandReceiver.cpp @@ -111,18 +111,35 @@ am_Error_e CAmCommandReceiver::setMainSinkSoundProperty(const am_MainSoundProper return (mControlSender->hookUserSetMainSinkSoundProperty(sinkID, soundProperty)); } +am_Error_e CAmCommandReceiver::setMainSinkSoundProperties(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sinkID_t sinkID) +{ + logInfo(__METHOD_NAME__, "sinkID=", sinkID); + return (mControlSender->hookUserSetMainSinkSoundProperties(sinkID, listSoundProperties)); +} + am_Error_e CAmCommandReceiver::setMainSourceSoundProperty(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID) { logInfo(__METHOD_NAME__, "sourceID=", sourceID, "soundPropertyType=", soundProperty.type, "soundPropertyValue=", soundProperty.value); return (mControlSender->hookUserSetMainSourceSoundProperty(sourceID, soundProperty)); } +am_Error_e CAmCommandReceiver::setMainSourceSoundProperties(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sourceID_t sourceID) +{ + logInfo(__METHOD_NAME__, "sourceID=", sourceID); + return (mControlSender->hookUserSetMainSourceSoundProperties(sourceID, listSoundProperties)); +} + am_Error_e CAmCommandReceiver::setSystemProperty(const am_SystemProperty_s &property) { logInfo(__METHOD_NAME__, "type=", property.type, "systemPropertyValue=", property.value); 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 d1a4a22..fd1be69 100644 --- a/AudioManagerCore/src/CAmCommandSender.cpp +++ b/AudioManagerCore/src/CAmCommandSender.cpp @@ -118,9 +118,15 @@ CAmCommandSender::CAmCommandSender(const std::vector<std::string> &listOfPluginD dboMainSinkSoundPropertyChanged = [&](const am_sinkID_t sinkID, const am_MainSoundProperty_s &SoundProperty) { mSerializer.asyncCall(this, &CAmCommandSender::cbMainSinkSoundPropertyChanged, sinkID, SoundProperty); }; + dboMainSinkSoundPropertiesChanged = [&](const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s> &listSoundProperties) { + mSerializer.asyncCall(this, &CAmCommandSender::cbMainSinkSoundPropertiesChanged, sinkID, listSoundProperties); + }; dboMainSourceSoundPropertyChanged = [&](const am_sourceID_t sourceID, const am_MainSoundProperty_s &SoundProperty) { mSerializer.asyncCall(this, &CAmCommandSender::cbMainSourceSoundPropertyChanged, sourceID, SoundProperty); }; + dboMainSourceSoundPropertiesChanged = [&](const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s> &listSoundProperties) { + mSerializer.asyncCall(this, &CAmCommandSender::cbMainSourceSoundPropertiesChanged, sourceID, listSoundProperties); + }; dboSinkAvailabilityChanged = [&](const am_sinkID_t sinkID, const am_Availability_s &availability) { mSerializer.asyncCall(this, &CAmCommandSender::cbSinkAvailabilityChanged, sinkID, availability); }; @@ -136,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); }; @@ -310,11 +319,21 @@ void CAmCommandSender::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, CALL_ALL_INTERFACES(cbMainSinkSoundPropertyChanged(sinkID, SoundProperty)) } +void CAmCommandSender::cbMainSinkSoundPropertiesChanged(const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s> &listSoundProperties) +{ + CALL_ALL_INTERFACES(cbMainSinkSoundPropertiesChanged(sinkID, listSoundProperties)) +} + void CAmCommandSender::cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s &SoundProperty) { CALL_ALL_INTERFACES(cbMainSourceSoundPropertyChanged(sourceID, SoundProperty)) } +void CAmCommandSender::cbMainSourceSoundPropertiesChanged(const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s> &listSoundProperties) +{ + CALL_ALL_INTERFACES(cbMainSourceSoundPropertiesChanged(sourceID, listSoundProperties)) +} + void CAmCommandSender::cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s &availability) { CALL_ALL_INTERFACES(cbSinkAvailabilityChanged(sinkID, availability)) @@ -340,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 6fec509..c72d733 100644 --- a/AudioManagerCore/src/CAmControlReceiver.cpp +++ b/AudioManagerCore/src/CAmControlReceiver.cpp @@ -206,11 +206,21 @@ am_Error_e CAmControlReceiver::changeMainSinkSoundPropertyDB(const am_MainSoundP return (mDatabaseHandler->changeMainSinkSoundPropertyDB(soundProperty, sinkID)); } +am_Error_e CAmControlReceiver::changeMainSinkSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sinkID_t sinkID) +{ + return (mDatabaseHandler->changeMainSinkSoundPropertiesDB(listSoundProperties, sinkID)); +} + am_Error_e CAmControlReceiver::changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID) { return (mDatabaseHandler->changeMainSourceSoundPropertyDB(soundProperty, sourceID)); } +am_Error_e CAmControlReceiver::changeMainSourceSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sourceID_t sourceID) +{ + return (mDatabaseHandler->changeMainSourceSoundPropertiesDB(listSoundProperties, sourceID)); +} + am_Error_e CAmControlReceiver::changeSourceAvailabilityDB(const am_Availability_s &availability, const am_sourceID_t sourceID) { return (mDatabaseHandler->changeSourceAvailabilityDB(availability, sourceID)); @@ -221,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 1baeb30..a683a42 100644 --- a/AudioManagerCore/src/CAmControlSender.cpp +++ b/AudioManagerCore/src/CAmControlSender.cpp @@ -193,18 +193,36 @@ am_Error_e CAmControlSender::hookUserSetMainSinkSoundProperty(const am_sinkID_t return (mController->hookUserSetMainSinkSoundProperty(sinkID, soundProperty)); } +am_Error_e CAmControlSender::hookUserSetMainSinkSoundProperties(const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s > &listSoundProperties) +{ + assert(mController); + return (mController->hookUserSetMainSinkSoundProperties(sinkID, listSoundProperties)); +} + am_Error_e CAmControlSender::hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s &soundProperty) { assert(mController); return (mController->hookUserSetMainSourceSoundProperty(sourceID, soundProperty)); } +am_Error_e CAmControlSender::hookUserSetMainSourceSoundProperties(const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s > &listSoundProperties) +{ + assert(mController); + return (mController->hookUserSetMainSourceSoundProperties(sourceID, listSoundProperties)); +} + am_Error_e CAmControlSender::hookUserSetSystemProperty(const am_SystemProperty_s &property) { assert(mController); 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 c79fbf3..928ce8f 100644 --- a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp +++ b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp @@ -1526,6 +1526,42 @@ am_Error_e CAmDatabaseHandlerMap::changeMainSinkSoundPropertyDB(const am_MainSou } } +am_Error_e CAmDatabaseHandlerMap::changeMainSinkSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sinkID_t sinkID) +{ + + if (!existSink(sinkID)) + { + logError(__METHOD_NAME__, "sinkID=", sinkID," must exist"); + return (E_NON_EXISTENT); + } + + am_Sink_Database_s &sink = mMappedData.mSinkMap[sinkID]; + std::vector<am_MainSoundProperty_s>::iterator elementIterator; + + for (auto &itlistSoundProperties : listSoundProperties ) + { + for (elementIterator = sink.listMainSoundProperties.begin(); elementIterator != sink.listMainSoundProperties.end(); + ++elementIterator ) + { + if (elementIterator->type == itlistSoundProperties.type) + { + DB_COND_UPDATE_RIE(elementIterator->value, itlistSoundProperties.value); + if (sink.cacheMainSoundProperties.size()) + { + sink.cacheMainSoundProperties[itlistSoundProperties.type] = itlistSoundProperties.value; + } + + break; + } + } + } + + logVerbose("DatabaseHandler::changeMainSinkSoundPropertiesDB changed MainSinkSoundProperties of sink:", sinkID); + + NOTIFY_OBSERVERS2(dboMainSinkSoundPropertiesChanged, sinkID, listSoundProperties) + return (E_OK); +} + am_Error_e CAmDatabaseHandlerMap::changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID) { @@ -1567,6 +1603,41 @@ am_Error_e CAmDatabaseHandlerMap::changeMainSourceSoundPropertyDB(const am_MainS } } +am_Error_e CAmDatabaseHandlerMap::changeMainSourceSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sourceID_t sourceID) +{ + if (!existSource(sourceID)) + { + logError(__METHOD_NAME__, "sourceID=", sourceID, " must exist"); + return (E_NON_EXISTENT); + } + + am_Source_Database_s &source = mMappedData.mSourceMap.at(sourceID); + std::vector<am_MainSoundProperty_s>::iterator elementIterator; + + for (auto &itlistSoundProperties : listSoundProperties ) + { + for (elementIterator = source.listMainSoundProperties.begin(); elementIterator != source.listMainSoundProperties.end(); + ++elementIterator ) + { + if (elementIterator->type == itlistSoundProperties.type) + { + DB_COND_UPDATE_RIE(elementIterator->value, itlistSoundProperties.value); + if (source.cacheMainSoundProperties.size()) + { + source.cacheMainSoundProperties[itlistSoundProperties.type] = itlistSoundProperties.value; + } + + break; + } + } + } + + logVerbose("DatabaseHandler::changeMainSourceSoundPropertiesDB changed MainSinkSoundProperties of source:", sourceID); + + NOTIFY_OBSERVERS2(dboMainSourceSoundPropertiesChanged, sourceID, listSoundProperties) + return (E_OK); +} + am_Error_e CAmDatabaseHandlerMap::changeSourceAvailabilityDB(const am_Availability_s &availability, const am_sourceID_t sourceID) { if (!(availability.availability >= A_UNKNOWN && availability.availability <= A_MAX)) @@ -1618,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) { |