From c4fbd3a4f51c4364ada787235edb788d65266ffc Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 12 May 2021 21:44:25 +0200 Subject: [PATCH] renamed AudioInputConfig into VOIPConfigPanel --- plugins/VOIP/VOIP.pro | 7 +++-- plugins/VOIP/VOIPPlugin.cpp | 4 +-- plugins/VOIP/gui/AudioStats.cpp | 2 +- ...dioInputConfig.cpp => VOIPConfigPanel.cpp} | 30 +++++++++---------- .../{AudioInputConfig.h => VOIPConfigPanel.h} | 6 ++-- ...AudioInputConfig.ui => VOIPConfigPanel.ui} | 0 6 files changed, 25 insertions(+), 24 deletions(-) rename plugins/VOIP/gui/{AudioInputConfig.cpp => VOIPConfigPanel.cpp} (93%) rename plugins/VOIP/gui/{AudioInputConfig.h => VOIPConfigPanel.h} (96%) rename plugins/VOIP/gui/{AudioInputConfig.ui => VOIPConfigPanel.ui} (100%) diff --git a/plugins/VOIP/VOIP.pro b/plugins/VOIP/VOIP.pro index 7dac8b2d9..3f675c1a1 100644 --- a/plugins/VOIP/VOIP.pro +++ b/plugins/VOIP/VOIP.pro @@ -86,9 +86,9 @@ QMAKE_CXXFLAGS += -D__STDC_CONSTANT_MACROS QMAKE_CXXFLAGS *= -Wall SOURCES = VOIPPlugin.cpp \ + gui/VOIPConfigPanel.cpp \ services/p3VOIP.cc \ services/rsVOIPItems.cc \ - gui/AudioInputConfig.cpp \ gui/AudioStats.cpp \ gui/AudioWizard.cpp \ gui/SpeexProcessor.cpp \ @@ -102,9 +102,9 @@ SOURCES = VOIPPlugin.cpp \ gui/VOIPToasterNotify.cpp HEADERS = VOIPPlugin.h \ + gui/VOIPConfigPanel.h \ services/p3VOIP.h \ services/rsVOIPItems.h \ - gui/AudioInputConfig.h \ gui/AudioStats.h \ gui/AudioWizard.h \ gui/SpeexProcessor.h \ @@ -118,9 +118,10 @@ HEADERS = VOIPPlugin.h \ gui/VOIPToasterNotify.h \ interface/rsVOIP.h -FORMS = gui/AudioInputConfig.ui \ +FORMS = \ gui/AudioStats.ui \ gui/AudioWizard.ui \ + gui/VOIPConfigPanel.ui \ gui/VOIPToasterItem.ui TARGET = VOIP diff --git a/plugins/VOIP/VOIPPlugin.cpp b/plugins/VOIP/VOIPPlugin.cpp index 2f6f0d2e1..75719e156 100644 --- a/plugins/VOIP/VOIPPlugin.cpp +++ b/plugins/VOIP/VOIPPlugin.cpp @@ -31,7 +31,7 @@ #include "VOIPPlugin.h" #include "interface/rsVOIP.h" -#include "gui/AudioInputConfig.h" +#include "gui/VOIPConfigPanel.h" #include "gui/VOIPChatWidgetHolder.h" #include "gui/VOIPGUIHandler.h" #include "gui/VOIPNotify.h" @@ -112,7 +112,7 @@ ConfigPage *VOIPPlugin::qt_config_page() const // The config pages are deleted when config is closed, so it's important not to static the // created object. // - return new AudioInputConfig() ; + return new VOIPConfigPanel() ; } QDialog *VOIPPlugin::qt_about_page() const diff --git a/plugins/VOIP/gui/AudioStats.cpp b/plugins/VOIP/gui/AudioStats.cpp index 536cf0a1d..96ea93b83 100644 --- a/plugins/VOIP/gui/AudioStats.cpp +++ b/plugins/VOIP/gui/AudioStats.cpp @@ -25,7 +25,7 @@ #include #include "AudioStats.h" -#include "AudioInputConfig.h" +#include "VOIPConfigPanel.h" //#include "Global.h" //#include "smallft.h" diff --git a/plugins/VOIP/gui/AudioInputConfig.cpp b/plugins/VOIP/gui/VOIPConfigPanel.cpp similarity index 93% rename from plugins/VOIP/gui/AudioInputConfig.cpp rename to plugins/VOIP/gui/VOIPConfigPanel.cpp index b063d5e48..d776d8abd 100644 --- a/plugins/VOIP/gui/AudioInputConfig.cpp +++ b/plugins/VOIP/gui/VOIPConfigPanel.cpp @@ -80,7 +80,7 @@ voipGraph::voipGraph(QWidget *parent) } /** Constructor */ -AudioInputConfig::AudioInputConfig(QWidget * parent, Qt::WindowFlags flags) +VOIPConfigPanel::VOIPConfigPanel(QWidget * parent, Qt::WindowFlags flags) : ConfigPage(parent, flags) { std::cerr << "Creating audioInputConfig object" << std::endl; @@ -118,13 +118,13 @@ AudioInputConfig::AudioInputConfig(QWidget * parent, Qt::WindowFlags flags) QObject::connect(ui.availableBW_SB,SIGNAL(valueChanged(double)),this,SLOT(updateAvailableBW(double))) ; } -void AudioInputConfig::updateAvailableBW(double r) +void VOIPConfigPanel::updateAvailableBW(double r) { std::cerr << "Setting max bandwidth to " << r << " KB/s" << std::endl; videoProcessor->setMaximumBandwidth((uint32_t)(r*1024)) ; } -void AudioInputConfig::togglePreview(bool b) +void VOIPConfigPanel::togglePreview(bool b) { if(b) { @@ -138,7 +138,7 @@ void AudioInputConfig::togglePreview(bool b) } } -AudioInputConfig::~AudioInputConfig() +VOIPConfigPanel::~VOIPConfigPanel() { disconnect( qtTick, SIGNAL( timeout ( ) ), this, SLOT( on_Tick_timeout() ) ); @@ -166,7 +166,7 @@ AudioInputConfig::~AudioInputConfig() } /** Loads the settings for this page */ -void AudioInputConfig::load() +void VOIPConfigPanel::load() { //connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) ); //connect( ui.allowTunnelConnectionCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTunnelConnection(bool) ) ); @@ -199,7 +199,7 @@ void AudioInputConfig::load() } -void AudioInputConfig::loadSettings() { +void VOIPConfigPanel::loadSettings() { /*QList keys; if (AudioInputRegistrar::qmNew) @@ -258,7 +258,7 @@ void AudioInputConfig::loadSettings() { videoInput->start() ; } -bool AudioInputConfig::save(QString &/*errmsg*/) {//mainly useless beacause saving occurs in realtime +bool VOIPConfigPanel::save(QString &/*errmsg*/) {//mainly useless beacause saving occurs in realtime //s.iQuality = qsQuality->value(); rsVOIP->setVoipiNoiseSuppress((ui.qsNoise->value() == 14) ? 0 : - ui.qsNoise->value()); rsVOIP->setVoipiMinLoudness(20000 - ui.qsAmp->value()); @@ -272,14 +272,14 @@ bool AudioInputConfig::save(QString &/*errmsg*/) {//mainly useless beacause savi return true; } -void AudioInputConfig::on_qsTransmitHold_valueChanged(int v) { +void VOIPConfigPanel::on_qsTransmitHold_valueChanged(int v) { float val = static_cast(v * FRAME_SIZE); val = val / SAMPLING_RATE; ui.qlTransmitHold->setText(tr("%1 s").arg(val, 0, 'f', 2)); rsVOIP->setVoipVoiceHold(v); } -void AudioInputConfig::on_qsNoise_valueChanged(int v) { +void VOIPConfigPanel::on_qsNoise_valueChanged(int v) { QPalette pal; if (v < 15) { @@ -292,19 +292,19 @@ void AudioInputConfig::on_qsNoise_valueChanged(int v) { rsVOIP->setVoipiNoiseSuppress(- ui.qsNoise->value()); } -void AudioInputConfig::on_qsAmp_valueChanged(int v) { +void VOIPConfigPanel::on_qsAmp_valueChanged(int v) { v = 20000 - v; float d = 20000.0f/static_cast(v); ui.qlAmp->setText(QString::fromLatin1("%1").arg(d, 0, 'f', 2)); rsVOIP->setVoipiMinLoudness(20000 - ui.qsAmp->value()); } -void AudioInputConfig::on_qcbEchoCancel_clicked() { +void VOIPConfigPanel::on_qcbEchoCancel_clicked() { rsVOIP->setVoipEchoCancel(ui.qcbEchoCancel->isChecked()); } -void AudioInputConfig::on_qcbTransmit_currentIndexChanged(int v) { +void VOIPConfigPanel::on_qcbTransmit_currentIndexChanged(int v) { switch (v) { case 0: ui.qswTransmit->setCurrentWidget(ui.qwContinuous); @@ -321,7 +321,7 @@ void AudioInputConfig::on_qcbTransmit_currentIndexChanged(int v) { } -void AudioInputConfig::on_Tick_timeout() +void VOIPConfigPanel::on_Tick_timeout() { if (!inputAudioProcessor) { @@ -356,13 +356,13 @@ void AudioInputConfig::on_Tick_timeout() } } -void AudioInputConfig::emptyBuffer() { +void VOIPConfigPanel::emptyBuffer() { while(inputAudioProcessor->hasPendingPackets()) { inputAudioProcessor->getNetworkPacket(); //that will purge the buffer } } -void AudioInputConfig::on_qpbAudioWizard_clicked() { +void VOIPConfigPanel::on_qpbAudioWizard_clicked() { AudioWizard aw(this); aw.exec(); loadSettings(); diff --git a/plugins/VOIP/gui/AudioInputConfig.h b/plugins/VOIP/gui/VOIPConfigPanel.h similarity index 96% rename from plugins/VOIP/gui/AudioInputConfig.h rename to plugins/VOIP/gui/VOIPConfigPanel.h index 3dd2cecae..bcee0a4d6 100644 --- a/plugins/VOIP/gui/AudioInputConfig.h +++ b/plugins/VOIP/gui/VOIPConfigPanel.h @@ -48,7 +48,7 @@ private: #include "ui_AudioInputConfig.h" -class AudioInputConfig : public ConfigPage +class VOIPConfigPanel : public ConfigPage { Q_OBJECT @@ -72,9 +72,9 @@ class AudioInputConfig : public ConfigPage public: /** Default Constructor */ - AudioInputConfig(QWidget * parent = 0, Qt::WindowFlags flags = 0); + VOIPConfigPanel(QWidget * parent = 0, Qt::WindowFlags flags = 0); /** Default Destructor */ - ~AudioInputConfig(); + ~VOIPConfigPanel(); /** Saves the changes on this page */ virtual bool save(QString &errmsg); diff --git a/plugins/VOIP/gui/AudioInputConfig.ui b/plugins/VOIP/gui/VOIPConfigPanel.ui similarity index 100% rename from plugins/VOIP/gui/AudioInputConfig.ui rename to plugins/VOIP/gui/VOIPConfigPanel.ui