summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AudioManagerDaemon/include/CAmDatabaseHandlerMap.h1
-rw-r--r--AudioManagerDaemon/include/CAmRoutingReceiver.h5
-rw-r--r--AudioManagerDaemon/include/IAmDatabaseHandler.h1
-rw-r--r--AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp16
-rw-r--r--AudioManagerDaemon/src/CAmRoutingReceiver.cpp13
-rw-r--r--AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp72
-rw-r--r--AudioManagerDaemon/test/CMakeLists.txt3
-rwxr-xr-xCMakeLists.txt6
-rw-r--r--googleMock/CMakeLists.txt3
-rw-r--r--include/IAmRouting.h8
10 files changed, 45 insertions, 83 deletions
diff --git a/AudioManagerDaemon/include/CAmDatabaseHandlerMap.h b/AudioManagerDaemon/include/CAmDatabaseHandlerMap.h
index 6569b20..bd2df16 100644
--- a/AudioManagerDaemon/include/CAmDatabaseHandlerMap.h
+++ b/AudioManagerDaemon/include/CAmDatabaseHandlerMap.h
@@ -159,6 +159,7 @@ public:
am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const;
am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const;
am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const;
+ am_Error_e getDomainOfCrossfader(const am_converterID_t crossfader, am_domainID_t& domainID) const;
am_Error_e getSoureState(const am_sourceID_t sourceID, am_SourceState_e& sourceState) const;
am_Error_e getDomainState(const am_domainID_t domainID, am_DomainState_e& state) const;
am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID);
diff --git a/AudioManagerDaemon/include/CAmRoutingReceiver.h b/AudioManagerDaemon/include/CAmRoutingReceiver.h
index 5b2da4f..82626c6 100644
--- a/AudioManagerDaemon/include/CAmRoutingReceiver.h
+++ b/AudioManagerDaemon/include/CAmRoutingReceiver.h
@@ -94,8 +94,9 @@ public:
void ackSourceNotificationConfiguration(const am_Handle_s handle, const am_Error_e error) ;
void hookSinkNotificationDataChange(const am_sinkID_t sinkID, const am_NotificationPayload_s& payload) ;
void hookSourceNotificationDataChange(const am_sourceID_t sourceID, const am_NotificationPayload_s& payload) ;
- am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID);
- am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID);
+ am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const;
+ am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const;
+ am_Error_e getDomainOfCrossfader(const am_crossfaderID_t crossfader, am_domainID_t& domainID) const;
uint16_t getStartupHandle(); //!< returns a startup handle
uint16_t getRundownHandle(); //!< returns a rundown handle
diff --git a/AudioManagerDaemon/include/IAmDatabaseHandler.h b/AudioManagerDaemon/include/IAmDatabaseHandler.h
index 2ed7e85..d1e5e03 100644
--- a/AudioManagerDaemon/include/IAmDatabaseHandler.h
+++ b/AudioManagerDaemon/include/IAmDatabaseHandler.h
@@ -146,6 +146,7 @@ public:
virtual am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const = 0;
virtual am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const = 0;
virtual am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const = 0;
+ virtual am_Error_e getDomainOfCrossfader(const am_crossfaderID_t crossfader, am_domainID_t& domainID) const = 0;
virtual am_Error_e getSoureState(const am_sourceID_t sourceID, am_SourceState_e& sourceState) const = 0;
virtual am_Error_e getDomainState(const am_domainID_t domainID, am_DomainState_e& state) const = 0;
virtual am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID) = 0;
diff --git a/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp b/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
index 46163db..1af6361 100644
--- a/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
+++ b/AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp
@@ -2120,6 +2120,7 @@ bool CAmDatabaseHandlerMap::existConverter(const am_converterID_t converterID) c
am_Error_e CAmDatabaseHandlerMap::getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t & domainID) const
{
assert(sourceID!=0);
+ domainID=0;
am_Source_Database_s const * source = objectForKeyIfExistsInMap(sourceID, mMappedData.mSourceMap);
if( NULL!=source )
@@ -2133,6 +2134,7 @@ am_Error_e CAmDatabaseHandlerMap::getDomainOfSource(const am_sourceID_t sourceID
am_Error_e am::CAmDatabaseHandlerMap::getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t & domainID) const
{
assert(sinkID!=0);
+ domainID=0;
am_Sink_Database_s const * source = objectForKeyIfExistsInMap(sinkID, mMappedData.mSinkMap);
if( NULL!=source )
@@ -2143,6 +2145,20 @@ am_Error_e am::CAmDatabaseHandlerMap::getDomainOfSink(const am_sinkID_t sinkID,
return E_NON_EXISTENT;
}
+am_Error_e am::CAmDatabaseHandlerMap::getDomainOfCrossfader(const am_converterID_t crossfader, am_domainID_t & domainID) const
+{
+ assert(crossfader!=0);
+ domainID=0;
+
+ am_Crossfader_Database_s const * cross = objectForKeyIfExistsInMap(crossfader, mMappedData.mCrossfaderMap);
+ if( NULL!=cross )
+ {
+ getDomainOfSource(cross->sinkID_A,domainID);
+ return E_OK;
+ }
+ return E_NON_EXISTENT;
+}
+
/**
* checks for certain SinkClass
* @param sinkClassID
diff --git a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
index 0216b9e..4628136 100644
--- a/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
+++ b/AudioManagerDaemon/src/CAmRoutingReceiver.cpp
@@ -482,14 +482,19 @@ void CAmRoutingReceiver::hookSourceNotificationDataChange(const am_sourceID_t so
mpControlSender->hookSourceNotificationDataChanged(sourceID,payload);
}
-am_Error_e CAmRoutingReceiver::getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID)
+am_Error_e CAmRoutingReceiver::getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const
{
- return mpDatabaseHandler->getDomainOfSink(sinkID,domainID);
+ return (mpDatabaseHandler->getDomainOfSink(sinkID,domainID));
}
-am_Error_e CAmRoutingReceiver::getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID)
+am_Error_e CAmRoutingReceiver::getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const
{
- return mpDatabaseHandler->getDomainOfSource(sourceID,domainID);
+ return (mpDatabaseHandler->getDomainOfSource(sourceID,domainID));
+}
+
+am_Error_e CAmRoutingReceiver::getDomainOfCrossfader(const am_crossfaderID_t crossfader, am_domainID_t& domainID) const
+{
+ return (mpDatabaseHandler->getDomainOfCrossfader(crossfader,domainID));
}
void CAmRoutingReceiver::waitOnRundown(bool rundown)
diff --git a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
index a557564..347b65a 100644
--- a/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/AmRoutingInterfaceTest/CAmRoutingInterfaceTest.cpp
@@ -238,31 +238,7 @@ TEST_F(CAmRoutingInterfaceTest,setSinkSoundProperty)
ASSERT_TRUE(listHandles[0].handleType==handle.handleType);
}
-TEST_F(CAmRoutingInterfaceTest,setSourceVolumeNoChange)
-{
- am_Source_s source;
- am_sourceID_t sourceID;
- am_Domain_s domain;
- am_domainID_t domainID;
- am_Handle_s handle;
- am_volume_t volume = 34;
- am_CustomRampType_t rampType = RAMP_GENIVI_DIRECT;
- am_time_t rampTime = 300;
- std::vector<am_Handle_s> listHandles;
- pCF.createSource(source);
- pCF.createDomain(domain);
- domain.name = "mock";
- domain.busname = "mock";
- source.sourceID = 2;
- source.domainID = DYNAMIC_ID_BOUNDARY;
- source.volume = volume;
- ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
- ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
- //EXPECT_CALL(pMockInterface,asyncSetSourceVolume(_,2,volume,rampType,rampTime)).Times(1).WillOnce(Return(E_NO_CHANGE));
- //ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSourceVolume(handle,2,volume,rampType,rampTime));
- ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
- ASSERT_TRUE(listHandles.empty());
-}
+
TEST_F(CAmRoutingInterfaceTest,setSourceVolume)
{
@@ -292,32 +268,6 @@ TEST_F(CAmRoutingInterfaceTest,setSourceVolume)
ASSERT_TRUE(listHandles[0].handleType==handle.handleType);
}
-TEST_F(CAmRoutingInterfaceTest,setSinkVolumeNoChange)
-{
- am_Sink_s sink;
- am_sinkID_t sinkID;
- am_Domain_s domain;
- am_domainID_t domainID;
- am_Handle_s handle;
- am_volume_t volume = 34;
- am_CustomRampType_t rampType = RAMP_GENIVI_DIRECT;
- am_time_t rampTime = 300;
- std::vector<am_Handle_s> listHandles;
- pCF.createSink(sink);
- pCF.createDomain(domain);
- domain.name = "mock";
- domain.busname = "mock";
- sink.sinkID = 2;
- sink.domainID = DYNAMIC_ID_BOUNDARY;
- sink.volume = volume;
- ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
- ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
- //EXPECT_CALL(pMockInterface,asyncSetSinkVolume(_,2,volume,rampType,rampTime)).Times(0);
- //ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSinkVolume(handle,2,volume,rampType,rampTime));
- ASSERT_EQ(E_OK, pControlReceiver.getListHandles(listHandles));
- ASSERT_TRUE(listHandles.empty());
-}
-
TEST_F(CAmRoutingInterfaceTest,setSinkVolume)
{
am_Sink_s sink;
@@ -412,26 +362,6 @@ TEST_F(CAmRoutingInterfaceTest,nothingTodisconnect)
ASSERT_TRUE(listHandles.empty());
}
-TEST_F(CAmRoutingInterfaceTest,setSourceStateNoChange)
-{
- am_Source_s source;
- am_sourceID_t sourceID;
- am_Domain_s domain;
- am_domainID_t domainID;
- am_Handle_s handle;
- handle.handle = 0;
- am_SourceState_e state = SS_PAUSED;
- pCF.createSource(source);
- pCF.createDomain(domain);
- domain.name = "mock";
- domain.busname = "mock";
- source.domainID = DYNAMIC_ID_BOUNDARY;
- source.sourceState = state;
- ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
- ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
- EXPECT_CALL(pMockInterface,asyncSetSourceState(_,sourceID,state)).Times(0);
- //ASSERT_EQ(E_NO_CHANGE, pControlReceiver.setSourceState(handle,sourceID,state));
-}
int main(int argc, char **argv)
{
diff --git a/AudioManagerDaemon/test/CMakeLists.txt b/AudioManagerDaemon/test/CMakeLists.txt
index 149b221..5460897 100644
--- a/AudioManagerDaemon/test/CMakeLists.txt
+++ b/AudioManagerDaemon/test/CMakeLists.txt
@@ -25,6 +25,9 @@ if(USE_BUILD_LIBS)
execute_process(COMMAND mkdir -p "${EXECUTABLE_OUTPUT_PATH}")
endif(USE_BUILD_LIBS)
+#make aunt google stop complaining
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
+
add_subdirectory (AmControlInterfaceTest)
add_subdirectory (AmDatabaseHandlerTest)
add_subdirectory (AmMapHandlerTest)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b7f3159..d4e3cb5 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -222,9 +222,9 @@ if(WITH_TESTS)
endif(WITH_TESTS)
##global build flags set(CPACK_RPM_COMPONENT_INSTALL ON)
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -D_GNU_SOURCE -pedantic -rdynamic -Wno-variadic-macros")
-set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -std=gnu++0x -D_GNU_SOURCE -pedantic -rdynamic -Wno-long-long -Wno-unused-parameter")
-set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O2 -fno-common -rdynamic -std=gnu++0x -fno-strict-aliasing -DNDEBUG")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -pedantic -rdynamic -Wno-variadic-macros")
+set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -DDEBUG")
+set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O2 -DNDEBUG")
configure_package_config_file (
${CMAKE_SOURCE_DIR}/cmake/audiomanagerConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/audiomanagerConfig.cmake
diff --git a/googleMock/CMakeLists.txt b/googleMock/CMakeLists.txt
index fdd747c..3b29c48 100644
--- a/googleMock/CMakeLists.txt
+++ b/googleMock/CMakeLists.txt
@@ -8,7 +8,8 @@
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
# make it prominent in the GUI.
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -D_GNU_SOURCE -Wno-variadic-macros")
+#make aunt google stop complaining
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
diff --git a/include/IAmRouting.h b/include/IAmRouting.h
index 90f7e8a..14f1146 100644
--- a/include/IAmRouting.h
+++ b/include/IAmRouting.h
@@ -328,11 +328,15 @@ public:
/**
* E_OK in case of success
*/
- virtual am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) =0;
+ virtual am_Error_e getDomainOfSink(const am_sinkID_t sinkID, am_domainID_t& domainID) const =0;
/**
* E_OK in case of success
*/
- virtual am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) =0;
+ virtual am_Error_e getDomainOfSource(const am_sourceID_t sourceID, am_domainID_t& domainID) const =0;
+ /**
+ * E_OK in case of success
+ */
+ virtual am_Error_e getDomainOfCrossfader(const am_crossfaderID_t crossfader, am_domainID_t& domainID) const = 0;
};