summaryrefslogtreecommitdiff
path: root/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AudioManagerCore/src/CAmDatabaseHandlerMap.cpp')
-rw-r--r--AudioManagerCore/src/CAmDatabaseHandlerMap.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp b/AudioManagerCore/src/CAmDatabaseHandlerMap.cpp
index c79fbf3..eabcb18 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))