Lets test preprocessors

This commit is contained in:
Joao Mesquita 2010-04-08 23:15:29 -03:00
parent bec8d75ef6
commit 2666a40a12
7 changed files with 1173 additions and 973 deletions

View File

@ -179,10 +179,26 @@ void MainWindow::debugConsoleTriggered()
} }
void MainWindow::applyPreprocessors(QStringList cmds)
{
if (g_FSHost.getCurrentActiveCall().isNull()) return;
QString uuid = g_FSHost.getCurrentActiveCall().data()->getUuid();
foreach(QString cmd, cmds)
{
switch_stream_handle_t stream = { 0 };
SWITCH_STANDARD_STREAM(stream);
switch_api_execute("uuid_preprocess", QString("%1 %2").arg(uuid, cmd).toAscii().data(), NULL, &stream);
switch_safe_free(stream.data);
}
}
void MainWindow::prefTriggered() void MainWindow::prefTriggered()
{ {
if (!preferences) if (!preferences)
{
preferences = new PrefDialog(); preferences = new PrefDialog();
connect(preferences, SIGNAL(preprocessorsApplied(QStringList)), this, SLOT(applyPreprocessors(QStringList)));
}
preferences->raise(); preferences->raise();
preferences->show(); preferences->show();

View File

@ -85,6 +85,7 @@ private slots:
void updateCallTimers(); void updateCallTimers();
void debugConsoleTriggered(); void debugConsoleTriggered();
void debugEventsTriggered(); void debugEventsTriggered();
void applyPreprocessors(QStringList);
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;

View File

@ -15,6 +15,7 @@ PrefDialog::PrefDialog(QWidget *parent) :
_pref_accounts = new PrefAccounts(ui); _pref_accounts = new PrefAccounts(ui);
_mod_portaudio = new PrefPortaudio(ui, this); _mod_portaudio = new PrefPortaudio(ui, this);
connect(_mod_portaudio, SIGNAL(preprocessorsApplied(QStringList)), this, SIGNAL(preprocessorsApplied(QStringList)));
_mod_sofia = new PrefSofia(ui, this); _mod_sofia = new PrefSofia(ui, this);
readConfig(); readConfig();
} }

View File

@ -26,6 +26,9 @@ protected:
private slots: private slots:
void writeConfig(); void writeConfig();
signals:
void preprocessorsApplied(QStringList);
private: private:
void readConfig(); void readConfig();
QSettings *_settings; QSettings *_settings;

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,28 @@ PrefPortaudio::PrefPortaudio(Ui::PrefDialog *ui, QObject *parent) :
connect(_ui->PaRingdevTestBtn, SIGNAL(clicked()), this, SLOT(ringdevTest())); connect(_ui->PaRingdevTestBtn, SIGNAL(clicked()), this, SLOT(ringdevTest()));
connect(_ui->PaLoopTestBtn, SIGNAL(clicked()), this, SLOT(loopTest())); connect(_ui->PaLoopTestBtn, SIGNAL(clicked()), this, SLOT(loopTest()));
connect(_ui->PaRefreshDevListBtn, SIGNAL(clicked()), this, SLOT(refreshDevList())); connect(_ui->PaRefreshDevListBtn, SIGNAL(clicked()), this, SLOT(refreshDevList()));
connect(_ui->btnApplyPreprocessor, SIGNAL(toggled(bool)), this, SLOT(applyPreprocessors(bool)));
}
void PrefPortaudio::applyPreprocessors(bool state)
{
QStringList cmds;
if (!state)
{
cmds.append("stop");
}
else
{
if (_ui->checkAECRead->isChecked()) cmds.append(QString("recho_cancel=%1").arg(_ui->spinAECTail->value()));
if (_ui->checkAECWrite->isChecked()) cmds.append(QString("wecho_cancel=%1").arg(_ui->spinAECTail->value()));
if (_ui->checkESRead->isChecked()) cmds.append(QString("recho_suppress=%1").arg(_ui->spinESDb->value()));
if (_ui->checkESWrite->isChecked()) cmds.append(QString("wecho_suppress=%1").arg(_ui->spinESDb->value()));
if (_ui->checkNSRead->isChecked()) cmds.append(QString("rnoise_suppress=%1").arg(_ui->spinNSDb->value()));
if (_ui->checkNSWrite->isChecked()) cmds.append(QString("wnoise_suppress=%1").arg(_ui->spinNSDb->value()));
if (_ui->checkAGCRead->isChecked()) cmds.append(QString("ragc=%1").arg(_ui->spinAGC->value()));
if (_ui->checkAGCWrite->isChecked()) cmds.append(QString("wagc=%1").arg(_ui->spinAGC->value()));
}
emit preprocessorsApplied(cmds);
} }
void PrefPortaudio::ringdevTest() void PrefPortaudio::ringdevTest()

View File

@ -24,6 +24,11 @@ private slots:
void ringdevTest(); void ringdevTest();
void loopTest(); void loopTest();
void refreshDevList(); void refreshDevList();
void applyPreprocessors(bool);
signals:
void preprocessorsApplied(QStringList);
private: private:
void getPaDevlist(void); void getPaDevlist(void);
QSettings *_settings; QSettings *_settings;