doc/
packages/
.*
+CHANGELOG
+includes/config.h
am_Error_e enterSinkClassDB(const am_SinkClass_s & sinkClass, am_sinkClass_t & sinkClassID);
am_Error_e enterSourceClassDB(am_sourceClass_t & sourceClassID, const am_SourceClass_s & sourceClass);
am_Error_e enterSystemPropertiesListDB(const std::vector<am_SystemProperty_s>& listSystemProperties);
- am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route);
+ am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID);
am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState);
am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID);
am_Error_e changeSinkAvailabilityDB(const am_Availability_s& availability, const am_sinkID_t sinkID);
am_Error_e removeSourceClassDB(const am_sourceClass_t sourceClassID);
am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s& classInfo) const;
am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const;
+ am_Error_e getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s& sinkData) const;
+ am_Error_e getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s& sourceData) const;
am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s& gatewayData) const;
am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) const;
+ am_Error_e getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData) const;
am_Error_e getListSinksOfDomain(const am_domainID_t domainID, std::vector<am_sinkID_t>& listSinkID) const;
am_Error_e getListSourcesOfDomain(const am_domainID_t domainID, std::vector<am_sourceID_t>& listSourceID) const;
am_Error_e getListCrossfadersOfDomain(const am_domainID_t domainID, std::vector<am_crossfaderID_t>& listGatewaysID) const;
am_Error_e enterSinkClassDB(const am_SinkClass_s& sinkClass, am_sinkClass_t& sinkClassID);
am_Error_e enterSourceClassDB(am_sourceClass_t& sourceClassID, const am_SourceClass_s& sourceClass);
am_Error_e enterSystemProperties(const std::vector<am_SystemProperty_s>& listSystemProperties);
- am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route);
+ am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID);
am_Error_e changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState);
am_Error_e changeSinkMainVolumeDB(const am_mainVolume_t mainVolume, const am_sinkID_t sinkID);
am_Error_e changeSinkAvailabilityDB(const am_Availability_s& availability, const am_sinkID_t sinkID);
am_Error_e getSourceClassInfoDB(const am_sourceID_t sourceID, am_SourceClass_s& classInfo) const;
am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const;
am_Error_e getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s& gatewayData) const;
+ am_Error_e getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s& sinkData) const;
+ am_Error_e getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s& sourceData) const;
am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) const;
+ am_Error_e getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData) const;
am_Error_e getSinkVolume(const am_sinkID_t sinkID, am_volume_t& volume) const;
am_Error_e getSourceVolume(const am_sourceID_t sourceID, am_volume_t& volume) const;
am_Error_e getSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_SoundPropertyType_e propertyType, uint16_t& value) const;
#define REQUIRED_INTERFACE_VERSION 1
-DLT_IMPORT_CONTEXT(AudioManager)
-
//!< macro to call all interfaces
#define CALL_ALL_INTERFACES(...) \
std::vector<CommandSendInterface*>::iterator iter = mListInterfaces.begin(); \
am_Error_e ControlReceiver::getRoute(const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector<am_Route_s> & returnList)
{
- mRouter->getRoute(onlyfree, sourceID, sinkID, returnList);
- return E_NOT_USED;
+ return mRouter->getRoute(onlyfree, sourceID, sinkID, returnList);
}
am_Error_e ControlReceiver::connect(am_Handle_s & handle, am_connectionID_t & connectionID, const am_ConnectionFormat_e format, const am_sourceID_t sourceID, const am_sinkID_t sinkID)
am_Error_e ControlReceiver::crossfade(am_Handle_s & handle, const am_HotSink_e hotSource, const am_crossfaderID_t crossfaderID, const am_RampType_e rampType, const am_time_t rampTime)
{
- logInfo("ControlReceiver::crossfade got called, hotSource=",hotSource,"crossfaderID=",crossfaderID,"rampType=",rampType,"rampTime=",rampTime);
+ logInfo("ControlReceiver::crossfade got called, hotSource=", hotSource, "crossfaderID=", crossfaderID, "rampType=", rampType, "rampTime=", rampTime);
if (!mDatabaseHandler->existcrossFader(crossfaderID))
return E_NON_EXISTENT;
am_Error_e ControlReceiver::setSourceState(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SourceState_e state)
{
- logInfo("ControlReceiver::setSourceState got called, sourceID=",sourceID,"state=",state);
+ logInfo("ControlReceiver::setSourceState got called, sourceID=", sourceID, "state=", state);
am_SourceState_e sourceState;
if (mDatabaseHandler->getSoureState(sourceID, sourceState) != E_OK)
am_Error_e ControlReceiver::setSinkVolume(am_Handle_s & handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time)
{
- logInfo("ControlReceiver::setSinkVolume got called, sinkID=",sinkID,"volume=",volume,"ramp=",ramp, "time=",time);
+ logInfo("ControlReceiver::setSinkVolume got called, sinkID=", sinkID, "volume=", volume, "ramp=", ramp, "time=", time);
am_volume_t tempVolume;
if (mDatabaseHandler->getSinkVolume(sinkID, tempVolume) != E_OK)
am_Error_e ControlReceiver::setSourceVolume(am_Handle_s & handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e rampType, const am_time_t time)
{
- logInfo("ControlReceiver::setSourceVolume got called, sourceID=",sourceID,"volume=",volume,"ramp=",rampType,"time=",time);
+ logInfo("ControlReceiver::setSourceVolume got called, sourceID=", sourceID, "volume=", volume, "ramp=", rampType, "time=", time);
am_volume_t tempVolume;
if (mDatabaseHandler->getSourceVolume(sourceID, tempVolume) != E_OK)
am_Error_e ControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const am_sinkID_t sinkID, const am_SoundProperty_s & soundProperty)
{
- logInfo("ControlReceiver::setSinkSoundProperty got called, sinkID=",sinkID,"soundProperty.Type=",soundProperty.type,"soundProperty.value=",soundProperty.value);
+ logInfo("ControlReceiver::setSinkSoundProperty got called, sinkID=", sinkID, "soundProperty.Type=", soundProperty.type, "soundProperty.value=", soundProperty.value);
uint16_t value;
if (mDatabaseHandler->getSinkSoundPropertyValue(sinkID, soundProperty.type, value) != E_OK)
am_Error_e ControlReceiver::setSinkSoundProperties(am_Handle_s & handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
{
- logInfo("ControlReceiver::setSinkSoundProperties got called, sinkID=",sinkID);
+ logInfo("ControlReceiver::setSinkSoundProperties got called, sinkID=", sinkID);
uint16_t value;
bool noChange = true;
am_Error_e ControlReceiver::setSourceSoundProperty(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
{
- logInfo("ControlReceiver::setSourceSoundProperty got called, sourceID=",sourceID,"soundProperty.Type=",soundProperty.type,"soundProperty.value=",soundProperty.value);
+ logInfo("ControlReceiver::setSourceSoundProperty got called, sourceID=", sourceID, "soundProperty.Type=", soundProperty.type, "soundProperty.value=", soundProperty.value);
uint16_t value;
if (mDatabaseHandler->getSourceSoundPropertyValue(sourceID, soundProperty.type, value) != E_OK)
am_Error_e ControlReceiver::setSourceSoundProperties(am_Handle_s & handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
{
- logInfo("ControlReceiver::setSourceSoundProperties got called, sourceID=",sourceID);
+ logInfo("ControlReceiver::setSourceSoundProperties got called, sourceID=", sourceID);
uint16_t value;
bool noChange = true;
am_Error_e ControlReceiver::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
{
- logInfo("ControlReceiver::setDomainState got called, domainID=",domainID,"domainState=",domainState);
+ logInfo("ControlReceiver::setDomainState got called, domainID=", domainID, "domainState=", domainState);
am_DomainState_e tempState = DS_MIN;
if (mDatabaseHandler->getDomainState(domainID, tempState) != E_OK)
am_Error_e ControlReceiver::abortAction(const am_Handle_s handle)
{
- logInfo("ControlReceiver::abortAction got called, handle.type=",handle.handle,"handle.handleType=",handle.handleType);
+ logInfo("ControlReceiver::abortAction got called, handle.type=", handle.handle, "handle.handleType=", handle.handleType);
return mRoutingSender->asyncAbort(handle);
}
return mDatabaseHandler->enterSystemProperties(listSystemProperties);
}
-am_Error_e ControlReceiver::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s & route)
+am_Error_e ControlReceiver::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID)
{
- return mDatabaseHandler->changeMainConnectionRouteDB(mainconnectionID, route);
+ return mDatabaseHandler->changeMainConnectionRouteDB(mainconnectionID, listConnectionID);
}
am_Error_e ControlReceiver::changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState)
return mDatabaseHandler->getSinkClassInfoDB(sinkID, sinkClass);
}
+am_Error_e ControlReceiver::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s & sinkData) const
+{
+ return mDatabaseHandler->getSinkInfoDB(sinkID, sinkData);
+}
+
+am_Error_e ControlReceiver::getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s & sourceData) const
+{
+ return mDatabaseHandler->getSourceInfoDB(sourceID, sourceData);
+}
+
+am_Error_e ControlReceiver::getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s & mainConnectionData) const
+{
+ return mDatabaseHandler->getMainConnectionInfoDB(mainConnectionID, mainConnectionData);
+}
+
am_Error_e ControlReceiver::getGatewayInfoDB(const am_gatewayID_t gatewayID, am_Gateway_s & gatewayData) const
{
return mDatabaseHandler->getGatewayInfoDB(gatewayID, gatewayData);
am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & mainConnectionData, am_mainConnectionID_t & connectionID)
{
- assert(mainConnectionData.connectionID==0);
+ assert(mainConnectionData.mainConnectionID==0);
assert(mainConnectionData.connectionState>=CS_MIN && mainConnectionData.connectionState<=CS_MAX);
- assert(mainConnectionData.route.sinkID!=0);
- assert(mainConnectionData.route.sourceID!=0);
+ assert(mainConnectionData.sinkID!=0);
+ assert(mainConnectionData.sourceID!=0);
sqlite3_stmt* query = NULL;
int eCode = 0;
+ int16_t delay = 0;
std::string command = "INSERT INTO " + std::string(MAINCONNECTION_TABLE) + "(sourceID, sinkID, connectionState, delay) VALUES (?,?,?,-1)";
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- sqlite3_bind_int(query, 1, mainConnectionData.route.sourceID);
- sqlite3_bind_int(query, 2, mainConnectionData.route.sinkID);
+ sqlite3_bind_int(query, 1, mainConnectionData.sourceID);
+ sqlite3_bind_int(query, 2, mainConnectionData.sinkID);
sqlite3_bind_int(query, 3, mainConnectionData.connectionState);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
connectionID = sqlite3_last_insert_rowid(mDatabase);
- //now check the connectionTable for all connections in the route. IF a particular route is not found, we return with error
- std::vector<uint16_t> listOfConnections;
- int16_t delay = 0;
- command = "SELECT connectionID, delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE sourceID=? AND sinkID=? AND connectionFormat=?");
+ //now check the connectionTable for all connections in the route. IF connectionID exist
+ command = "SELECT delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE connectionID=?");
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<am_RoutingElement_s>::const_iterator elementIterator = mainConnectionData.route.route.begin();
- for (; elementIterator < mainConnectionData.route.route.end(); ++elementIterator)
+ std::vector<am_connectionID_t>::const_iterator elementIterator = mainConnectionData.listConnectionID.begin();
+ for (; elementIterator < mainConnectionData.listConnectionID.end(); ++elementIterator)
{
- sqlite3_bind_int(query, 1, elementIterator->sourceID);
- sqlite3_bind_int(query, 2, elementIterator->sinkID);
- sqlite3_bind_int(query, 3, elementIterator->connectionFormat);
+ sqlite3_bind_int(query, 1, *elementIterator);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
- listOfConnections.push_back(sqlite3_column_int(query, 0));
int16_t temp_delay = sqlite3_column_int(query, 1);
if (temp_delay != -1 && delay != -1)
delay += temp_delay;
else
{
logError("DatabaseHandler::enterMainConnectionDB did not find route for MainConnection:", eCode);
-
return E_DATABASE_ERROR;
}
sqlite3_reset(query);
command = "INSERT INTO MainConnectionRoute" + i2s(connectionID) + "(connectionID) VALUES (?)";
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<uint16_t>::iterator listConnectionIterator = listOfConnections.begin();
- for (; listConnectionIterator < listOfConnections.end(); ++listConnectionIterator)
+ std::vector<am_connectionID_t>::const_iterator listConnectionIterator(mainConnectionData.listConnectionID.begin());
+ for (; listConnectionIterator < mainConnectionData.listConnectionID.end(); ++listConnectionIterator)
{
sqlite3_bind_int(query, 1, *listConnectionIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
return E_DATABASE_ERROR;
}
- logInfo("DatabaseHandler::enterMainConnectionDB entered new mainConnection with sourceID", mainConnectionData.route.sourceID, "sinkID:", mainConnectionData.route.sinkID, "delay:", delay, "assigned ID:", connectionID);
+ logInfo("DatabaseHandler::enterMainConnectionDB entered new mainConnection with sourceID", mainConnectionData.sourceID, "sinkID:", mainConnectionData.sinkID, "delay:", delay, "assigned ID:", connectionID);
if (mDatabaseObserver)
{
return E_OK;
}
-am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s & route)
+am_Error_e DatabaseHandler::changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID)
{
assert(mainconnectionID!=0);
if (!existMainConnection(mainconnectionID))
int eCode = 0;
std::string command;
- std::vector<uint16_t> listOfConnections;
int16_t delay = 0;
- command = "SELECT connectionID, delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE sourceID=? AND sinkID=? AND connectionFormat=?");
+ command = "SELECT delay FROM " + std::string(CONNECTION_TABLE) + (" WHERE connectionID=?");
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<am_RoutingElement_s>::const_iterator elementIterator = route.route.begin();
- for (; elementIterator < route.route.end(); ++elementIterator)
+ std::vector<am_connectionID_t>::const_iterator elementIterator = listConnectionID.begin();
+ for (; elementIterator < listConnectionID.end(); ++elementIterator)
{
- sqlite3_bind_int(query, 1, elementIterator->sourceID);
- sqlite3_bind_int(query, 2, elementIterator->sinkID);
- sqlite3_bind_int(query, 3, elementIterator->connectionFormat);
+ sqlite3_bind_int(query, 1, *elementIterator);
if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
- listOfConnections.push_back(sqlite3_column_int(query, 0));
int16_t temp_delay = sqlite3_column_int(query, 1);
if (temp_delay != -1 && delay != -1)
delay += temp_delay;
command = "INSERT INTO MainConnectionRoute" + i2s(mainconnectionID) + "(connectionID) VALUES (?)";
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<uint16_t>::iterator listConnectionIterator = listOfConnections.begin();
- for (; listConnectionIterator < listOfConnections.end(); ++listConnectionIterator)
+ std::vector<am_connectionID_t>::const_iterator listConnectionIterator(listConnectionID.begin());
+ for (; listConnectionIterator != listConnectionID.end(); ++listConnectionIterator)
{
sqlite3_bind_int(query, 1, *listConnectionIterator);
if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
return E_OK;
}
+am_Error_e DatabaseHandler::getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s & sinkData) const
+{
+
+ assert(sinkID!=0);
+
+ if (!existSink(sinkID))
+ {
+ return E_NON_EXISTENT;
+ }
+
+ sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
+ int eCode = 0;
+ am_ConnectionFormat_e tempConnectionFormat;
+ am_SoundProperty_s tempSoundProperty;
+ am_MainSoundProperty_s tempMainSoundProperty;
+ std::string command = "SELECT name, domainID, sinkClassID, volume, visible, availability, availabilityReason, muteState, mainVolume, sinkID FROM " + std::string(SINK_TABLE) + " WHERE reserved=0 and sinkID=" + i2s(sinkID);
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+
+ if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
+ {
+ sinkData.name = std::string((const char*) sqlite3_column_text(query, 0));
+ sinkData.domainID = sqlite3_column_int(query, 1);
+ sinkData.sinkClassID = sqlite3_column_int(query, 2);
+ sinkData.volume = sqlite3_column_int(query, 3);
+ sinkData.visible = sqlite3_column_int(query, 4);
+ sinkData.available.availability = (am_Availablility_e) sqlite3_column_int(query, 5);
+ sinkData.available.availabilityReason = (am_AvailabilityReason_e) sqlite3_column_int(query, 6);
+ sinkData.muteState = (am_MuteState_e) sqlite3_column_int(query, 7);
+ sinkData.mainVolume = sqlite3_column_int(query, 8);
+ sinkData.sinkID = sqlite3_column_int(query, 9);
+
+ //read out the connectionFormats
+ std::string commandConnectionFormat = "SELECT soundFormat FROM SinkConnectionFormat" + i2s(sinkID);
+ sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
+ {
+ tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
+ sinkData.listConnectionFormats.push_back(tempConnectionFormat);
+ }
+
+ if ((eCode = sqlite3_finalize(qConnectionFormat)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ //read out sound properties
+ std::string commandSoundProperty = "SELECT soundPropertyType, value FROM SinkSoundProperty" + i2s(sinkID);
+ sqlite3_prepare_v2(mDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
+ while ((eCode = sqlite3_step(qSoundProperty)) == SQLITE_ROW)
+ {
+ tempSoundProperty.type = (am_SoundPropertyType_e) sqlite3_column_int(qSoundProperty, 0);
+ tempSoundProperty.value = sqlite3_column_int(qSoundProperty, 1);
+ sinkData.listSoundProperties.push_back(tempSoundProperty);
+ }
+
+ if ((eCode = sqlite3_finalize(qSoundProperty)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ //read out MainSoundProperties
+ std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SinkMainSoundProperty" + i2s(sinkID);
+ sqlite3_prepare_v2(mDatabase, 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);
+ sinkData.listMainSoundProperties.push_back(tempMainSoundProperty);
+ }
+
+ if ((eCode = sqlite3_finalize(qMAinSoundProperty)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+ }
+
+ else if (eCode != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSinkInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ return E_OK;
+}
+
+am_Error_e DatabaseHandler::getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s & sourceData) const
+{
+ assert(sourceID!=0);
+
+ if (!existSource(sourceID))
+ {
+ return E_NON_EXISTENT;
+ }
+
+ sqlite3_stmt* query = NULL, *qConnectionFormat = NULL, *qSoundProperty = NULL, *qMAinSoundProperty = NULL;
+ int eCode = 0;
+ am_ConnectionFormat_e tempConnectionFormat;
+ am_SoundProperty_s tempSoundProperty;
+ am_MainSoundProperty_s tempMainSoundProperty;
+ std::string command = "SELECT name, domainID, sourceClassID, sourceState, volume, visible, availability, availabilityReason, interruptState, sourceID FROM " + std::string(SOURCE_TABLE) + " WHERE reserved=0 AND sourceID=" + i2s(sourceID);
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+
+ if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
+ {
+ sourceData.name = std::string((const char*) sqlite3_column_text(query, 0));
+ sourceData.domainID = sqlite3_column_int(query, 1);
+ sourceData.sourceClassID = sqlite3_column_int(query, 2);
+ sourceData.sourceState = (am_SourceState_e) sqlite3_column_int(query, 3);
+ sourceData.volume = sqlite3_column_int(query, 4);
+ sourceData.visible = sqlite3_column_int(query, 5);
+ sourceData.available.availability = (am_Availablility_e) sqlite3_column_int(query, 6);
+ sourceData.available.availabilityReason = (am_AvailabilityReason_e) sqlite3_column_int(query, 7);
+ sourceData.interruptState = (am_InterruptState_e) sqlite3_column_int(query, 8);
+ sourceData.sourceID = sqlite3_column_int(query, 9);
+
+ //read out the connectionFormats
+ std::string commandConnectionFormat = "SELECT soundFormat FROM SourceConnectionFormat" + i2s(sourceID);
+ sqlite3_prepare_v2(mDatabase, commandConnectionFormat.c_str(), -1, &qConnectionFormat, NULL);
+ while ((eCode = sqlite3_step(qConnectionFormat)) == SQLITE_ROW)
+ {
+ tempConnectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(qConnectionFormat, 0);
+ sourceData.listConnectionFormats.push_back(tempConnectionFormat);
+ }
+
+ if ((eCode = sqlite3_finalize(qConnectionFormat)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getListSources SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ //read out sound properties
+ std::string commandSoundProperty = "SELECT soundPropertyType, value FROM SourceSoundProperty" + i2s(sourceID);
+ sqlite3_prepare_v2(mDatabase, commandSoundProperty.c_str(), -1, &qSoundProperty, NULL);
+ while ((eCode = sqlite3_step(qSoundProperty)) == SQLITE_ROW)
+ {
+ tempSoundProperty.type = (am_SoundPropertyType_e) sqlite3_column_int(qSoundProperty, 0);
+ tempSoundProperty.value = sqlite3_column_int(qSoundProperty, 1);
+ sourceData.listSoundProperties.push_back(tempSoundProperty);
+ }
+
+ if ((eCode = sqlite3_finalize(qSoundProperty)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ //read out MainSoundProperties
+ std::string commandMainSoundProperty = "SELECT soundPropertyType, value FROM SourceMainSoundProperty" + i2s(sourceID);
+ sqlite3_prepare_v2(mDatabase, 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);
+ sourceData.listMainSoundProperties.push_back(tempMainSoundProperty);
+ }
+
+ if ((eCode = sqlite3_finalize(qMAinSoundProperty)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+ }
+ else if (eCode != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::getSourceInfoDB SQLITE error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getSourceInfoDB SQLITE Finalize error code:", eCode);
+
+ return E_DATABASE_ERROR;
+ }
+
+ return E_OK;
+}
+
+am_Error_e am::DatabaseHandler::getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s & mainConnectionData) const
+{
+ assert(mainConnectionID!=0);
+ if (!existMainConnection(mainConnectionID))
+ {
+ return E_NON_EXISTENT;
+ }
+ sqlite3_stmt *query = NULL, *query1 = NULL;
+ int eCode = 0;
+ am_MainConnection_s temp;
+ std::string command = "SELECT mainConnectionID, sourceID, sinkID, connectionState, delay FROM " + std::string(MAINCONNECTION_TABLE) + " WHERE mainConnectionID=" + i2s(mainConnectionID);
+ std::string command1 = "SELECT connectionID FROM MainConnectionRoute";
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+
+ while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
+ {
+ mainConnectionData.mainConnectionID = sqlite3_column_int(query, 0);
+ mainConnectionData.sourceID = sqlite3_column_int(query, 1);
+ mainConnectionData.sinkID = sqlite3_column_int(query, 2);
+ mainConnectionData.connectionState = (am_ConnectionState_e) sqlite3_column_int(query, 3);
+ mainConnectionData.delay = sqlite3_column_int(query, 4);
+ std::string statement = command1 + i2s(mainConnectionID);
+ sqlite3_prepare_v2(mDatabase, statement.c_str(), -1, &query1, NULL);
+ while ((eCode = sqlite3_step(query1)) == SQLITE_ROW)
+ {
+ mainConnectionData.listConnectionID.push_back(sqlite3_column_int(query1, 0));
+ }
+ }
+
+ if (eCode != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::getMainConnectionInfoDB SQLITE error code:", eCode);
+ return E_DATABASE_ERROR;
+ }
+
+ if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::getMainConnectionInfoDB SQLITE Finalize error code:", eCode);
+ return E_DATABASE_ERROR;
+ }
+
+ return E_OK;
+}
+
am_Error_e DatabaseHandler::changeSinkClassInfoDB(const am_SinkClass_s& sinkClass)
{
assert(sinkClass.sinkClassID!=0);
am_Error_e DatabaseHandler::getListMainConnections(std::vector<am_MainConnection_s> & listMainConnections) const
{
listMainConnections.clear();
- sqlite3_stmt *query = NULL, *query1 = NULL, *query2 = NULL;
+ sqlite3_stmt *query = NULL, *query1 = NULL;
int eCode = 0;
am_MainConnection_s temp;
- am_RoutingElement_s tempRoute;
-
std::string command = "SELECT mainConnectionID, sourceID, sinkID, connectionState, delay FROM " + std::string(MAINCONNECTION_TABLE);
std::string command1 = "SELECT connectionID FROM MainConnectionRoute";
- std::string command2 = "SELECT sourceID, sinkID, connectionFormat FROM " + std::string(CONNECTION_TABLE) + " WHERE connectionID=?";
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- sqlite3_prepare_v2(mDatabase, command2.c_str(), -1, &query2, NULL);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
- temp.connectionID = sqlite3_column_int(query, 0);
- temp.route.sourceID = sqlite3_column_int(query, 1);
- temp.route.sinkID = sqlite3_column_int(query, 2);
+ temp.mainConnectionID = sqlite3_column_int(query, 0);
+ temp.sourceID = sqlite3_column_int(query, 1);
+ temp.sinkID = sqlite3_column_int(query, 2);
temp.connectionState = (am_ConnectionState_e) sqlite3_column_int(query, 3);
temp.delay = sqlite3_column_int(query, 4);
- std::string statement = command1 + i2s(temp.connectionID);
+ std::string statement = command1 + i2s(temp.mainConnectionID);
sqlite3_prepare_v2(mDatabase, statement.c_str(), -1, &query1, NULL);
while ((eCode = sqlite3_step(query1)) == SQLITE_ROW)
{
- int k = sqlite3_column_int(query1, 0);
- sqlite3_bind_int(query2, 1, k);
- while ((eCode = sqlite3_step(query2)) == SQLITE_ROW)
- {
- tempRoute.sourceID = sqlite3_column_int(query2, 0);
- tempRoute.sinkID = sqlite3_column_int(query2, 1);
- tempRoute.connectionFormat = (am_ConnectionFormat_e) sqlite3_column_int(query2, 2);
- getDomainOfSource(tempRoute.sourceID, tempRoute.domainID);
- temp.route.route.push_back(tempRoute);
- }
- sqlite3_reset(query2);
+ temp.listConnectionID.push_back(sqlite3_column_int(query1, 0));
}
listMainConnections.push_back(temp);
}
* @param callback the callback that shall be called if the filedescriptor poll succeeded
* @return E_OK if the descriptor was added, E_NON_EXISTENT if the fd is not valid
*/
-am_Error_e SocketHandler::addFDPoll(const int fd, const int16_t event, shPollPrepare *prepare, shPollFired *fired, shPollCheck *check, shPollDispatch *dispatch, void* userData, sh_pollHandle_t& handle)
+
+am_Error_e SocketHandler::addFDPoll(const int fd, const short event, shPollPrepare *prepare, shPollFired *fired, shPollCheck *check, shPollDispatch *dispatch, void *userData, sh_pollHandle_t & handle)
{
if (!fdIsValid(fd))
return E_NON_EXISTENT;
* @param event the event flags
* @return E_OK on succsess, E_NON_EXISTENT if fd was not found
*/
-am_Error_e SocketHandler::updateEventFlags(const sh_pollHandle_t handle, const int16_t events)
+am_Error_e SocketHandler::updateEventFlags(const sh_pollHandle_t handle, const short events)
{
mListPoll_t::iterator iterator = mListPoll.begin();
connection.connectionFormat = CF_ANALOG;
}
-void CommonFunctions::createMainConnection(am_MainConnection_s & mainConnection, am_Route_s route) const
-{
- mainConnection.connectionID = 0;
- mainConnection.connectionState = CS_CONNECTED;
- mainConnection.route = route;
- mainConnection.delay = -1;
-}
-
std::vector<bool> CommonFunctions::getStandardConvertionMatrix()
{
std::vector<bool> convMatrix;
void createDomain(am_Domain_s& domain) const;
void createGateway(am_Gateway_s& gateway);
void createConnection(am_Connection_s& connection) const;
- void createMainConnection(am_MainConnection_s& mainConnection, am_Route_s route) const;
void connectionList2RoutingList(std::vector<am_RoutingElement_s>& routingList, const std::vector<am_Connection_s>& connectionList);
struct sortBySinkID
//extern int GetRandomNumber(int nLow, int nHigh);
//extern bool equalSoundProperty (const am_SoundProperty_s a, const am_SoundProperty_s b);
extern bool equalMainSoundProperty(const am_MainSoundProperty_s a, const am_MainSoundProperty_s b);
-extern bool equalRoutingElement(const am_RoutingElement_s a, const am_RoutingElement_s b);
+//extern bool equalRoutingElement(const am_RoutingElement_s a, const am_RoutingElement_s b);
extern bool equalClassProperties(const am_ClassProperty_s a, const am_ClassProperty_s b);
extern std::string int2string(int i);
am_Connection_s connection;
am_Source_s source;
am_Sink_s sink;
- std::vector<am_Connection_s> connectionList;
+ std::vector<am_connectionID_t> connectionList;
//we create 9 sources and sinks:
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(9);
{
am_sinkID_t forgetSink;
am_sourceID_t forgetSource;
- am_connectionID_t forgetConnection;
-
- pCF.createConnection(connection);
- connection.sinkID = i;
- connection.sourceID = i;
- connectionList.push_back(connection);
+ am_connectionID_t connectionID;
pCF.createSink(sink);
sink.sinkID = i;
source.name = "source" + int2string(i);
source.domainID = 4;
- ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(sink,forgetSink))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(source,forgetSource))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.enterConnectionDB(connection,forgetConnection))
- << "ERROR: database error";
- ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(forgetConnection));
- }
+ connection.sinkID = i;
+ connection.sourceID = i;
+ connection.delay = -1;
+ connection.connectionFormat = CF_ANALOG;
+ connection.connectionID = 0;
- //fill the route
- std::vector<am_RoutingElement_s> routingList;
- pCF.connectionList2RoutingList(routingList, connectionList);
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,forgetSink));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,forgetSource));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterConnectionDB(connection,connectionID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID));
+ connectionList.push_back(connectionID);
- //create the Route
- am_Route_s route;
- route.route = routingList;
- route.sinkID = 1;
- route.sourceID = 1;
+ }
//create a mainConnection
am_MainConnection_s mainConnection;
am_mainConnectionID_t mainConnectionID;
std::vector<am_MainConnection_s> mainConnectionList;
- pCF.createMainConnection(mainConnection, route);
+ mainConnection.listConnectionID = connectionList;
+ mainConnection.mainConnectionID = 0;
+ mainConnection.sinkID = 1;
+ mainConnection.sourceID = 1;
+ mainConnection.connectionState = CS_CONNECTED;
+ mainConnection.delay = -1;
//enter mainconnection in database
EXPECT_CALL(pMockInterface,cbNumberOfMainConnectionsChanged()).Times(1);
EXPECT_CALL(pMockInterface,cbMainConnectionStateChanged(_,_)).Times(1);
- ASSERT_EQ(E_OK,pDatabaseHandler.enterMainConnectionDB(mainConnection,mainConnectionID))
- << "ERROR: database error";
- ASSERT_NE(0,mainConnectionID)
- << "ERROR: connectionID zero";
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterMainConnectionDB(mainConnection,mainConnectionID));
+ ASSERT_NE(0, mainConnectionID);
//read out the mainconnections and check if they are equal to the data written.
ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(mainConnectionList));
std::vector<am_MainConnection_s>::iterator listIterator = mainConnectionList.begin();
for (; listIterator < mainConnectionList.end(); ++listIterator)
{
- if (listIterator->connectionID == mainConnectionID)
+ if (listIterator->mainConnectionID == mainConnectionID)
{
- equal = equal && (listIterator->connectionState == mainConnection.connectionState) && (listIterator->route.sinkID == mainConnection.route.sinkID) && (listIterator->route.sourceID == mainConnection.route.sourceID) && (listIterator->delay == mainConnection.delay) && (std::equal(listIterator->route.route.begin(), listIterator->route.route.end(), routingList.begin(), equalRoutingElement));
+ equal = equal && (listIterator->connectionState == mainConnection.connectionState) && (listIterator->sinkID == mainConnection.sinkID) && (listIterator->sourceID == mainConnection.sourceID) && (listIterator->delay == mainConnection.delay) && (std::equal(listIterator->listConnectionID.begin(), listIterator->listConnectionID.end(), connectionList.begin()));
}
}
ASSERT_EQ(true, equal);
{
}
+TEST_F(databasetest,getMainConnectionInfo)
+{
+ //fill the connection database
+ am_Connection_s connection;
+ am_Source_s source;
+ am_Sink_s sink;
+ std::vector<am_connectionID_t> connectionList;
+
+ //we create 9 sources and sinks:
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(9);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(9);
+
+ for (uint16_t i = 1; i < 10; i++)
+ {
+ am_sinkID_t forgetSink;
+ am_sourceID_t forgetSource;
+ am_connectionID_t connectionID;
+
+ pCF.createSink(sink);
+ sink.sinkID = i;
+ sink.name = "sink" + int2string(i);
+ sink.domainID = 4;
+ pCF.createSource(source);
+ source.sourceID = i;
+ source.name = "source" + int2string(i);
+ source.domainID = 4;
+
+ connection.sinkID = i;
+ connection.sourceID = i;
+ connection.delay = -1;
+ connection.connectionFormat = CF_ANALOG;
+ connection.connectionID = 0;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,forgetSink));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,forgetSource));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterConnectionDB(connection,connectionID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeConnectionFinal(connectionID));
+ connectionList.push_back(connectionID);
+
+ }
+
+ //create a mainConnection
+ am_MainConnection_s mainConnection;
+ am_mainConnectionID_t mainConnectionID;
+ std::vector<am_MainConnection_s> mainConnectionList;
+ mainConnection.listConnectionID = connectionList;
+ mainConnection.mainConnectionID = 0;
+ mainConnection.sinkID = 1;
+ mainConnection.sourceID = 1;
+ mainConnection.connectionState = CS_CONNECTED;
+ mainConnection.delay = -1;
+
+ //enter mainconnection in database
+ EXPECT_CALL(pMockInterface,cbNumberOfMainConnectionsChanged()).Times(1);
+ EXPECT_CALL(pMockInterface,cbMainConnectionStateChanged(_,_)).Times(1);
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterMainConnectionDB(mainConnection,mainConnectionID));
+ ASSERT_NE(0, mainConnectionID);
+
+ //read out the mainconnections and check if they are equal to the data written.
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(mainConnectionList));
+ bool equal = true;
+ std::vector<am_MainConnection_s>::iterator listIterator = mainConnectionList.begin();
+ for (; listIterator < mainConnectionList.end(); ++listIterator)
+ {
+ if (listIterator->mainConnectionID == mainConnectionID)
+ {
+ equal = equal && (listIterator->connectionState == mainConnection.connectionState) && (listIterator->sinkID == mainConnection.sinkID) && (listIterator->sourceID == mainConnection.sourceID) && (listIterator->delay == mainConnection.delay) && (std::equal(listIterator->listConnectionID.begin(), listIterator->listConnectionID.end(), connectionList.begin()));
+ }
+ }ASSERT_EQ(true, equal);
+
+ am_MainConnection_s mainConnectionT;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getMainConnectionInfoDB(mainConnectionID,mainConnectionT));
+ ASSERT_TRUE( (mainConnection.connectionState==mainConnectionT.connectionState) && (mainConnection.delay==mainConnectionT.delay) && (std::equal(mainConnection.listConnectionID.begin(),mainConnection.listConnectionID.end(),mainConnectionT.listConnectionID.begin())) && (mainConnection.sinkID==mainConnectionT.sinkID) && (mainConnection.sourceID==mainConnectionT.sourceID) && (mainConnectionID==mainConnectionT.mainConnectionID));
+
+}
+
+TEST_F(databasetest,getSinKInfo)
+{
+ //fill the connection database
+ am_Sink_s staticSink, firstDynamicSink, secondDynamicSink;
+ am_sinkID_t staticSinkID, firstDynamicSinkID, secondDynamicSinkID;
+ std::vector<am_Sink_s> sinkList;
+
+ pCF.createSink(staticSink);
+ staticSink.sinkID = 4;
+
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(3);
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(staticSink,staticSinkID))
+ << "ERROR: database error";
+ ASSERT_EQ(staticSink.sinkID,staticSinkID)
+ << "ERROR: ID not the one given in staticSink";
+
+ pCF.createSink(firstDynamicSink);
+ firstDynamicSink.name = "firstdynamic";
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(firstDynamicSink,firstDynamicSinkID))
+ << "ERROR: database error";
+ ASSERT_EQ(firstDynamicSinkID,DYNAMIC_ID_BOUNDARY)
+ << "ERROR: ID not the one given in firstDynamicSink";
+
+ pCF.createSink(secondDynamicSink);
+ secondDynamicSink.name = "seconddynamic";
+
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(secondDynamicSink,secondDynamicSinkID))
+ << "ERROR: database error";
+ ASSERT_NEAR(secondDynamicSinkID,DYNAMIC_ID_BOUNDARY,10)
+ << "ERROR: ID not the one given in secondDynamicSink";
+
+ //now read back and check the returns agains the given values
+ ASSERT_EQ(E_OK,pDatabaseHandler.getListSinks(sinkList))
+ << "ERROR: database error";
+ bool equal = true;
+
+ std::vector<am_Sink_s>::iterator listIterator = sinkList.begin();
+ for (; listIterator < sinkList.end(); ++listIterator)
+ {
+ if (listIterator->sinkID == staticSinkID)
+ {
+ equal = equal && pCF.compareSink(listIterator, staticSink);
+ }
+
+ if (listIterator->sinkID == firstDynamicSinkID)
+ {
+ equal = equal && pCF.compareSink(listIterator, firstDynamicSink);
+ }
+
+ if (listIterator->sinkID == secondDynamicSinkID)
+ {
+ equal = equal && pCF.compareSink(listIterator, secondDynamicSink);
+ }
+ }ASSERT_EQ(true, equal);
+
+ am_Sink_s sinkData;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getSinkInfoDB(secondDynamicSinkID,sinkData));
+ ASSERT_TRUE( (secondDynamicSink.available.availability == sinkData.available.availability) && (secondDynamicSink.available.availabilityReason == sinkData.available.availabilityReason) && (secondDynamicSink.sinkClassID == sinkData.sinkClassID) && (secondDynamicSink.domainID == sinkData.domainID) && (secondDynamicSink.visible == sinkData.visible) && (secondDynamicSink.name.compare(sinkData.name) == 0) && (secondDynamicSink.volume == sinkData.volume) && std::equal(secondDynamicSink.listConnectionFormats.begin(), secondDynamicSink.listConnectionFormats.end(), sinkData.listConnectionFormats.begin()) && std::equal(secondDynamicSink.listMainSoundProperties.begin(), secondDynamicSink.listMainSoundProperties.end(), sinkData.listMainSoundProperties.begin(), equalMainSoundProperty));
+
+}
+
+TEST_F(databasetest,getSourceInfo)
+{
+ //fill the connection database
+ am_Source_s staticSource, firstDynamicSource, secondDynamicSource;
+ am_sourceID_t staticSourceID, firstDynamicSourceID, secondDynamicSourceID;
+ std::vector<am_Source_s> sourceList;
+
+ pCF.createSource(staticSource);
+ staticSource.sourceID = 4;
+ staticSource.name = "Static";
+
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(3);
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(staticSource,staticSourceID))
+ << "ERROR: database error";
+ ASSERT_EQ(staticSource.sourceID,staticSourceID)
+ << "ERROR: ID not the one given in staticSource";
+
+ pCF.createSource(firstDynamicSource);
+ firstDynamicSource.name = "firstDynamicSource";
+
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(firstDynamicSource,firstDynamicSourceID))
+ << "ERROR: database error";
+ ASSERT_EQ(firstDynamicSourceID,DYNAMIC_ID_BOUNDARY)
+ << "ERROR: ID not the one given in firstDynamicSink";
+
+ pCF.createSource(secondDynamicSource);
+ secondDynamicSource.name = "secondDynamicSource";
+
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(secondDynamicSource,secondDynamicSourceID))
+ << "ERROR: database error";
+ ASSERT_NEAR(secondDynamicSourceID,DYNAMIC_ID_BOUNDARY,10)
+ << "ERROR: ID not the one given in secondDynamicSink";
+
+ //now read back and check the returns agains the given values
+ ASSERT_EQ(E_OK,pDatabaseHandler.getListSources(sourceList))
+ << "ERROR: database error";
+ bool equal = true;
+
+ std::vector<am_Source_s>::iterator listIterator = sourceList.begin();
+ for (; listIterator < sourceList.end(); ++listIterator)
+ {
+ if (listIterator->sourceID == staticSourceID)
+ {
+ equal = equal && pCF.compareSource(listIterator, staticSource);
+ }
+
+ if (listIterator->sourceID == firstDynamicSourceID)
+ {
+ equal = equal && pCF.compareSource(listIterator, firstDynamicSource);
+ }
+
+ if (listIterator->sourceID == secondDynamicSourceID)
+ {
+ equal = equal && pCF.compareSource(listIterator, secondDynamicSource);
+ }
+ pCF.compareSource(listIterator, secondDynamicSource);
+
+ }ASSERT_EQ(true, equal);
+
+ am_Source_s sourceData;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getSourceInfoDB(secondDynamicSourceID,sourceData));
+ ASSERT_TRUE(
+ (secondDynamicSource.available.availability == sourceData.available.availability) && (secondDynamicSource.available.availabilityReason == sourceData.available.availabilityReason) && (secondDynamicSource.sourceClassID == sourceData.sourceClassID) && (secondDynamicSource.domainID == sourceData.domainID) && (secondDynamicSource.interruptState == sourceData.interruptState) && (secondDynamicSource.visible == sourceData.visible) && (secondDynamicSource.name.compare(sourceData.name) == 0) && (secondDynamicSource.volume == sourceData.volume) && std::equal(secondDynamicSource.listConnectionFormats.begin(), secondDynamicSource.listConnectionFormats.end(), sourceData.listConnectionFormats.begin()) && std::equal(secondDynamicSource.listMainSoundProperties.begin(), secondDynamicSource.listMainSoundProperties.end(), sourceData.listMainSoundProperties.begin(), equalMainSoundProperty));
+
+}
+
TEST_F(databasetest, peekSourceID)
{
EXPECT_CALL(pMockInterface,cbNumberOfSourceClassesChanged()).Times(1);
sinkB.name = "sinkB";
pCF.createSource(source);
ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain,domainID));
- source.domainID=domainID;
- sinkA.domainID=domainID;
- sinkB.domainID=domainID;
+ source.domainID = domainID;
+ sinkA.domainID = domainID;
+ sinkB.domainID = domainID;
ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sinkA,sinkAID));
std::vector<am_crossfaderID_t> listCrossfaders;
ASSERT_EQ(E_OK, pDatabaseHandler.enterCrossfaderDB(crossfader,crossfaderID));
- ASSERT_EQ(E_OK,pDatabaseHandler.getListCrossfadersOfDomain(source.domainID,listCrossfaders));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListCrossfadersOfDomain(source.domainID,listCrossfaders));
ASSERT_EQ(100, listCrossfaders[0]);
}
TEST_F(databasetest,changeConnectionTimingInformationCheckMainConnection)
{
- am_Connection_s connection;
std::vector<am_Connection_s> connectionList;
std::vector<am_MainConnectionType_s> mainList;
- pCF.createConnection(connection);
//prepare the test, it is one mainconnection, so we expect one callback
createMainConnectionSetup();
std::vector<am_MainConnection_s> listMainConnections;
createMainConnectionSetup();
EXPECT_CALL(pMockInterface,cbMainConnectionStateChanged(_,_)).Times(1);
- ASSERT_EQ(E_OK,pDatabaseHandler.changeMainConnectionStateDB(1,CS_DISCONNECTING))
- << "ERROR: database error";ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(listMainConnections));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeMainConnectionStateDB(1,CS_DISCONNECTING));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(listMainConnections));
ASSERT_EQ(CS_DISCONNECTING, listMainConnections[0].connectionState);
}
am_Connection_s connection;
am_Source_s source;
am_Sink_s sink;
- std::vector<am_Connection_s> connectionList;
+ std::vector<am_connectionID_t> listConnectionID;
EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(9);
EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(9);
{
am_sinkID_t forgetSink;
am_sourceID_t forgetSource;
- am_connectionID_t forgetConnection;
+ am_connectionID_t connectionID;
- pCF.createConnection(connection);
connection.sinkID = i + 20;
connection.sourceID = i + 20;
connection.delay = -1;
- connectionList.push_back(connection);
+ connection.connectionFormat = CF_ANALOG;
+ connection.connectionID = 0;
pCF.createSink(sink);
sink.sinkID = i + 20;
source.name = "source" + int2string(i + 30);
source.domainID = 4;
- ASSERT_EQ(E_OK,pDatabaseHandler.enterSinkDB(sink,forgetSink))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.enterSourceDB(source,forgetSource))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.enterConnectionDB(connection,forgetConnection))
- << "ERROR: database error";
- ASSERT_EQ(E_OK,pDatabaseHandler.getListMainConnections(originalList))
- << "ERROR: database error";
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,forgetSink));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,forgetSource));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterConnectionDB(connection,connectionID));
+ listConnectionID.push_back(connectionID);
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(originalList));
}
- //fill the route
- std::vector<am_RoutingElement_s> routingList;
- pCF.connectionList2RoutingList(routingList, connectionList);
-
- //create the Route
- am_Route_s route;
- route.route = routingList;
- route.sinkID = 2;
- route.sourceID = 2;
-
- ASSERT_EQ(E_OK, pDatabaseHandler.changeMainConnectionRouteDB(1,route));
- ASSERT_EQ(E_OK,pDatabaseHandler.getListMainConnections(newList))
- << "ERROR: database error";ASSERT_TRUE(std::equal(newList[0].route.route.begin(),newList[0].route.route.end(),routingList.begin(),equalRoutingElement));
- ASSERT_FALSE(std::equal(newList[0].route.route.begin(),newList[0].route.route.end(),originalList[0].route.route.begin(),equalRoutingElement));
+ ASSERT_EQ(E_OK, pDatabaseHandler.changeMainConnectionRouteDB(1,listConnectionID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(newList));
+ ASSERT_FALSE(std::equal(newList[0].listConnectionID.begin(),newList[0].listConnectionID.end(),originalList[0].listConnectionID.begin()));
}
TEST_F(databasetest,changeMainSinkVolume)
TEST_F(databasetest,getVisibleMainConnections)
{
createMainConnectionSetup();
- am_MainConnection_s mainConnection;
- am_Route_s route;
- pCF.createMainConnection(mainConnection, route);
- std::vector<am_MainConnectionType_s> visibleMainConnection;
- ASSERT_EQ(E_OK, pDatabaseHandler.getListVisibleMainConnections(visibleMainConnection));
- ASSERT_TRUE(1==visibleMainConnection[0].mainConnectionID);
- ASSERT_TRUE(mainConnection.connectionState==visibleMainConnection[0].connectionState);
- ASSERT_TRUE(mainConnection.delay==visibleMainConnection[0].delay);
- ASSERT_TRUE(1==visibleMainConnection[0].sinkID);
- ASSERT_TRUE(1==visibleMainConnection[0].sourceID);
+ std::vector<am_MainConnectionType_s> listVisibleMainConnections;
+ std::vector<am_MainConnection_s> listMainConnections;
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListVisibleMainConnections(listVisibleMainConnections));
+ ASSERT_EQ(E_OK, pDatabaseHandler.getListMainConnections(listMainConnections));
+ ASSERT_EQ(listMainConnections[0].mainConnectionID, listVisibleMainConnections[0].mainConnectionID);
+ ASSERT_EQ(listMainConnections[0].connectionState, listVisibleMainConnections[0].connectionState);
+ ASSERT_EQ(listMainConnections[0].delay, listVisibleMainConnections[0].delay);
+ ASSERT_EQ(listMainConnections[0].sinkID, listVisibleMainConnections[0].sinkID);
+ ASSERT_EQ(listMainConnections[0].sourceID, listVisibleMainConnections[0].sourceID);
}
TEST_F(databasetest,getListSourcesOfDomain)
+commit e124310a45e6e7798a077fa44ef3ee518193b2cf
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * modify RoutingSender Async to match with TestHMI
+ * modify ControlSenderPlugin to have dummy behaviour
+
commit 2ddacca29eccd4192add2b17ad6af357b52ea29b
Author: Frank Herchet <frank.fh.herchet@bmw.de>
assert(mDBusWrapper!=NULL);
DBusConnection * connection;
mDBusWrapper->getDBusConnection(connection);
+ assert(connection!=NULL);
mDBUSMessageHandler.setDBusConnection(connection);
return (E_OK);
}
}
bool operator()(const am_MainConnection_s& mainConnection)
{
- if (mMainConnection.connectionID == mainConnection.connectionID)
+ if (mMainConnection.mainConnectionID == mainConnection.mainConnectionID)
return true;
return false;
}
am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t & mainConnectionID)
{
std::vector<am_Route_s> listRoutes;
+ std::vector<am_connectionID_t> listConnectionIDs;
am_Handle_s handle;
- am_connectionID_t connectionID;
mControlReceiveInterface->getRoute(true, sourceID, sinkID, listRoutes);
if (listRoutes.empty())
return E_NOT_POSSIBLE;
std::vector<am_RoutingElement_s>::iterator it(listRoutes[0].route.begin());
for (; it != listRoutes[0].route.end(); ++it)
{
+ am_connectionID_t connectionID;
mControlReceiveInterface->connect(handle, connectionID, it->connectionFormat, it->sourceID, it->sinkID);
handleStatus status;
status.handle = handle;
status.status = false;
listHandleStaus.push_back(status);
+ listConnectionIDs.push_back(connectionID);
}
am_MainConnection_s mainConnectionData;
- mainConnectionData.connectionID = 0;
+ mainConnectionData.mainConnectionID = 0;
mainConnectionData.connectionState = CS_CONNECTING;
mainConnectionData.delay = 0;
- mainConnectionData.route = listRoutes[0];
+ mainConnectionData.listConnectionID = listConnectionIDs;
mControlReceiveInterface->enterMainConnectionDB(mainConnectionData, mainConnectionID);
mainConnectionSet set;
set.connectionID = mainConnectionID;
{
std::vector<handleStatus>::iterator hit;
handleStatus status;
- status.status=true;
- status.handle=handle;
+ status.status = true;
+ status.handle = handle;
hit = std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), findHandle(status));
if (hit == it->listHandleStaus.end())
continue;
- hit->status=true;
- if (it->listHandleStaus.end()==std::find_if(it->listHandleStaus.begin(),it->listHandleStaus.end(),checkHandle(status)))
+ hit->status = true;
+ if (it->listHandleStaus.end() == std::find_if(it->listHandleStaus.begin(), it->listHandleStaus.end(), checkHandle(status)))
{
mControlReceiveInterface->changeMainConnectionStateDB(it->connectionID, CS_CONNECTED);
mListOpenConnections.erase(it);
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_)\r
-#define EA_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_\r
+#if !defined(EA_2D7F1C82_8717_47ce_B755_51DDED15BC18__INCLUDED_)\r
+#define EA_2D7F1C82_8717_47ce_B755_51DDED15BC18__INCLUDED_\r
\r
#include <stdint.h>\r
#include "projecttypes.h"\r
* After the buildup of a connection the first timing information needs to be sent within 5 seconds, the timing information from the routing adaptors need to be sent via 4 seconds. If the latency for a connection is variable and changes over lifetime of the connection, the routing adaptors shall resend the value and the audiomanger will correct the over all latency.\n
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_domainID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_sourceID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_sinkID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_gatewayID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_crossfaderID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_connectionID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:00 PM
*/
typedef uint16_t am_mainConnectionID_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef uint16_t am_speed_t;
* The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be limited by actual project.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef int16_t am_volume_t;
* The range of this type is customer specific.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef int16_t am_mainVolume_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef uint16_t am_sourceClass_t;
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef uint16_t am_sinkClass_t;
* time in ms!
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef uint16_t am_time_t;
* offset time that is introduced in milli seconds.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
typedef int16_t am_timeSync_t;
* with the help of this enum, sinks and sources can report their availability state
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_Availablility_e
{
* represents the connection state
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_ConnectionState_e
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_DomainState_e
{
* This enum characterizes the data of the EarlyData_t
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_EarlyDataType_e
{
* the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_Error_e
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_MuteState_e
{
* The source state reflects the state of the source
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_SourceState_e
{
* This enumeration is used to define the type of the action that is correlated to a handle.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_Handle_e
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:48 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_InterruptState_e
{
* describes the active sink of a crossfader.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
enum am_HotSink_e
{
* this describes the availability of a sink or a source together with the latest change
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_Availability_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_ClassProperty_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_Crossfader_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_Gateway_s
{
* This represents one "hopp" in a route
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:01 PM
*/
struct am_RoutingElement_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_Route_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SoundProperty_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:49 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SystemProperty_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SinkClass_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SourceClass_s
{
* this type holds all information of sources relevant to the HMI
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SourceType_s
{
* this type holds all information of sinks relevant to the HMI
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:02 PM
*/
struct am_SinkType_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_Handle_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_MainSoundProperty_s
{
* this type holds all information of connections relevant to the HMI
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_MainConnectionType_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:50 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_MainConnection_s
{
public:
- am_mainConnectionID_t connectionID;
+ am_mainConnectionID_t mainConnectionID;
am_ConnectionState_e connectionState;
- am_Route_s route;
+ /**
+ * the sinkID
+ */
+ am_sinkID_t sinkID;
+ /**
+ * the sourceID
+ */
+ am_sourceID_t sourceID;
am_timeSync_t delay;
+ std::vector<am_connectionID_t> listConnectionID;
};
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_Sink_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_Source_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:03 PM
*/
struct am_Domain_s
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
struct am_Connection_s
{
* soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
union am_EarlyData_u
{
* sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
union am_DataType_u
{
/**
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:51 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
struct am_EarlyData_s
{
};
}
-#endif // !defined(EA_C4520781_52CF_4636_BE82_37A28F483C93__INCLUDED_)
+#endif // !defined(EA_2D7F1C82_8717_47ce_B755_51DDED15BC18__INCLUDED_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_)\r
-#define EA_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_\r
+#if !defined(EA_C6A85AF3_95A7_4c37_90ED_CA847BA7F31D__INCLUDED_)\r
+#define EA_C6A85AF3_95A7_4c37_90ED_CA847BA7F31D__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
* The interface towards the Controlling Instance (e.g HMI). It handles the communication towards the HMI and other system components who need to interact with the audiomanagement.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:52 PM
+ * @created 10-Feb-2012 1:31:04 PM
*/
class CommandReceiveInterface
{
};
}
-#endif // !defined(EA_6FE1E594_3CEA_4eaa_BAD0_7BB39D3150D2__INCLUDED_)
+#endif // !defined(EA_C6A85AF3_95A7_4c37_90ED_CA847BA7F31D__INCLUDED_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_)\r
-#define EA_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_\r
+#if !defined(EA_1EBB5273_A222_43b8_B7C9_435405DF9AA2__INCLUDED_)\r
+#define EA_1EBB5273_A222_43b8_B7C9_435405DF9AA2__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
* This interface handles all communication from the AudioManagerDaemon towards the system. It is designed in such a way that only callbacks with no return types are implemented. So when the CommandInterfacePlugins are designed in such a way that they broadcast signals to any node who is interested in the particular information (like signals on Dbus for example), more information can be retrieved via the CommandReceiveInterface.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:52 PM
+ * @created 10-Feb-2012 1:31:05 PM
*/
class CommandSendInterface
{
};
}
-#endif // !defined(EA_B298DDFD_7AC9_4a18_BB8C_595921C525B6__INCLUDED_)
+#endif // !defined(EA_1EBB5273_A222_43b8_B7C9_435405DF9AA2__INCLUDED_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_)\r
-#define EA_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_\r
+#if !defined(EA_C0D10ABE_48CA_4a18_9932_CB970D9C3723__INCLUDED_)\r
+#define EA_C0D10ABE_48CA_4a18_9932_CB970D9C3723__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
* This interface gives access to all important functions of the audiomanager that are used by the AudioManagerController to control the system.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:52 PM
+ * @created 10-Feb-2012 1:31:05 PM
*/
class ControlReceiveInterface
{
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if mainconnection
*
* @param mainconnectionID
- * @param route
+ * @param listConnectionID
*/
- virtual am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const am_Route_s& route) =0;
+ virtual am_Error_e changeMainConnectionRouteDB(const am_mainConnectionID_t mainconnectionID, const std::vector<am_connectionID_t>& listConnectionID) =0;
/**
* changes the mainConnectionState of MainConnection\r
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if mainconnection
*/
virtual am_Error_e getSinkClassInfoDB(const am_sinkID_t sinkID, am_SinkClass_s& sinkClass) const =0;
/**
+ * returns the sinkData of a sink\r
+ * @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if sink was not found
+ *
+ * @param sinkID
+ * @param sinkData
+ */
+ virtual am_Error_e getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s& sinkData) const =0;
+ /**
+ * returns the sourcekData of a source\r
+ * @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if sink was not found
+ *
+ * @param sourceID
+ * @param sourceData
+ */
+ virtual am_Error_e getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s& sourceData) const =0;
+ /**
* return source and sink of a gateway\r
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if gateway was not found
*
*/
virtual am_Error_e getCrossfaderInfoDB(const am_crossfaderID_t crossfaderID, am_Crossfader_s& crossfaderData) const =0;
/**
+ * returns sources and the sink of a crossfader\r
+ * @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if crossfader was not found
+ *
+ * @param mainConnectionID
+ * @param mainConnectionData
+ */
+ virtual am_Error_e getMainConnectionInfoDB(const am_mainConnectionID_t mainConnectionID, am_MainConnection_s& mainConnectionData) const =0;
+ /**
* returns all sinks of a domain\r
* @return E_OK on success, E_DATABASE_ERROR on error, E_NON_EXISTENT if domain was not found
*
};
}
-#endif // !defined(EA_9550F257_23AE_4781_B149_0E4B3A9889AC__INCLUDED_)
+#endif // !defined(EA_C0D10ABE_48CA_4a18_9932_CB970D9C3723__INCLUDED_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_)\r
-#define EA_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_\r
+#if !defined(EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_)\r
+#define EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
* All the hooks represent system events that need to be handled. The callback functions are used to handle for example answers to function calls on the AudioManagerCoreInterface.
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:53 PM
+ * @created 10-Feb-2012 1:31:06 PM
*/
class ControlSendInterface
{
};
}
-#endif // !defined(EA_7C94464D_AE95_434a_A108_201C19F97A85__INCLUDED_)
+#endif // !defined(EA_F931365D_53A0_4830_8B3E_29C95C767ADC__INCLUDED_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_)\r
-#define EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_\r
+#if !defined(EA_C1FDE688_5CB0_42b2_B2CC_C407D50C2D87__INCLUDED_)\r
+#define EA_C1FDE688_5CB0_42b2_B2CC_C407D50C2D87__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
* @author christian
* @version 1.0
- * @created 01-Feb-2012 9:42:02 AM
+ * @created 10-Feb-2012 1:31:06 PM
*/
class RoutingReceiveInterface
{
virtual am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID) =0;
/**
* this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.\r
- * @return E_OK on succes, E_DATABASE_ERROR on error, E_NON_EXISTENT if no sourceclass with name is registered
+ * @return E_OK on succes, E_DATABASE_ERROR on error
*
* @param name
* @param sourceClassID
virtual am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID) =0;
/**
* this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.\r
- * @return E_OK on succes, E_DATABASE_ERROR on error, E_NON_EXISTENT if no sourceclass with name is registered
+ * @return E_OK on succes, E_DATABASE_ERROR on error
*
* @param name
* @param sinkClassID
*/
virtual void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay) =0;
/**
- * this function is used to send out all data that has been changed in an early state.
+ * this function is used to send out all data that has been changed in an early state.\r
+ * @return E_OK on success, E_UNKNOWN on error
*
* @param earlyData
*/
};
}
-#endif // !defined(EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_)
+#endif // !defined(EA_C1FDE688_5CB0_42b2_B2CC_C407D50C2D87__INCLUDED_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_)\r
-#define EA_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_\r
+#if !defined(EA_E1ED14D4_6A57_4661_8587_FA302E2A9951__INCLUDED_)\r
+#define EA_E1ED14D4_6A57_4661_8587_FA302E2A9951__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
* This class implements everything from Audiomanager -> RoutingAdapter
* @author christian
* @version 1.0
- * @created 01-Feb-2012 9:42:02 AM
+ * @created 10-Feb-2012 1:31:06 PM
*/
class RoutingSendInterface
{
};
}
-#endif // !defined(EA_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_)
+#endif // !defined(EA_E1ED14D4_6A57_4661_8587_FA302E2A9951__INCLUDED_)