2018-11-04 14:38:39 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* plugins/VOIP/gui/AudioInputConfig.h *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2005-2010 Thorvald Natvig <thorvald@natvig.com> *
|
|
|
|
* Copyright (C) 2012 by Retroshare Team <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
|
|
|
#pragma once
|
2015-05-11 15:40:07 -04:00
|
|
|
#pragma once
|
2012-02-15 16:17:18 -05:00
|
|
|
|
|
|
|
#include <QAudioInput>
|
|
|
|
#include <QWidget>
|
|
|
|
|
2012-02-18 10:56:37 -05:00
|
|
|
#include "retroshare-gui/configpage.h"
|
|
|
|
|
|
|
|
#include "SpeexProcessor.h"
|
2014-07-13 09:57:25 -04:00
|
|
|
#include "VideoProcessor.h"
|
2012-02-15 16:17:18 -05:00
|
|
|
#include "AudioStats.h"
|
2015-08-07 21:40:48 -04:00
|
|
|
#include "gui/common/RSGraphWidget.h"
|
|
|
|
|
|
|
|
class voipGraphSource ;
|
|
|
|
|
|
|
|
class voipGraph: public RSGraphWidget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
voipGraph(QWidget *parent) ;
|
|
|
|
|
|
|
|
voipGraphSource *voipSource() const { return _src ; }
|
|
|
|
|
|
|
|
void setVoipSource(voipGraphSource *gs) ;
|
|
|
|
|
|
|
|
private:
|
|
|
|
voipGraphSource *_src ;
|
|
|
|
};
|
|
|
|
|
|
|
|
#include "ui_AudioInputConfig.h"
|
2012-02-15 16:17:18 -05:00
|
|
|
|
2012-02-18 10:56:37 -05:00
|
|
|
class AudioInputConfig : public ConfigPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2012-02-15 16:17:18 -05:00
|
|
|
|
2012-02-18 10:56:37 -05:00
|
|
|
private:
|
|
|
|
Ui::AudioInput ui;
|
2014-07-13 09:57:25 -04:00
|
|
|
QAudioInput* inputAudioDevice;
|
|
|
|
QtSpeex::SpeexInputProcessor* inputAudioProcessor;
|
2012-02-18 10:56:37 -05:00
|
|
|
AudioBar* abSpeech;
|
2014-07-13 09:57:25 -04:00
|
|
|
//VideoDecoder *videoDecoder ;
|
|
|
|
//VideoEncoder *videoEncoder ;
|
|
|
|
QVideoInputDevice *videoInput ;
|
2015-08-14 16:44:20 -04:00
|
|
|
VideoProcessor *videoProcessor ;
|
2012-02-18 10:56:37 -05:00
|
|
|
bool loaded;
|
2012-02-15 16:17:18 -05:00
|
|
|
|
2015-08-07 21:40:48 -04:00
|
|
|
voipGraphSource *graph_source ;
|
2012-02-15 16:17:18 -05:00
|
|
|
|
2012-02-18 10:56:37 -05:00
|
|
|
protected:
|
|
|
|
QTimer *qtTick;
|
|
|
|
/*void hideEvent(QHideEvent *event);
|
|
|
|
void showEvent(QShowEvent *event);*/
|
2012-02-15 16:17:18 -05:00
|
|
|
|
|
|
|
public:
|
2012-02-18 10:56:37 -05:00
|
|
|
/** Default Constructor */
|
2013-10-18 17:10:33 -04:00
|
|
|
AudioInputConfig(QWidget * parent = 0, Qt::WindowFlags flags = 0);
|
2012-02-18 10:56:37 -05:00
|
|
|
/** Default Destructor */
|
|
|
|
~AudioInputConfig();
|
|
|
|
|
|
|
|
/** Saves the changes on this page */
|
|
|
|
virtual bool save(QString &errmsg);
|
|
|
|
/** Loads the settings for this page */
|
|
|
|
virtual void load();
|
|
|
|
|
|
|
|
virtual QPixmap iconPixmap() const { return QPixmap(":/images/talking_on.svg") ; }
|
|
|
|
virtual QString pageName() const { return tr("VOIP") ; }
|
2013-10-09 05:31:40 -04:00
|
|
|
virtual QString helpText() const { return ""; }
|
2015-08-24 21:15:33 -04:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateAvailableBW(double r);
|
2012-02-18 10:56:37 -05:00
|
|
|
void loadSettings();
|
|
|
|
void emptyBuffer();
|
2015-08-09 18:09:17 -04:00
|
|
|
void togglePreview(bool) ;
|
2012-02-18 10:56:37 -05:00
|
|
|
|
|
|
|
void on_qsTransmitHold_valueChanged(int v);
|
|
|
|
void on_qsAmp_valueChanged(int v);
|
|
|
|
void on_qsNoise_valueChanged(int v);
|
|
|
|
void on_qcbTransmit_currentIndexChanged(int v);
|
|
|
|
void on_Tick_timeout();
|
|
|
|
void on_qpbAudioWizard_clicked();
|
|
|
|
void on_qcbEchoCancel_clicked();
|
2012-02-15 16:17:18 -05:00
|
|
|
};
|