forked from Mirrors/freeswitch
Lets test preprocessors
This commit is contained in:
parent
bec8d75ef6
commit
2666a40a12
|
@ -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()
|
||||
{
|
||||
if (!preferences)
|
||||
{
|
||||
preferences = new PrefDialog();
|
||||
connect(preferences, SIGNAL(preprocessorsApplied(QStringList)), this, SLOT(applyPreprocessors(QStringList)));
|
||||
}
|
||||
|
||||
preferences->raise();
|
||||
preferences->show();
|
||||
|
|
|
@ -85,6 +85,7 @@ private slots:
|
|||
void updateCallTimers();
|
||||
void debugConsoleTriggered();
|
||||
void debugEventsTriggered();
|
||||
void applyPreprocessors(QStringList);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
|
|
@ -15,6 +15,7 @@ PrefDialog::PrefDialog(QWidget *parent) :
|
|||
|
||||
_pref_accounts = new PrefAccounts(ui);
|
||||
_mod_portaudio = new PrefPortaudio(ui, this);
|
||||
connect(_mod_portaudio, SIGNAL(preprocessorsApplied(QStringList)), this, SIGNAL(preprocessorsApplied(QStringList)));
|
||||
_mod_sofia = new PrefSofia(ui, this);
|
||||
readConfig();
|
||||
}
|
||||
|
|
|
@ -26,6 +26,9 @@ protected:
|
|||
private slots:
|
||||
void writeConfig();
|
||||
|
||||
signals:
|
||||
void preprocessorsApplied(QStringList);
|
||||
|
||||
private:
|
||||
void readConfig();
|
||||
QSettings *_settings;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -15,6 +15,28 @@ PrefPortaudio::PrefPortaudio(Ui::PrefDialog *ui, QObject *parent) :
|
|||
connect(_ui->PaRingdevTestBtn, SIGNAL(clicked()), this, SLOT(ringdevTest()));
|
||||
connect(_ui->PaLoopTestBtn, SIGNAL(clicked()), this, SLOT(loopTest()));
|
||||
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()
|
||||
|
|
|
@ -24,6 +24,11 @@ private slots:
|
|||
void ringdevTest();
|
||||
void loopTest();
|
||||
void refreshDevList();
|
||||
void applyPreprocessors(bool);
|
||||
|
||||
signals:
|
||||
void preprocessorsApplied(QStringList);
|
||||
|
||||
private:
|
||||
void getPaDevlist(void);
|
||||
QSettings *_settings;
|
||||
|
|
Loading…
Reference in New Issue