command
= "CREATE TABLE " + QString(INTERRUPT_TABLE)
- + " (ID INTEGER NOT NULL, Source_ID INTEGER, Sink_ID INTEGER, Connection_ID INTEGER, mixed BOOL, listInterrruptedSources INTEGER, PRIMARY KEY(ID));";
+ + " (ID INTEGER NOT NULL, Source_ID INTEGER, Sink_ID INTEGER, Connection_ID INTEGER, mixed BOOL, listInterruptedSources INTEGER, PRIMARY KEY(ID));";
if (query.exec(command) != true) {
DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("Databasehandler: Could not create table"), DLT_STRING(INTERRUPT_TABLE));
return false;
genError_t DataBaseHandler::updateInterrupt(const genInt_t intID,
connection_t connID, bool mixed,
- QList<source_t> listInterrruptedSources) {
+ QList<source_t> listInterruptedSources) {
QSqlQuery query;
QString _mixed = "false";
}
//This information is not handy to be stored directly in the database. So we put it on the heap and store the pointer to it.
- QList<source_t>* pointer = new QList<source_t> (listInterrruptedSources);
+ QList<source_t>* pointer = new QList<source_t> (listInterruptedSources);
query.prepare(
"UPDATE " + QString(INTERRUPT_TABLE)
- + " SET Connection_ID=:Connection_ID, mixed=:mixed ,listInterrruptedSources=:listInterrruptedSources WHERE ID=:id");
+ + " SET Connection_ID=:Connection_ID, mixed=:mixed ,listInterruptedSources=:listInterruptedSources WHERE ID=:id");
query.bindValue(":Connection_ID", connID);
query.bindValue(":mixed", _mixed);
- query.bindValue(":listInterrruptedSources", int(pointer));
+ query.bindValue(":listInterruptedSources", int(pointer));
query.bindValue(":id", intID);
if (query.exec() != true) {
return GEN_DATABASE_ERROR;
genError_t DataBaseHandler::getInterruptDatafromID(const genInt_t intID,
connection_t* return_connID, sink_t* return_Sink_ID,
source_t* return_Source_ID, bool* return_mixed,
- QList<source_t>** return_listInterrruptedSources) {
+ QList<source_t>** return_listInterruptedSources) {
QSqlQuery query;
QString
command =
- "SELECT Connection_ID, Sink_ID, Source_ID, mixed, listInterrruptedSources FROM "
+ "SELECT Connection_ID, Sink_ID, Source_ID, mixed, listInterruptedSources FROM "
+ QString(INTERRUPT_TABLE) + " WHERE ID="
+ QString::number(intID) + ";";
*return_Sink_ID = query.value(1).toInt();
*return_Source_ID = query.value(2).toInt();
*return_mixed = query.value(3).toBool();
- *return_listInterrruptedSources
+ *return_listInterruptedSources
= reinterpret_cast<QList<source_t>*> (query.value(4).toInt());
return GEN_OK;
} else {
genError_t DataBaseHandler::removeInterrupt(const genInt_t intID) {
QSqlQuery query;
- QString command = "SELECT listInterrruptedSources FROM " + QString(
+ QString command = "SELECT listInterruptedSources FROM " + QString(
INTERRUPT_TABLE) + " WHERE ID=" + QString::number(intID) + ";";
if (query.exec(command) != true) {
return GEN_DATABASE_ERROR;
interrupt.SinkID=sink;
interrupt.ID=m_core->returnDatabaseHandler()->reserveInterrupt(sink,interruptSource);
*interruptID=interrupt.ID;
- interrupt.listInterrruptedSources=m_core->returnDatabaseHandler()->getSourceIDsForSinkID(sink);
+ interrupt.listInterruptedSources=m_core->returnDatabaseHandler()->getSourceIDsForSinkID(sink);
interrupt.connID=m_core->returnDatabaseHandler()->reserveMainConnection(interruptSource,sink);
interrupt.mixed=m_core->returnDatabaseHandler()->is_source_Mixed(interruptSource);
if (interrupt.mixed) {
DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Add task to change the volume on interrupt"));
- foreach(source_t sourceL,interrupt.listInterrruptedSources) {
+ foreach(source_t sourceL,interrupt.listInterruptedSources) {
DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Set volume change for source"),DLT_INT(sourceL));
TaskSetSourceVolume* volumetask=new TaskSetSourceVolume(m_core,INTERRUPT_VOLUME_LEVEL,sourceL);
queue->addTask(volumetask);
}
} else {
DLT_LOG(AudioManager,DLT_LOG_ERROR, DLT_STRING("Add task to switch off sources on interrupt"));
- foreach(source_t sourceL,interrupt.listInterrruptedSources) {
+ foreach(source_t sourceL,interrupt.listInterruptedSources) {
TaskSetSourceMute* mutetask=new TaskSetSourceMute(m_core,sourceL);
queue->addTask(mutetask);
}
TaskEnterUserConnect* enterConnect=new TaskEnterUserConnect(m_core,route,interrupt.connID);
queue->addTask(enterConnect);
- TaskEnterInterrupt* enterInteruppt=new TaskEnterInterrupt(m_core,interrupt.ID,m_core->returnDatabaseHandler()->is_source_Mixed(interruptSource),interrupt.connID,interrupt.listInterrruptedSources);
+ TaskEnterInterrupt* enterInteruppt=new TaskEnterInterrupt(m_core,interrupt.ID,m_core->returnDatabaseHandler()->is_source_Mixed(interruptSource),interrupt.connID,interrupt.listInterruptedSources);
queue->addTask(enterInteruppt);
TaskInterruptWait* interruptWait=new TaskInterruptWait(m_core,interrupt.ID);
queue->addTask(disconnect);
}
if (interrupt.mixed) {
- foreach(source_t sourceL,interrupt.listInterrruptedSources) {
+ foreach(source_t sourceL,interrupt.listInterruptedSources) {
TaskSetSourceVolume* volumetask=new TaskSetSourceVolume(m_core,NORMAL_VOLUME_LEVEL,sourceL);
queue->addTask(volumetask);
}
} else {
- foreach(source_t sourceL,interrupt.listInterrruptedSources) {
+ foreach(source_t sourceL,interrupt.listInterruptedSources) {
TaskSetSourceUnmute* unmutetask=new TaskSetSourceUnmute(m_core,sourceL);
queue->addTask(unmutetask);
}