diff options
author | Frank Herchet <frank.fh.herchet@bmw.de> | 2012-03-30 10:04:47 +0200 |
---|---|---|
committer | Frank Herchet <frank.fh.herchet@bmw.de> | 2012-03-30 10:04:47 +0200 |
commit | bc7cd53576df7708e777aaeca04b0da64114e6d7 (patch) | |
tree | a39edb5e1f3c1be44b23b53d076fbe06361b4725 | |
parent | a6dff96e2037e9acbf58a6af1ab8df4c74acedbd (diff) | |
download | audiomanager-bc7cd53576df7708e777aaeca04b0da64114e6d7.tar.gz |
* [GAM-51] fix CAmDatabaseHandler::getListSinks (::getListSources) if sink (source) is invisible
-rw-r--r-- | AudioManagerDaemon/src/CAmDatabaseHandler.cpp | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp index efa3535..de6296c 100644 --- a/AudioManagerDaemon/src/CAmDatabaseHandler.cpp +++ b/AudioManagerDaemon/src/CAmDatabaseHandler.cpp @@ -2185,17 +2185,20 @@ am_Error_e CAmDatabaseHandler::getListSinks(std::vector<am_Sink_s> & listSinks) MY_SQLITE_FINALIZE(qSoundProperty) - //read out MainSoundProperties - std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(temp.sinkID); - MY_SQLITE_PREPARE_V2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL) - while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW) + //read out MainSoundProperties if sink is visible + if(temp.visible) { - tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0); - tempMainSoundProperty.value = sqlite3_column_int(qMAinSoundProperty, 1); - temp.listMainSoundProperties.push_back(tempMainSoundProperty); - } + std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(temp.sinkID); + MY_SQLITE_PREPARE_V2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL) + while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW) + { + tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0); + tempMainSoundProperty.value = sqlite3_column_int(qMAinSoundProperty, 1); + temp.listMainSoundProperties.push_back(tempMainSoundProperty); + } - MY_SQLITE_FINALIZE(qMAinSoundProperty) + MY_SQLITE_FINALIZE(qMAinSoundProperty) + } listSinks.push_back(temp); temp.listConnectionFormats.clear(); @@ -2263,17 +2266,21 @@ am_Error_e CAmDatabaseHandler::getListSources(std::vector<am_Source_s> & listSou MY_SQLITE_FINALIZE(qSoundProperty) - //read out MainSoundProperties - std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(temp.sourceID); - MY_SQLITE_PREPARE_V2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL) - while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW) + //read out MainSoundProperties if source is visible + if(temp.visible) { - tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0); - tempMainSoundProperty.value = sqlite3_column_int(qMAinSoundProperty, 1); - temp.listMainSoundProperties.push_back(tempMainSoundProperty); + std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(temp.sourceID); + MY_SQLITE_PREPARE_V2(mpDatabase, commandMainSoundProperty.c_str(), -1, &qMAinSoundProperty, NULL) + while ((eCode = sqlite3_step(qMAinSoundProperty)) == SQLITE_ROW) + { + tempMainSoundProperty.type = (am_MainSoundPropertyType_e) sqlite3_column_int(qMAinSoundProperty, 0); + tempMainSoundProperty.value = sqlite3_column_int(qMAinSoundProperty, 1); + temp.listMainSoundProperties.push_back(tempMainSoundProperty); + } + + MY_SQLITE_FINALIZE(qMAinSoundProperty) } - MY_SQLITE_FINALIZE(qMAinSoundProperty) listSources.push_back(temp); temp.listConnectionFormats.clear(); |