summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koch <mkoch@de.adit-jv.com>2020-01-16 15:31:05 +0100
committerMartin Koch <mkoch@de.adit-jv.com>2020-01-17 09:14:36 +0100
commita2af83777be4860d554bceaf28c87218729cf309 (patch)
tree58472fdde28c6660ba60d1efd4f8b119eafd1ab5
parentce501a931e9eeb20013406373156bf70fb007cda (diff)
downloadaudiomanager-a2af83777be4860d554bceaf28c87218729cf309.tar.gz
AM: add plural form of set...SoundProperties for sources and sinks 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 extensions in module tests - leave existing singular form untouched Main purpose of this extension is to allow for one-shot (uninterrupted), consistent change of multiple, possibly interrelated sound properties. Signed-off-by: Martin Koch <mkoch@de.adit-jv.com>
-rw-r--r--AudioManagerCore/include/CAmCommandReceiver.h2
-rw-r--r--AudioManagerCore/include/CAmCommandSender.h2
-rw-r--r--AudioManagerCore/include/CAmControlReceiver.h2
-rw-r--r--AudioManagerCore/include/CAmControlSender.h2
-rw-r--r--AudioManagerCore/include/CAmDatabaseHandlerMap.h4
-rw-r--r--AudioManagerCore/include/IAmDatabaseHandler.h2
-rw-r--r--AudioManagerCore/src/CAmCommandReceiver.cpp12
-rw-r--r--AudioManagerCore/src/CAmCommandSender.cpp16
-rw-r--r--AudioManagerCore/src/CAmControlReceiver.cpp10
-rw-r--r--AudioManagerCore/src/CAmControlSender.cpp12
-rw-r--r--AudioManagerCore/src/CAmDatabaseHandlerMap.cpp71
-rw-r--r--AudioManagerCore/test/AmMapHandlerTest/CAmTestDatabaseObserver.cpp4
-rw-r--r--AudioManagerCore/test/AmMapHandlerTest/MockDatabaseObserver.h4
-rw-r--r--AudioManagerCore/test/MockIAmCommandSend.h4
-rw-r--r--AudioManagerCore/test/MockIAmControlSend.h4
-rw-r--r--include/IAmCommand.h22
-rw-r--r--include/IAmControl.h24
17 files changed, 195 insertions, 2 deletions
diff --git a/AudioManagerCore/include/CAmCommandReceiver.h b/AudioManagerCore/include/CAmCommandReceiver.h
index 9080b25..8c43987 100644
--- a/AudioManagerCore/include/CAmCommandReceiver.h
+++ b/AudioManagerCore/include/CAmCommandReceiver.h
@@ -49,7 +49,9 @@ public:
am_Error_e volumeStep(const am_sinkID_t sinkID, const int16_t volumeStep);
am_Error_e setSinkMuteState(const am_sinkID_t sinkID, const am_MuteState_e muteState);
am_Error_e setMainSinkSoundProperty(const am_MainSoundProperty_s &soundProperty, const am_sinkID_t sinkID);
+ am_Error_e setMainSinkSoundProperties(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sinkID_t sinkID);
am_Error_e setMainSourceSoundProperty(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID);
+ am_Error_e setMainSourceSoundProperties(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sourceID_t sourceID);
am_Error_e setSystemProperty(const am_SystemProperty_s &property);
am_Error_e getVolume(const am_sinkID_t sinkID, am_mainVolume_t &mainVolume) const;
am_Error_e getListMainConnections(std::vector<am_MainConnectionType_s> &listConnections) const;
diff --git a/AudioManagerCore/include/CAmCommandSender.h b/AudioManagerCore/include/CAmCommandSender.h
index 5646282..c438711 100644
--- a/AudioManagerCore/include/CAmCommandSender.h
+++ b/AudioManagerCore/include/CAmCommandSender.h
@@ -60,7 +60,9 @@ public:
void cbNumberOfSourceClassesChanged();
void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState);
void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s &soundProperty);
+ void cbMainSinkSoundPropertiesChanged(const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s> &listSoundProperties);
void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s &soundProperty);
+ void cbMainSourceSoundPropertiesChanged(const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s> &listSoundProperties);
void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s &availability);
void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s &availability);
void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume);
diff --git a/AudioManagerCore/include/CAmControlReceiver.h b/AudioManagerCore/include/CAmControlReceiver.h
index 36c4d14..a710d23 100644
--- a/AudioManagerCore/include/CAmControlReceiver.h
+++ b/AudioManagerCore/include/CAmControlReceiver.h
@@ -76,7 +76,9 @@ public:
am_Error_e changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID);
am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID);
am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sinkID_t sinkID);
+ am_Error_e changeMainSinkSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sinkID_t sinkID);
am_Error_e changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID);
+ am_Error_e changeMainSourceSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sourceID_t sourceID);
am_Error_e changeSourceAvailabilityDB(const am_Availability_s &availability, const am_sourceID_t sourceID);
am_Error_e changeSystemPropertyDB(const am_SystemProperty_s &property);
am_Error_e removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID);
diff --git a/AudioManagerCore/include/CAmControlSender.h b/AudioManagerCore/include/CAmControlSender.h
index 6d6a562..f6c2f0e 100644
--- a/AudioManagerCore/include/CAmControlSender.h
+++ b/AudioManagerCore/include/CAmControlSender.h
@@ -50,7 +50,9 @@ public:
am_Error_e hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t &mainConnectionID);
am_Error_e hookUserDisconnectionRequest(const am_mainConnectionID_t connectionID);
am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s &soundProperty);
+ am_Error_e hookUserSetMainSinkSoundProperties(const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s > &listSoundProperties);
am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s &soundProperty);
+ am_Error_e hookUserSetMainSourceSoundProperties(const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s > &listSoundProperties);
am_Error_e hookUserSetSystemProperty(const am_SystemProperty_s &property);
am_Error_e hookUserVolumeChange(const am_sinkID_t SinkID, const am_mainVolume_t newVolume);
am_Error_e hookUserVolumeStep(const am_sinkID_t SinkID, const int16_t increment);
diff --git a/AudioManagerCore/include/CAmDatabaseHandlerMap.h b/AudioManagerCore/include/CAmDatabaseHandlerMap.h
index 93ee1be..f3c39d8 100644
--- a/AudioManagerCore/include/CAmDatabaseHandlerMap.h
+++ b/AudioManagerCore/include/CAmDatabaseHandlerMap.h
@@ -97,7 +97,9 @@ public:
std::function<void(const am_crossfaderID_t)> dboRemoveCrossfader;
std::function<void(const am_mainConnectionID_t, const am_ConnectionState_e)> dboMainConnectionStateChanged;
std::function<void(const am_sinkID_t, const am_MainSoundProperty_s &)> dboMainSinkSoundPropertyChanged;
+ std::function<void(const am_sinkID_t, const std::vector<am_MainSoundProperty_s> &)> dboMainSinkSoundPropertiesChanged;
std::function<void(const am_sourceID_t, const am_MainSoundProperty_s &)> dboMainSourceSoundPropertyChanged;
+ std::function<void(const am_sourceID_t, const std::vector<am_MainSoundProperty_s> &)> dboMainSourceSoundPropertiesChanged;
std::function<void(const am_sinkID_t, const am_Availability_s &)> dboSinkAvailabilityChanged;
std::function<void(const am_sourceID_t, const am_Availability_s &)> dboSourceAvailabilityChanged;
std::function<void(const am_sinkID_t, const am_mainVolume_t)> dboVolumeChanged;
@@ -137,7 +139,9 @@ public:
am_Error_e changeDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID);
am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID);
am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sinkID_t sinkID);
+ am_Error_e changeMainSinkSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sinkID_t sinkID);
am_Error_e changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID);
+ am_Error_e changeMainSourceSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sourceID_t sourceID);
am_Error_e changeSourceSoundPropertyDB(const am_SoundProperty_s &soundProperty, const am_sourceID_t sourceID);
am_Error_e changeSinkSoundPropertyDB(const am_SoundProperty_s &soundProperty, const am_sinkID_t sinkID);
am_Error_e changeSourceAvailabilityDB(const am_Availability_s &availability, const am_sourceID_t sourceID);
diff --git a/AudioManagerCore/include/IAmDatabaseHandler.h b/AudioManagerCore/include/IAmDatabaseHandler.h
index 5272d4f..2185cd4 100644
--- a/AudioManagerCore/include/IAmDatabaseHandler.h
+++ b/AudioManagerCore/include/IAmDatabaseHandler.h
@@ -79,7 +79,9 @@ public:
virtual am_Error_e changeDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID) = 0;
virtual am_Error_e changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID) = 0;
virtual am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sinkID_t sinkID) = 0;
+ virtual am_Error_e changeMainSinkSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sinkID_t sinkID) = 0;
virtual am_Error_e changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s &soundProperty, const am_sourceID_t sourceID) = 0;
+ virtual am_Error_e changeMainSourceSoundPropertiesDB(const std::vector<am_MainSoundProperty_s> &listSoundProperties, const am_sourceID_t sourceID) = 0;
virtual am_Error_e changeSourceSoundPropertyDB(const am_SoundProperty_s &soundProperty, const am_sourceID_t sourceID) = 0;
virtual am_Error_e changeSinkSoundPropertyDB(const am_SoundProperty_s &soundProperty, const am_sinkID_t sinkID) = 0;
virtual am_Error_e changeSourceAvailabilityDB(const am_Availability_s &availability, const am_sourceID_t sourceID) = 0;
diff --git a/AudioManagerCore/src/CAmCommandReceiver.cpp b/AudioManagerCore/src/CAmCommandReceiver.cpp
index 78d8cbe..1937f32 100644
--- a/AudioManagerCore/src/CAmCommandReceiver.cpp
+++ b/AudioManagerCore/src/CAmCommandReceiver.cpp
@@ -111,12 +111,24 @@ 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);
diff --git a/AudioManagerCore/src/CAmCommandSender.cpp b/AudioManagerCore/src/CAmCommandSender.cpp
index d1a4a22..622e5fd 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);
};
@@ -310,11 +316,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))
diff --git a/AudioManagerCore/src/CAmControlReceiver.cpp b/AudioManagerCore/src/CAmControlReceiver.cpp
index 6fec509..0fe9b03 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));
diff --git a/AudioManagerCore/src/CAmControlSender.cpp b/AudioManagerCore/src/CAmControlSender.cpp
index 1baeb30..e8f2285 100644
--- a/AudioManagerCore/src/CAmControlSender.cpp
+++ b/AudioManagerCore/src/CAmControlSender.cpp
@@ -193,12 +193,24 @@ 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);
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))
diff --git a/AudioManagerCore/test/AmMapHandlerTest/CAmTestDatabaseObserver.cpp b/AudioManagerCore/test/AmMapHandlerTest/CAmTestDatabaseObserver.cpp
index ddf0abb..77b6ecb 100644
--- a/AudioManagerCore/test/AmMapHandlerTest/CAmTestDatabaseObserver.cpp
+++ b/AudioManagerCore/test/AmMapHandlerTest/CAmTestDatabaseObserver.cpp
@@ -64,8 +64,12 @@ CAmDatabaseObserver::CAmDatabaseObserver()
{ MockDatabaseObserver::getMockObserverObject()->mainConnectionStateChanged(connectionID, connectionState); };
dboMainSinkSoundPropertyChanged = [&](const am_sinkID_t sinkID, const am_MainSoundProperty_s& SoundProperty)
{ MockDatabaseObserver::getMockObserverObject()->mainSinkSoundPropertyChanged(sinkID, SoundProperty); };
+ dboMainSinkSoundPropertiesChanged = [&](const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s>& listSoundProperties)
+ { MockDatabaseObserver::getMockObserverObject()->mainSinkSoundPropertiesChanged(sinkID, listSoundProperties); };
dboMainSourceSoundPropertyChanged = [&](const am_sourceID_t sourceID, const am_MainSoundProperty_s& SoundProperty)
{ MockDatabaseObserver::getMockObserverObject()->mainSourceSoundPropertyChanged(sourceID, SoundProperty); };
+ dboMainSourceSoundPropertiesChanged = [&](const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s>& listSoundProperties)
+ { MockDatabaseObserver::getMockObserverObject()->mainSourceSoundPropertiesChanged(sourceID, listSoundProperties); };
dboSinkAvailabilityChanged = [&](const am_sinkID_t sinkID, const am_Availability_s& availability)
{ MockDatabaseObserver::getMockObserverObject()->sinkAvailabilityChanged(sinkID, availability); };
dboSourceAvailabilityChanged = [&](const am_sourceID_t sourceID, const am_Availability_s& availability)
diff --git a/AudioManagerCore/test/AmMapHandlerTest/MockDatabaseObserver.h b/AudioManagerCore/test/AmMapHandlerTest/MockDatabaseObserver.h
index 82e1ea4..894db07 100644
--- a/AudioManagerCore/test/AmMapHandlerTest/MockDatabaseObserver.h
+++ b/AudioManagerCore/test/AmMapHandlerTest/MockDatabaseObserver.h
@@ -61,7 +61,9 @@ public:
virtual void removeCrossfader(const am_crossfaderID_t crossfaderID) = 0;
virtual void mainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState) = 0;
virtual void mainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& SoundProperty) = 0;
+ virtual void mainSinkSoundPropertiesChanged(const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s>& listSoundProperties) = 0;
virtual void mainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& SoundProperty) = 0;
+ virtual void mainSourceSoundPropertiesChanged(const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s>& listSoundProperties) = 0;
virtual void sinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability) = 0;
virtual void sourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability) = 0;
virtual void volumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume) = 0;
@@ -95,7 +97,9 @@ class MockDatabaseObserver : public IAmDatabaseObserver{
MOCK_METHOD1(removeCrossfader, void(const am_crossfaderID_t crossfaderID));
MOCK_METHOD2(mainConnectionStateChanged, void(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState));
MOCK_METHOD2(mainSinkSoundPropertyChanged, void(const am_sinkID_t sinkID, const am_MainSoundProperty_s& SoundProperty));
+ MOCK_METHOD2(mainSinkSoundPropertiesChanged, void(const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s>& listSoundProperties));
MOCK_METHOD2(mainSourceSoundPropertyChanged, void(const am_sourceID_t sourceID, const am_MainSoundProperty_s& SoundProperty));
+ MOCK_METHOD2(mainSourceSoundPropertiesChanged, void(const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s>& listSoundProperties));
MOCK_METHOD2(sinkAvailabilityChanged, void(const am_sinkID_t sinkID, const am_Availability_s& availability));
MOCK_METHOD2(sourceAvailabilityChanged, void(const am_sourceID_t sourceID, const am_Availability_s& availability));
MOCK_METHOD2(volumeChanged, void(const am_sinkID_t sinkID, const am_mainVolume_t volume));
diff --git a/AudioManagerCore/test/MockIAmCommandSend.h b/AudioManagerCore/test/MockIAmCommandSend.h
index 36bc1cb..2310c81 100644
--- a/AudioManagerCore/test/MockIAmCommandSend.h
+++ b/AudioManagerCore/test/MockIAmCommandSend.h
@@ -59,8 +59,12 @@ class MockIAmCommandSend : public IAmCommandSend {
void(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState));
MOCK_METHOD2(cbMainSinkSoundPropertyChanged,
void(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty));
+ MOCK_METHOD2(cbMainSinkSoundPropertiesChanged,
+ void(const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s>& listSoundProperties));
MOCK_METHOD2(cbMainSourceSoundPropertyChanged,
void(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty));
+ MOCK_METHOD2(cbMainSourceSoundPropertiesChanged,
+ void(const am_sourceID_t sourcekID, const std::vector<am_MainSoundProperty_s>& listSoundProperties));
MOCK_METHOD2(cbSinkAvailabilityChanged,
void(const am_sinkID_t sinkID, const am_Availability_s& availability));
MOCK_METHOD2(cbSourceAvailabilityChanged,
diff --git a/AudioManagerCore/test/MockIAmControlSend.h b/AudioManagerCore/test/MockIAmControlSend.h
index 36f12a2..1f0b7df 100644
--- a/AudioManagerCore/test/MockIAmControlSend.h
+++ b/AudioManagerCore/test/MockIAmControlSend.h
@@ -45,8 +45,12 @@ class MockIAmControlSend : public IAmControlSend {
am_Error_e(const am_mainConnectionID_t connectionID));
MOCK_METHOD2(hookUserSetMainSinkSoundProperty,
am_Error_e(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty));
+ MOCK_METHOD2(hookUserSetMainSinkSoundProperties,
+ am_Error_e(const am_sinkID_t sinkID, const std::vector<am_MainSoundProperty_s > &listSoundProperty));
MOCK_METHOD2(hookUserSetMainSourceSoundProperty,
am_Error_e(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty));
+ MOCK_METHOD2(hookUserSetMainSourceSoundProperties,
+ am_Error_e(const am_sourceID_t sourceID, const std::vector<am_MainSoundProperty_s > &listSoundProperty));
MOCK_METHOD1(hookUserSetSystemProperty,
am_Error_e(const am_SystemProperty_s& property));
MOCK_METHOD2(hookUserVolumeChange,
diff --git a/include/IAmCommand.h b/include/IAmCommand.h
index 9d59e8a..4f70389 100644
--- a/include/IAmCommand.h
+++ b/include/IAmCommand.h
@@ -34,7 +34,7 @@ class CAmSocketHandler;
#include "audiomanagertypes.h"
-#define CommandVersion "4.0"
+#define CommandVersion "4.1"
namespace am {
/**
@@ -108,6 +108,12 @@ public:
*/
virtual am_Error_e setMainSinkSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID) =0;
/**
+ * This method is used to set the list of sound properties
+ * @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in
+ * case of an error
+ */
+ virtual am_Error_e setMainSinkSoundProperties(const std::vector<am_MainSoundProperty_s> &/*listSoundProperties*/, const am_sinkID_t /*sinkID*/) { return E_OK; };
+ /**
* This method is used to set sound properties, e.g. Equalizer Values. Since the
* capabilities of the system can differ, the exact key value pairs can be
* extended in each product
@@ -116,6 +122,12 @@ public:
*/
virtual am_Error_e setMainSourceSoundProperty(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID) =0;
/**
+ * This method is used to set the list of sound properties
+ * @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in
+ * case of an error
+ */
+ virtual am_Error_e setMainSourceSoundProperties(const std::vector<am_MainSoundProperty_s> &/*listSoundProperties*/, const am_sourceID_t /*sourceID*/) { return E_OK; };
+ /**
* is used to set a specific system property.
* @return E_OK on success, E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in
* case of an error
@@ -322,10 +334,18 @@ public:
*/
virtual void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) =0;
/**
+ * this callback indicates that sourceSoundProperties have changed.
+ */
+ virtual void cbMainSinkSoundPropertiesChanged(const am_sinkID_t /*sinkID*/, const std::vector<am_MainSoundProperty_s> &/*listSoundProperties*/) { return; };
+ /**
* this callback indicates that a sourceSoundProperty has changed.
*/
virtual void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty) =0;
/**
+ * this callback indicates that sourceSoundProperties have changed.
+ */
+ virtual void cbMainSourceSoundPropertiesChanged(const am_sourceID_t /*sourceID*/, const std::vector<am_MainSoundProperty_s> &/*listSoundProperties*/) { return; };
+ /**
* this callback is called when the availability of a sink has changed
*/
virtual void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability) =0;
diff --git a/include/IAmControl.h b/include/IAmControl.h
index 9bfab6b..872177f 100644
--- a/include/IAmControl.h
+++ b/include/IAmControl.h
@@ -32,7 +32,7 @@ class CAmSocketHandler;
#include "audiomanagertypes.h"
-#define ControlVersion "5.1"
+#define ControlVersion "5.2"
namespace am {
/**
@@ -302,12 +302,24 @@ public:
*/
virtual am_Error_e changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID) =0;
/**
+ * changes the mainsinksoundproperties of a sink
+ * @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if sink was
+ * not found
+ */
+ virtual am_Error_e changeMainSinkSoundPropertiesDB(const std::vector<am_MainSoundProperty_s>& /*listSoundProperties*/, const am_sinkID_t /*sinkID*/) { return E_OK; };
+ /**
* changes the mainsourcesoundproperty of a sink
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if source
* was not found
*/
virtual am_Error_e changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID) =0;
/**
+ * changes the mainsourcesoundproperties of a source
+ * @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if source
+ * was not found
+ */
+ virtual am_Error_e changeMainSourceSoundPropertiesDB(const std::vector<am_MainSoundProperty_s>& /*listSoundProperties*/, const am_sourceID_t /*sourceID*/) { return E_OK; };
+ /**
* changes the availablility of a source
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if source
* was not found
@@ -726,11 +738,21 @@ public:
*/
virtual am_Error_e hookUserSetMainSinkSoundProperty(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) =0;
/**
+ * sets a user MainSinkSoundProperty list
+ * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
+ */
+ virtual am_Error_e hookUserSetMainSinkSoundProperties(const am_sinkID_t /*sinkID*/, const std::vector<am_MainSoundProperty_s > &/*listSoundProperties*/) { return E_OK;};
+ /**
* sets a user MainSourceSoundProperty
* @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
*/
virtual am_Error_e hookUserSetMainSourceSoundProperty(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty) =0;
/**
+ * sets a user MainSourceSoundProperty list
+ * @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
+ */
+ virtual am_Error_e hookUserSetMainSourceSoundProperties(const am_sourceID_t /*sourceID*/, const std::vector<am_MainSoundProperty_s > &/*listSoundProperties*/) { return E_OK; };
+ /**
* sets a user SystemProperty
* @return E_OK on success, E_OUT_OF_RANGE if out of range, E_UNKNOWN on error
*/