From bc7cd53576df7708e777aaeca04b0da64114e6d7 Mon Sep 17 00:00:00 2001 From: Frank Herchet Date: Fri, 30 Mar 2012 10:04:47 +0200 Subject: * [GAM-51] fix CAmDatabaseHandler::getListSinks (::getListSources) if sink (source) is invisible --- AudioManagerDaemon/src/CAmDatabaseHandler.cpp | 41 ++++++++++++++++----------- 1 file 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 & 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 & 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(); -- cgit v1.2.1