.
authorChristian Mueller <christian@lmuc329619u.(none)>
Tue, 13 Dec 2011 15:30:24 +0000 (16:30 +0100)
committerChristian Mueller <christian@lmuc329619u.(none)>
Tue, 13 Dec 2011 15:30:24 +0000 (16:30 +0100)
13 files changed:
AudioManagerDaemon/include/ControlSender.h
AudioManagerDaemon/include/DatabaseHandler.h
AudioManagerDaemon/include/RoutingSender.h
AudioManagerDaemon/src/ControlSender.cpp
AudioManagerDaemon/src/DatabaseHandler.cpp
AudioManagerDaemon/src/RoutingReceiver.cpp
AudioManagerDaemon/src/RoutingSender.cpp
AudioManagerDaemon/test/controlInterface/MockInterfaces.h [moved from AudioManagerDaemon/test/controlInterface/MockControlInterface.h with 71% similarity]
AudioManagerDaemon/test/controlInterface/controlInterfaceTest.cpp
AudioManagerDaemon/test/controlInterface/controlInterfaceTest.h
AudioManagerDaemon/test/database/databaseTest.cpp
AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h
dbusIncludes/CommandInterface.xml

index 0a490d4..ac917be 100644 (file)
@@ -55,7 +55,7 @@ public:
        void cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID) ;
        void cbAckCrossFade(const am_Handle_s handle, const am_HotSink_e hostsink, const am_Error_e error) ;
        void cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
-       void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error) ;
+       void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
        void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error) ;
        void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
        void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
index 38c20dd..057b7a8 100644 (file)
@@ -53,6 +53,8 @@ public:
        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 changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s& soundProperty, 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) ;
        am_Error_e changeSystemPropertyDB(const am_SystemProperty_s& property) ;
        am_Error_e changeDelayMainConnection(const am_timeSync_t & delay, const am_mainConnectionID_t & connectionID) ;
@@ -61,6 +63,9 @@ public:
        am_Error_e changeConnectionTimingInformation(const am_connectionID_t connectionID, const am_timeSync_t delay) ;
        am_Error_e changeConnectionFinal(const am_connectionID_t connectionID) ;
        am_Error_e changeSourceState(const am_sourceID_t sourceID, const am_SourceState_e sourceState);
+       am_Error_e changeSinkVolume(const am_sinkID_t sinkID, const am_volume_t volume);
+       am_Error_e changeSourceVolume(const am_sourceID_t sourceID, const am_volume_t volume);
+       am_Error_e changeCrossFaderHotSink(const am_crossfaderID_t crossfaderID,const am_HotSink_e hotsink);
        am_Error_e removeMainConnectionDB(const am_mainConnectionID_t mainConnectionID) ;
        am_Error_e removeSinkDB(const am_sinkID_t sinkID) ;
        am_Error_e removeSourceDB(const am_sourceID_t sourceID) ;
index bb3cc53..a931940 100644 (file)
@@ -96,21 +96,45 @@ public:
                std::string busName;
        };
 
+       //todo: maybe this would be valuable information for the controller...
+       class am_handleData_c
+       {
+       public:
+               union
+               {
+                       am_sinkID_t sinkID;
+                       am_sourceID_t sourceID;
+                       am_crossfaderID_t crossfaderID;
+                       am_connectionID_t connectionID;
+               };
+               union
+               {
+                       am_SoundProperty_s soundPropery;
+                       am_SourceState_e sourceState;
+                       am_volume_t volume;
+                       am_HotSink_e hotSink;
+               };
+
+       };
+
+
 #ifdef UNIT_TEST //this is needed to test RoutingSender
        friend class RoutingInterfaceBackdoor;
 #endif
+
+am_handleData_c returnHandleData(am_Handle_s handle);
+
 private:
-       struct compareHandles
+
+       struct comparator
        {
                bool operator()(const am_Handle_s& a, const am_Handle_s& b) const
                {
-                       {
-                               return (a.handle < b.handle);
-                       }
+                       return (a.handle < b.handle);
                }
        };
 
-       am_Handle_s createHandle(const am_Handle_e handle);
+       am_Handle_s createHandle(const am_handleData_c& handleData, const am_Handle_e type);
        void unloadLibraries(void);
 
     typedef std::map<am_domainID_t, RoutingSendInterface*> DomainInterfaceMap;
@@ -119,9 +143,9 @@ private:
     typedef std::map<am_crossfaderID_t, RoutingSendInterface*> CrossfaderInterfaceMap;
     typedef std::map<am_connectionID_t, RoutingSendInterface*> ConnectionInterfaceMap;
     typedef std::map<uint16_t, RoutingSendInterface*> HandleInterfaceMap;
+    typedef std::map<am_Handle_s,am_handleData_c,comparator> HandlesMap;
 
     int16_t mHandleCount;
-    std::set<am_Handle_s,compareHandles> mlistActiveHandles;
        std::vector<InterfaceNamePairs> mListInterfaces;
        std::vector<void*> mListLibraryHandles;
     ConnectionInterfaceMap mMapConnectionInterface;
@@ -130,6 +154,7 @@ private:
     SinkInterfaceMap mMapSinkInterface;
     SourceInterfaceMap mMapSourceInterface;
     HandleInterfaceMap mMapHandleInterface;
+    HandlesMap mlistActiveHandles;
 };
 
 #endif /* ROUTINGSENDER_H_ */
index 7f015e1..de2e3b7 100644 (file)
@@ -259,9 +259,9 @@ void ControlSender::cbAckSetSinkVolumeChange(const am_Handle_s handle, const am_
 
 
 
-void ControlSender::cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error)
+void ControlSender::cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
 {
-       return mController->cbAckSetSourceVolumeChange(handle,voulme,error);
+       return mController->cbAckSetSourceVolumeChange(handle,volume,error);
 }
 
 
index 5bfcd37..28fa8db 100644 (file)
@@ -3322,7 +3322,7 @@ am_Error_e DatabaseHandler::changeSourceState(const am_sourceID_t sourceID, cons
 {
        assert(sourceID!=0);
        sqlite3_stmt* query=NULL;
-       std::string command = "UPDATE " + std::string(SOURCE_TABLE) +" setsourceState=? WHERE sourceID="+ i2s(sourceID);
+       std::string command = "UPDATE " + std::string(SOURCE_TABLE) +" SET sourceState=? WHERE sourceID="+ i2s(sourceID);
        int eCode=0;
        sqlite3_prepare_v2(mDatabase,command.c_str(),-1,&query,NULL);
        sqlite3_bind_int(query,1,sourceState);
@@ -3599,6 +3599,165 @@ am_Error_e DatabaseHandler::peekSource(const std::string & name, am_sourceID_t &
        return E_OK;
 }
 
+am_Error_e DatabaseHandler::changeSinkVolume(const am_sinkID_t sinkID, const am_volume_t volume)
+{
+       assert(sinkID!=0);
+
+       sqlite3_stmt* query=NULL;
+       int eCode=0;
+       std::string command;
+
+       if (!existSink(sinkID))
+       {
+               return E_NON_EXISTENT;
+       }
+       command = "UPDATE " + std::string(SINK_TABLE) + " SET volume=? WHERE sinkID=" + i2s(sinkID);
+       sqlite3_prepare_v2(mDatabase,command.c_str(),-1,&query,NULL);
+       sqlite3_bind_int(query,1, volume);
+       if((eCode=sqlite3_step(query))!=SQLITE_DONE)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkVolume SQLITE Step error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+       if((eCode=sqlite3_finalize(query))!=SQLITE_OK)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkVolume SQLITE Finalize error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+
+       DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSinkVolume changed volume of sink:"),DLT_INT(sinkID),DLT_STRING("to:"),DLT_INT(volume));
+
+       return E_OK;
+}
+
+am_Error_e DatabaseHandler::changeSourceVolume(const am_sourceID_t sourceID, const am_volume_t volume)
+{
+       assert(sourceID!=0);
+
+       sqlite3_stmt* query=NULL;
+       int eCode=0;
+       std::string command;
+
+       if (!existSource(sourceID))
+       {
+               return E_NON_EXISTENT;
+       }
+       command = "UPDATE " + std::string(SOURCE_TABLE) + " SET volume=? WHERE sourceID=" + i2s(sourceID);
+       sqlite3_prepare_v2(mDatabase,command.c_str(),-1,&query,NULL);
+       sqlite3_bind_int(query,1, volume);
+       if((eCode=sqlite3_step(query))!=SQLITE_DONE)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceVolume SQLITE Step error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+       if((eCode=sqlite3_finalize(query))!=SQLITE_OK)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceVolume SQLITE Finalize error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+
+       DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSourceVolume changed volume of source=:"),DLT_INT(sourceID),DLT_STRING("to:"),DLT_INT(volume));
+
+       return E_OK;
+}
+
+am_Error_e DatabaseHandler::changeSourceSoundPropertyDB(const am_SoundProperty_s & soundProperty, const am_sourceID_t sourceID)
+{
+       //todo: add checks if soundproperty exists!
+       assert(sourceID!=0);
+
+       sqlite3_stmt* query=NULL;
+       int eCode=0;
+       std::string command;
+
+       if (!existSource(sourceID))
+       {
+               return E_NON_EXISTENT;
+       }
+       command = "UPDATE SourceSoundProperty" + i2s(sourceID)+ " SET value=? WHERE soundPropertyType=" + i2s(soundProperty.type);
+       sqlite3_prepare_v2(mDatabase,command.c_str(),-1,&query,NULL);
+       sqlite3_bind_int(query,1, soundProperty.value);
+       if((eCode=sqlite3_step(query))!=SQLITE_DONE)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceSoundPropertyDB SQLITE Step error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+
+       if((eCode=sqlite3_finalize(query))!=SQLITE_OK)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSourceSoundPropertyDB SQLITE Finalize error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+
+       DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSourceSoundPropertyDB changed SourceSoundProperty of source:"),DLT_INT(sourceID),DLT_STRING("type:"),DLT_INT(soundProperty.type),DLT_STRING("to:"),DLT_INT(soundProperty.value));
+
+       return E_OK;
+}
+
+am_Error_e DatabaseHandler::changeSinkSoundPropertyDB(const am_SoundProperty_s & soundProperty, const am_sinkID_t sinkID)
+{
+       //todo: add checks if soundproperty exists!
+       assert(sinkID!=0);
+
+       sqlite3_stmt* query=NULL;
+       int eCode=0;
+       std::string command;
+
+       if (!existSink(sinkID))
+       {
+               return E_NON_EXISTENT;
+       }
+       command = "UPDATE SinkSoundProperty" + i2s(sinkID)+ " SET value=? WHERE soundPropertyType=" + i2s(soundProperty.type);
+       sqlite3_prepare_v2(mDatabase,command.c_str(),-1,&query,NULL);
+       sqlite3_bind_int(query,1, soundProperty.value);
+       if((eCode=sqlite3_step(query))!=SQLITE_DONE)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkSoundPropertyDB SQLITE Step error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }       assert(sinkID!=0);
+
+       if((eCode=sqlite3_finalize(query))!=SQLITE_OK)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeSinkSoundPropertyDB SQLITE Finalize error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+
+       DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeSinkSoundPropertyDB changed MainSinkSoundProperty of sink:"),DLT_INT(sinkID),DLT_STRING("type:"),DLT_INT(soundProperty.type),DLT_STRING("to:"),DLT_INT(soundProperty.value));
+
+       return E_OK;
+}
+
+am_Error_e DatabaseHandler::changeCrossFaderHotSink(const am_crossfaderID_t crossfaderID, const am_HotSink_e hotsink)
+{
+       assert(crossfaderID!=0);
+
+       sqlite3_stmt* query=NULL;
+       int eCode=0;
+       std::string command;
+
+       if (!existcrossFader(crossfaderID))
+       {
+               return E_NON_EXISTENT;
+       }
+       command = "UPDATE " + std::string(CROSSFADER_TABLE) + " SET hotsink=? WHERE crossfaderID=" + i2s(crossfaderID);
+       sqlite3_prepare_v2(mDatabase,command.c_str(),-1,&query,NULL);
+       sqlite3_bind_int(query,1, hotsink);
+       if((eCode=sqlite3_step(query))!=SQLITE_DONE)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeCrossFaderHotSink SQLITE Step error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+       if((eCode=sqlite3_finalize(query))!=SQLITE_OK)
+       {
+               DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("DatabaseHandler::changeCrossFaderHotSink SQLITE Finalize error code:"),DLT_INT(eCode));
+               return E_DATABASE_ERROR;
+       }
+
+       DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("DatabaseHandler::changeCrossFaderHotSink changed hotsink of crossfader="),DLT_INT(crossfaderID),DLT_STRING("to:"),DLT_INT(hotsink));
+
+       return E_OK;
+}
+
 void DatabaseHandler::createTables()
 {
        for(uint16_t i=0;i<sizeof(databaseTables)/sizeof(databaseTables[0]);i++)
index 9940c6e..b3ccf86 100644 (file)
@@ -39,7 +39,7 @@ void RoutingReceiver::ackConnect(const am_Handle_s handle, const am_connectionID
        {
                mDatabaseHandler->removeConnection(connectionID);
        }
-       return mControlSender->cbAckConnect(handle,error);
+       mControlSender->cbAckConnect(handle,error);
 }
 
 
@@ -51,56 +51,106 @@ void RoutingReceiver::ackDisconnect(const am_Handle_s handle, const am_connectio
        {
                mDatabaseHandler->removeConnection(connectionID);
        }
-       return mControlSender->cbAckConnect(handle,error);
+       mControlSender->cbAckDisconnect(handle,error);
 }
 
 
 
 void RoutingReceiver::ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
 {
-
+       RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
+       if(error==E_OK && handleData.sinkID!=0)
+       {
+               //todo: check if volume in handleData is same than volume. React to it.
+               mDatabaseHandler->changeSinkVolume(handleData.sinkID,volume);
+       }
+       mRoutingSender->removeHandle(handle);
+       mControlSender->cbAckSetSinkVolumeChange(handle,volume,error);
 }
 
 
 
 void RoutingReceiver::ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error)
 {
+       RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
+       if(error==E_OK && handleData.sourceID!=0)
+       {
+               //todo: check if volume in handleData is same than volume. React to it.
+               mDatabaseHandler->changeSourceVolume(handleData.sourceID,volume);
+       }
+       mRoutingSender->removeHandle(handle);
+       mControlSender->cbAckSetSourceVolumeChange(handle,volume,error);
 }
 
 
 
 void RoutingReceiver::ackSetSourceState(const am_Handle_s handle, const am_Error_e error)
 {
+       RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
+       if(error==E_OK && handleData.sourceID!=0)
+       {
+               //todo: check if volume in handleData is same than volume. React to it.
+               mDatabaseHandler->changeSourceState(handleData.sourceID,handleData.sourceState);
+       }
+       mRoutingSender->removeHandle(handle);
+       mControlSender->cbAckSetSourceState(handle,error);
 }
 
 
 
 void RoutingReceiver::ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error)
 {
+       RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
+       if(error==E_OK && handleData.sinkID!=0)
+       {
+               //todo: check if volume in handleData is same than volume. React to it.
+               mDatabaseHandler->changeSinkSoundPropertyDB(handleData.soundPropery,handleData.sinkID);
+       }
+       mRoutingSender->removeHandle(handle);
+       mControlSender->cbAckSetSinkSoundProperty(handle,error);
+
 }
 
 
 
 void RoutingReceiver::ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
 {
+       RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
+       if(error==E_OK && handleData.sourceID!=0)
+       {
+               //todo: check if volume in handleData is same than volume. React to it.
+               mDatabaseHandler->changeSourceSoundPropertyDB(handleData.soundPropery,handleData.sourceID);
+       }
+       mRoutingSender->removeHandle(handle);
+       mControlSender->cbAckSetSourceSoundProperty(handle,error);
 }
 
 
 
 void RoutingReceiver::ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error)
 {
+       RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
+       if(error==E_OK && handleData.crossfaderID!=0)
+       {
+               //todo: check if volume in handleData is same than volume. React to it.
+               mDatabaseHandler->changeCrossFaderHotSink(handleData.crossfaderID,hotSink);
+       }
+       mRoutingSender->removeHandle(handle);
+       mControlSender->cbAckCrossFade(handle,hotSink,error);
 }
 
 
 
 void RoutingReceiver::ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume)
 {
+       mControlSender->hookSystemSourceVolumeTick(handle,sourceID,volume);
 }
 
 
 
 void RoutingReceiver::ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume)
 {
+       mControlSender->hookSystemSinkVolumeTick(handle,sinkID,volume);
 }
 
 
index d54a986..70aa69f 100644 (file)
@@ -142,11 +142,13 @@ am_Error_e RoutingSender::asyncAbort(const am_Handle_s& handle)
 
 am_Error_e RoutingSender::asyncConnect(am_Handle_s& handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat)
 {
+       am_handleData_c handleData;
        SinkInterfaceMap::iterator iter = mMapSinkInterface.begin();
        iter=mMapSinkInterface.find(sinkID);
     if (iter != mMapSinkInterface.end())
     {
-       handle=createHandle(H_CONNECT);
+       handleData.connectionID=connectionID;
+       handle=createHandle(handleData,H_CONNECT);
        mMapConnectionInterface.insert(std::make_pair(connectionID,iter->second));
        mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
        return iter->second->asyncConnect(handle,connectionID,sourceID,sinkID,connectionFormat);
@@ -159,11 +161,13 @@ am_Error_e RoutingSender::asyncConnect(am_Handle_s& handle, const am_connectionI
 
 am_Error_e RoutingSender::asyncDisconnect(am_Handle_s& handle, const am_connectionID_t connectionID)
 {
+       am_handleData_c handleData;
        ConnectionInterfaceMap::iterator iter = mMapConnectionInterface.begin();
        mMapConnectionInterface.find(connectionID);
     if (iter != mMapConnectionInterface.end())
     {
-       handle=createHandle(H_DISCONNECT);
+       handleData.connectionID=connectionID;
+       handle=createHandle(handleData,H_DISCONNECT);
        mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
        am_Error_e returnVal=iter->second->asyncDisconnect(handle,connectionID);
        mMapConnectionInterface.erase(iter);
@@ -177,10 +181,13 @@ am_Error_e RoutingSender::asyncDisconnect(am_Handle_s& handle, const am_connecti
 
 am_Error_e RoutingSender::asyncSetSinkVolume(am_Handle_s& handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
 {
+       am_handleData_c handleData;
        SinkInterfaceMap::iterator iter = mMapSinkInterface.begin();
        iter=mMapSinkInterface.find(sinkID);
     if (iter != mMapSinkInterface.end())
-       handle=createHandle(H_SETSINKVOLUME);
+       handleData.sinkID=sinkID;
+       handleData.volume=volume;
+       handle=createHandle(handleData,H_SETSINKVOLUME);
                mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
        return iter->second->asyncSetSinkVolume(handle,sinkID,volume,ramp,time);
     return E_NON_EXISTENT;
@@ -190,10 +197,13 @@ am_Error_e RoutingSender::asyncSetSinkVolume(am_Handle_s& handle, const am_sinkI
 
 am_Error_e RoutingSender::asyncSetSourceVolume(am_Handle_s& handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
 {
+       am_handleData_c handleData;
        SourceInterfaceMap::iterator iter = mMapSourceInterface.begin();
        iter=mMapSourceInterface.find(sourceID);
     if (iter != mMapSourceInterface.end())
-       handle=createHandle(H_SETSOURCEVOLUME);
+       handleData.sourceID=sourceID;
+       handleData.volume=volume;
+       handle=createHandle(handleData,H_SETSOURCEVOLUME);
                mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
        return iter->second->asyncSetSourceVolume(handle,sourceID,volume,ramp,time);
     return E_NON_EXISTENT;
@@ -203,10 +213,13 @@ am_Error_e RoutingSender::asyncSetSourceVolume(am_Handle_s& handle, const am_sou
 
 am_Error_e RoutingSender::asyncSetSourceState(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SourceState_e state)
 {
+       am_handleData_c handleData;
        SourceInterfaceMap::iterator iter = mMapSourceInterface.begin();
        iter=mMapSourceInterface.find(sourceID);
     if (iter != mMapSourceInterface.end())
-       handle=createHandle(H_SETSOURCESTATE);
+       handleData.sourceID=sourceID;
+       handleData.sourceState=state;
+       handle=createHandle(handleData,H_SETSOURCESTATE);
                mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
        return iter->second->asyncSetSourceState(handle,sourceID,state);
     return E_NON_EXISTENT;
@@ -216,10 +229,13 @@ am_Error_e RoutingSender::asyncSetSourceState(am_Handle_s& handle, const am_sour
 
 am_Error_e RoutingSender::asyncSetSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
 {
+       am_handleData_c handleData;
        SinkInterfaceMap::iterator iter = mMapSinkInterface.begin();
        iter=mMapSinkInterface.find(sinkID);
     if (iter != mMapSinkInterface.end())
-       handle=createHandle(H_SETSINKSOUNDPROPERTY);
+       handleData.sinkID=sinkID;
+       handleData.soundPropery=soundProperty;
+       handle=createHandle(handleData,H_SETSINKSOUNDPROPERTY);
                mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
        return iter->second->asyncSetSinkSoundProperty(handle,soundProperty,sinkID);
     return E_NON_EXISTENT;
@@ -229,10 +245,13 @@ am_Error_e RoutingSender::asyncSetSinkSoundProperty(am_Handle_s& handle, const a
 
 am_Error_e RoutingSender::asyncSetSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
 {
+       am_handleData_c handleData;
        SourceInterfaceMap::iterator iter = mMapSourceInterface.begin();
        iter=mMapSourceInterface.find(sourceID);
     if (iter != mMapSourceInterface.end())
-       handle=createHandle(H_SETSOURCESOUNDPROPERTY);
+       handleData.sourceID=sourceID;
+       handleData.soundPropery=soundProperty;
+       handle=createHandle(handleData,H_SETSOURCESOUNDPROPERTY);
                mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
        return iter->second->asyncSetSourceSoundProperty(handle,soundProperty,sourceID);
     return E_NON_EXISTENT;
@@ -242,10 +261,13 @@ am_Error_e RoutingSender::asyncSetSourceSoundProperty(am_Handle_s& handle, const
 
 am_Error_e RoutingSender::asyncCrossFade(am_Handle_s& handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time)
 {
+       am_handleData_c handleData;
        CrossfaderInterfaceMap::iterator iter = mMapCrossfaderInterface.begin();
        iter=mMapCrossfaderInterface.find(crossfaderID);
     if (iter != mMapCrossfaderInterface.end())
-       handle=createHandle(H_CROSSFADE);
+       handleData.crossfaderID=crossfaderID;
+       handleData.hotSink=hotSink;
+       handle=createHandle(handleData,H_CROSSFADE);
                mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
        return iter->second->asyncCrossFade(handle,crossfaderID,hotSink,rampType,time);
     return E_NON_EXISTENT;
@@ -390,17 +412,29 @@ am_Error_e RoutingSender::removeHandle(const am_Handle_s& handle)
 
 am_Error_e RoutingSender::getListHandles(std::vector<am_Handle_s> & listHandles) const
 {
-       std::copy(mlistActiveHandles.begin(),mlistActiveHandles.end(),std::back_inserter(listHandles));
+       listHandles.clear();
+       HandlesMap::const_iterator it=mlistActiveHandles.begin();
+       for(;it!=mlistActiveHandles.end();++it)
+       {
+               listHandles.push_back(it->first);
+       }
        return E_OK;
 }
 
-am_Handle_s RoutingSender::createHandle(const am_Handle_e handle)
+am_Handle_s RoutingSender::createHandle(const am_handleData_c& handleData, const am_Handle_e type)
+{
+       am_Handle_s handle;
+       handle.handle=++mHandleCount; //todo: handle overflows here...
+       handle.handleType=type;
+       mlistActiveHandles.insert(std::make_pair(handle,handleData));
+       return handle;
+}
+
+RoutingSender::am_handleData_c RoutingSender::returnHandleData(am_Handle_s handle)
 {
-       am_Handle_s newHandle;
-       newHandle.handle=++mHandleCount; //todo: handle overflows here...
-       newHandle.handleType=handle;
-       mlistActiveHandles.insert(newHandle);
-       return newHandle;
+       HandlesMap::iterator it=mlistActiveHandles.begin();
+       it=mlistActiveHandles.find(handle);
+       return (it->second);
 }
 
 void RoutingSender::unloadLibraries(void)
@@ -9,11 +9,45 @@
 #define MOCKROUTINGINTERFACE_H_
 
 #include <control/ControlSendInterface.h>
+#include <routing/RoutingSendInterface.h>
 #include <gtest/gtest.h>
 #include <gmock/gmock.h>
 
 namespace am {
 
+class MockRoutingSendInterface : public RoutingSendInterface {
+ public:
+  MOCK_METHOD1(startupRoutingInterface,
+         void(RoutingReceiveInterface* routingreceiveinterface));
+  MOCK_METHOD0(routingInterfacesReady,
+         void());
+  MOCK_METHOD0(routingInterfacesRundown,
+         void());
+  MOCK_METHOD1(asyncAbort,
+         am_Error_e(const am_Handle_s handle));
+  MOCK_METHOD5(asyncConnect,
+         am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat));
+  MOCK_METHOD2(asyncDisconnect,
+         am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID));
+  MOCK_METHOD5(asyncSetSinkVolume,
+         am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
+  MOCK_METHOD5(asyncSetSourceVolume,
+         am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
+  MOCK_METHOD3(asyncSetSourceState,
+         am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
+  MOCK_METHOD3(asyncSetSinkSoundProperty,
+         am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+  MOCK_METHOD3(asyncSetSourceSoundProperty,
+         am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
+  MOCK_METHOD5(asyncCrossFade,
+         am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
+  MOCK_METHOD2(setDomainState,
+         am_Error_e(const am_domainID_t domainID, const am_DomainState_e domainState));
+  MOCK_CONST_METHOD1(returnBusName,
+         am_Error_e(std::string& BusName));
+};
+
+
 class MockControlSendInterface : public ControlSendInterface {
  public:
   MOCK_METHOD1(startupController,
index 1a8c48b..8c57cfd 100644 (file)
@@ -7,30 +7,14 @@
 
 #include "controlInterfaceTest.h"
 
-using namespace am;
-
-using ::testing::Field;
-using ::testing::Property;
-using ::testing::Matcher;
-using ::testing::Pointee;
-using ::testing::AllOf;
-using ::testing::SafeMatcherCast;
-using ::testing::MatcherCast;
-using ::testing::DefaultValue;
-using ::testing::Eq;
-using ::testing::An;
-using ::testing::ElementsAreArray;
-using ::testing::ElementsAre;
-using ::testing::NotNull;
-using ::testing::Assign;
-using ::testing::SetArgReferee;
-using ::testing::DoAll;
+
 
 controlInterfaceTest::controlInterfaceTest()
        :pDatabaseHandler(),
         pRoutingSender(),
         pCommandSender(),
-        pMockInterface(),
+        pMockControlInterface(),
+        pMockRoutingInterface(),
         pControlSender(),
         pRoutingInterfaceBackdoor(),
         pCommandInterfaceBackdoor(),
@@ -42,7 +26,8 @@ controlInterfaceTest::controlInterfaceTest()
        pDatabaseHandler.registerObserver(&pObserver);
        pRoutingInterfaceBackdoor.unloadPlugins(&pRoutingSender);
        pCommandInterfaceBackdoor.unloadPlugins(&pCommandSender);
-       pControlInterfaceBackdoor.replaceController(&pControlSender,&pMockInterface);
+       pControlInterfaceBackdoor.replaceController(&pControlSender,&pMockControlInterface);
+       pRoutingInterfaceBackdoor.injectInterface(&pRoutingSender,&pMockRoutingInterface,"mock");
 
 }
 
@@ -69,8 +54,169 @@ TEST_F(controlInterfaceTest,registerDomain)
        am_Domain_s domain;
        am_domainID_t domainID;
        pCF.createDomain(domain);
-       EXPECT_CALL(pMockInterface,hookSystemRegisterDomain(_,_)).WillRepeatedly(DoAll(SetArgReferee<1>(2),Return(E_OK)));
+       EXPECT_CALL(pMockControlInterface,hookSystemRegisterDomain(_,_)).WillRepeatedly(DoAll(SetArgReferee<1>(2),Return(E_OK)));
        ASSERT_EQ(E_OK,pRoutingReceiver.registerDomain(domain,domainID));
+       ASSERT_EQ(domainID,2);
+}
+
+TEST_F(controlInterfaceTest,deregisterDomain)
+{
+       am_domainID_t domainID=34;
+       EXPECT_CALL(pMockControlInterface,hookSystemDeregisterDomain(34)).WillRepeatedly(Return(E_OK));
+       ASSERT_EQ(E_OK,pRoutingReceiver.deregisterDomain(domainID));
+}
+
+TEST_F(controlInterfaceTest,registerSink)
+{
+       am_Sink_s sink;
+       am_sinkID_t sinkID;
+       pCF.createSink(sink);
+       EXPECT_CALL(pMockControlInterface,hookSystemRegisterSink(_,_)).WillRepeatedly(DoAll(SetArgReferee<1>(2),Return(E_OK)));
+       ASSERT_EQ(E_OK,pRoutingReceiver.registerSink(sink,sinkID));
+       ASSERT_EQ(sinkID,2);
+}
+
+TEST_F(controlInterfaceTest,deregisterSink)
+{
+       am_sinkID_t sinkID=12;
+       EXPECT_CALL(pMockControlInterface,hookSystemDeregisterSink(12)).WillRepeatedly(Return(E_OK));
+       ASSERT_EQ(E_OK,pRoutingReceiver.deregisterSink(sinkID));
+}
+
+TEST_F(controlInterfaceTest,registerSource)
+{
+       am_Source_s source;
+       am_sourceID_t sourceID;
+       pCF.createSource(source);
+       EXPECT_CALL(pMockControlInterface,hookSystemRegisterSource(_,_)).WillRepeatedly(DoAll(SetArgReferee<1>(2),Return(E_OK)));
+       ASSERT_EQ(E_OK,pRoutingReceiver.registerSource(source,sourceID));
+       ASSERT_EQ(sourceID,2);
+}
+
+TEST_F(controlInterfaceTest,deregisterSource)
+{
+       am_sourceID_t sourceID=12;
+       EXPECT_CALL(pMockControlInterface,hookSystemDeregisterSource(12)).WillRepeatedly(Return(E_OK));
+       ASSERT_EQ(E_OK,pRoutingReceiver.deregisterSource(sourceID));
+}
+
+TEST_F(controlInterfaceTest,registerGateway)
+{
+       am_Gateway_s gateway;
+       am_gatewayID_t gatewayID;
+       pCF.createGateway(gateway);
+       EXPECT_CALL(pMockControlInterface,hookSystemRegisterGateway(_,_)).WillRepeatedly(DoAll(SetArgReferee<1>(2),Return(E_OK)));
+       ASSERT_EQ(E_OK,pRoutingReceiver.registerGateway(gateway,gatewayID));
+       ASSERT_EQ(gatewayID,2);
+}
+
+TEST_F(controlInterfaceTest,deregisterGateway)
+{
+       am_gatewayID_t gatewayID=12;
+       EXPECT_CALL(pMockControlInterface,hookSystemDeregisterGateway(12)).WillRepeatedly(Return(E_OK));
+       ASSERT_EQ(E_OK,pRoutingReceiver.deregisterGateway(gatewayID));
+}
+
+
+TEST_F(controlInterfaceTest,ackConnect)
+{
+       am_Connection_s connection;
+       am_connectionID_t connectionID;
+       am_Sink_s sink;
+       am_sinkID_t sinkID;
+       am_Domain_s domain;
+       am_domainID_t domainID;
+       std::vector<am_Connection_s> connectionList;
+       std::vector<am_Handle_s> handlesList;
+       am_Handle_s handle;
+       pCF.createSink(sink);
+       pCF.createDomain(domain);
+       domain.name="mock";
+       domain.busname="mock";
+       sink.sinkID=2;
+       sink.domainID=1;
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterDomainDB(domain,domainID));
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(sink,sinkID));
+       EXPECT_CALL(pMockRoutingInterface,asyncConnect(_,1,2,2,CF_STEREO)).WillOnce(Return(E_OK));
+       ASSERT_EQ(E_OK,pControlReceiver.connect(handle,connectionID,CF_STEREO,2,2));
+       ASSERT_EQ(handle.handleType,H_CONNECT);
+       ASSERT_EQ(handle.handle,1);
+       ASSERT_EQ(connectionID,1);
+       ASSERT_EQ(E_OK,pControlReceiver.getListHandles(handlesList));
+       ASSERT_EQ(handlesList[0].handle,handle.handle);
+       ASSERT_EQ(handlesList[0].handleType,handle.handleType);
+       ASSERT_EQ(E_OK,pDatabaseHandler.getListConnections(connectionList));
+       ASSERT_TRUE(connectionList.empty()); //ok, because Ack did not come
+       EXPECT_CALL(pMockControlInterface,cbAckConnect(_,E_OK)).Times(1);
+       pRoutingReceiver.ackConnect(handle,connectionID,E_OK);
+       ASSERT_EQ(E_OK,pControlReceiver.getListHandles(handlesList));
+       ASSERT_TRUE(handlesList.empty());
+       ASSERT_EQ(E_OK,pDatabaseHandler.getListConnections(connectionList));
+       ASSERT_TRUE(!connectionList.empty()); //ok, because Ack did not come
+
+}
+
+TEST_F(controlInterfaceTest,ackDisconnect)
+{
+       am_Connection_s connection;
+       am_connectionID_t connectionID;
+       am_Sink_s sink;
+       am_sinkID_t sinkID;
+       am_Domain_s domain;
+       am_domainID_t domainID;
+       std::vector<am_Connection_s> connectionList;
+       std::vector<am_Handle_s> handlesList;
+       am_Handle_s handle;
+       pCF.createSink(sink);
+       pCF.createDomain(domain);
+       domain.name="mock";
+       domain.busname="mock";
+       sink.sinkID=2;
+       sink.domainID=1;
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterDomainDB(domain,domainID));
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(sink,sinkID));
+       EXPECT_CALL(pMockRoutingInterface,asyncConnect(_,1,2,2,CF_STEREO)).WillOnce(Return(E_OK));
+       ASSERT_EQ(E_OK,pControlReceiver.connect(handle,connectionID,CF_STEREO,2,2));
+       EXPECT_CALL(pMockControlInterface,cbAckConnect(_,E_OK)).Times(1);
+       pRoutingReceiver.ackConnect(handle,connectionID,E_OK);
+       EXPECT_CALL(pMockRoutingInterface,asyncDisconnect(_,1)).WillOnce(Return(E_OK));
+       ASSERT_EQ(E_OK,pControlReceiver.disconnect(handle,1));
+       EXPECT_CALL(pMockControlInterface,cbAckDisconnect(_,E_OK)).Times(1);
+       pRoutingReceiver.ackDisconnect(handle,connectionID,E_OK);
+       ASSERT_EQ(E_OK,pControlReceiver.getListHandles(handlesList));
+       ASSERT_TRUE(handlesList.empty());
+       ASSERT_EQ(E_OK,pDatabaseHandler.getListConnections(connectionList));
+       ASSERT_TRUE(connectionList.empty()); //ok, because Ack did not come
+}
+
+TEST_F(controlInterfaceTest,setSourceState)
+{
+
+       am_Source_s source;
+       am_sourceID_t sourceID;
+       am_Domain_s domain;
+       am_domainID_t domainID;
+       std::vector<am_Handle_s> handlesList;
+       am_Handle_s handle;
+       am_SourceState_e state;
+       pCF.createSource(source);
+       pCF.createDomain(domain);
+       domain.name="mock";
+       domain.busname="mock";
+       source.sourceID=2;
+       source.domainID=1;
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterDomainDB(domain,domainID));
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(source,sourceID));
+       EXPECT_CALL(pMockRoutingInterface,asyncSetSourceState(_,2,SS_PAUSED));
+       ASSERT_EQ(E_OK,pControlReceiver.setSourceState(handle,source.sourceID,SS_PAUSED));
+       ASSERT_EQ(E_OK,pControlReceiver.getListHandles(handlesList));
+       ASSERT_EQ(handlesList[0].handle,handle.handle);
+       ASSERT_EQ(handlesList[0].handleType,handle.handleType);
+       ASSERT_EQ(E_OK,pDatabaseHandler.getSoureState(source.sourceID,state));
+       ASSERT_EQ(state,SS_PAUSED);
+       EXPECT_CALL(pMockControlInterface,cbAckSetSourceState(_,E_OK)).Times(1);
+       //pRoutingReceiver.ackSetSourceState(handle,SS_PAUSED);
+
 }
 
 
index 2b73af6..d85c1f0 100644 (file)
 #include <string>
 #include <vector>
 #include <set>
-#include "MockControlInterface.h"
+#include "MockInterfaces.h"
 #include "DatabaseHandler.h"
 #include "ControlReceiver.h"
-#include "ControlSender.h"
-#include "Observer.h"
 #include "RoutingReceiver.h"
+#include "Observer.h"
+#include "ControlSender.h"
+#include "RoutingSender.h"
 #include "../RoutingInterfaceBackdoor.h"
 #include "../CommandInterfaceBackdoor.h"
+#include "../ControlInterfaceBackdoor.h"
 #include "../CommonFunctions.h"
 
 DLT_DECLARE_CONTEXT(AudioManager)
@@ -30,6 +32,25 @@ DLT_DECLARE_CONTEXT(AudioManager)
 using namespace testing;
 using namespace am;
 
+using ::testing::Field;
+using ::testing::Property;
+using ::testing::Matcher;
+using ::testing::Pointee;
+using ::testing::AllOf;
+using ::testing::SafeMatcherCast;
+using ::testing::MatcherCast;
+using ::testing::DefaultValue;
+using ::testing::Eq;
+using ::testing::An;
+using ::testing::ElementsAreArray;
+using ::testing::ElementsAre;
+using ::testing::NotNull;
+using ::testing::Assign;
+using ::testing::SetArgReferee;
+using ::testing::DoAll;
+using ::testing::MatcherInterface;
+using ::testing::MatchResultListener;
+
 class controlInterfaceTest : public Test{
 public:
        controlInterfaceTest();
@@ -37,7 +58,8 @@ public:
        DatabaseHandler pDatabaseHandler;
        RoutingSender pRoutingSender;
        CommandSender pCommandSender;
-       MockControlSendInterface pMockInterface;
+       MockRoutingSendInterface pMockRoutingInterface;
+       MockControlSendInterface pMockControlInterface;
        ControlSender pControlSender;
        RoutingInterfaceBackdoor pRoutingInterfaceBackdoor;
        CommandInterfaceBackdoor pCommandInterfaceBackdoor;
index 75fb389..6f269e9 100644 (file)
@@ -120,6 +120,50 @@ void databaseTest::TearDown()
        DLT_UNREGISTER_CONTEXT(AudioManager);
 }
 
+TEST_F(databaseTest,crossfaders)
+{
+       //todo:implement crossfader tests
+}
+
+TEST_F(databaseTest,sourceState)
+{
+       am_Source_s source;
+       am_sourceID_t sourceID;
+       std::vector<am_Source_s> listSources;
+       pCF.createSource(source);
+       source.sourceState=SS_OFF;
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(source,sourceID));
+       ASSERT_EQ(E_OK,pDatabaseHandler.changeSourceState(sourceID,SS_ON));
+       ASSERT_EQ(E_OK,pDatabaseHandler.getListSources(listSources));
+       ASSERT_EQ(listSources[0].sourceState,SS_ON);
+}
+
+TEST_F(databaseTest,sinkVolumeChange)
+{
+       am_Sink_s sink;
+       am_sinkID_t sinkID;
+       std::vector<am_Sink_s> listSinks;
+       pCF.createSink(sink);
+       sink.volume=23;
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(sink,sinkID));
+       ASSERT_EQ(E_OK,pDatabaseHandler.changeSinkVolume(sinkID,34));
+       ASSERT_EQ(E_OK,pDatabaseHandler.getListSinks(listSinks));
+       ASSERT_EQ(listSinks[0].volume,34);
+}
+
+TEST_F(databaseTest,sourceVolumeChange)
+{
+       am_Source_s source;
+       am_sourceID_t sourceID;
+       std::vector<am_Source_s> listSources;
+       pCF.createSource(source);
+       source.volume=23;
+       ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(source,sourceID));
+       ASSERT_EQ(E_OK,pDatabaseHandler.changeSourceVolume(sourceID,34));
+       ASSERT_EQ(E_OK,pDatabaseHandler.getListSources(listSources));
+       ASSERT_EQ(listSources[0].volume,34);
+}
+
 TEST_F(databaseTest, peekSource)
 {
        std::vector<am_Source_s> listSources;
index bd25156..0f29a5a 100644 (file)
 
 namespace am {
 
-class MockRoutingSendInterface : public RoutingSendInterface {
+       class MockRoutingSendInterface : public RoutingSendInterface {
         public:
          MOCK_METHOD1(startupRoutingInterface,
-             void(RoutingReceiveInterface* routingreceiveinterface));
+                 void(RoutingReceiveInterface* routingreceiveinterface));
          MOCK_METHOD0(routingInterfacesReady,
-             void());
+                 void());
          MOCK_METHOD0(routingInterfacesRundown,
-             void());
+                 void());
          MOCK_METHOD1(asyncAbort,
-             am_Error_e(const am_Handle_s handle));
+                 am_Error_e(const am_Handle_s handle));
          MOCK_METHOD5(asyncConnect,
-             am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat));
+                 am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat));
          MOCK_METHOD2(asyncDisconnect,
-             am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID));
+                 am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID));
          MOCK_METHOD5(asyncSetSinkVolume,
-             am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
+                 am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
          MOCK_METHOD5(asyncSetSourceVolume,
-             am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
+                 am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
          MOCK_METHOD3(asyncSetSourceState,
-             am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
+                 am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
          MOCK_METHOD3(asyncSetSinkSoundProperty,
-             am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+                 am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
          MOCK_METHOD3(asyncSetSourceSoundProperty,
-             am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
+                 am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
          MOCK_METHOD5(asyncCrossFade,
-             am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
+                 am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
          MOCK_METHOD2(setDomainState,
-             am_Error_e(const am_domainID_t domainID, const am_DomainState_e domainState));
+                 am_Error_e(const am_domainID_t domainID, const am_DomainState_e domainState));
          MOCK_CONST_METHOD1(returnBusName,
-             am_Error_e(std::string& BusName));
+                 am_Error_e(std::string& BusName));
        };
 
 }  // namespace am
index 9af50da..849bd76 100644 (file)
@@ -55,7 +55,7 @@
 \r
         <method name="GetListMainConnections">\r
             <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->\r
-            <arg type="a(nnnqq)" name="listConnections" direction="out"/> <!-- am_mainConnectionID_t mainConnectionID; am_sourceID_t sourceID; am_sinkID_t sinkID; am_timeSync_t delay; am_ConnectionState_e connectionState; -->\r
+            <arg type="a(qqqnn)" name="listConnections" direction="out"/> <!-- am_mainConnectionID_t mainConnectionID; am_sourceID_t sourceID; am_sinkID_t sinkID; am_timeSync_t delay; am_ConnectionState_e connectionState; -->\r
         </method>\r
 \r
         <method name="GetListMainSinks">\r