2014-09-15 18:45:59 +08:00
|
|
|
/*
|
2015-06-06 09:40:08 +08:00
|
|
|
Copyright © 2014-2015 by The qTox Project
|
|
|
|
|
2014-09-15 18:45:59 +08:00
|
|
|
This file is part of qTox, a Qt-based graphical interface for Tox.
|
|
|
|
|
2015-06-06 09:40:08 +08:00
|
|
|
qTox is libre software: you can redistribute it and/or modify
|
2014-09-15 18:45:59 +08:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2015-06-06 09:40:08 +08:00
|
|
|
|
|
|
|
qTox is distributed in the hope that it will be useful,
|
2014-09-15 18:45:59 +08:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-06-06 09:40:08 +08:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2014-09-15 18:45:59 +08:00
|
|
|
|
2015-06-06 09:40:08 +08:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with qTox. If not, see <http://www.gnu.org/licenses/>.
|
2014-09-15 18:45:59 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AVFORM_H
|
|
|
|
#define AVFORM_H
|
|
|
|
|
2015-05-14 10:46:28 +08:00
|
|
|
#include <QObject>
|
2015-06-06 03:37:01 +08:00
|
|
|
#include <QString>
|
2015-05-14 10:46:28 +08:00
|
|
|
#include <QList>
|
2014-09-15 18:45:59 +08:00
|
|
|
#include "genericsettings.h"
|
2015-05-16 10:01:38 +08:00
|
|
|
#include "src/video/videomode.h"
|
2014-10-06 00:17:01 +08:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class AVSettings;
|
|
|
|
}
|
|
|
|
|
2015-05-14 10:46:28 +08:00
|
|
|
class CameraSource;
|
|
|
|
class VideoSurface;
|
2014-09-15 18:45:59 +08:00
|
|
|
|
2015-06-26 21:12:45 +08:00
|
|
|
class AVForm : public GenericForm
|
2014-09-15 18:45:59 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-10-08 20:25:32 +08:00
|
|
|
AVForm();
|
2014-09-15 18:45:59 +08:00
|
|
|
~AVForm();
|
2015-12-10 13:48:28 +08:00
|
|
|
QString getFormName() final override {return tr("Audio/Video");}
|
2014-09-15 18:45:59 +08:00
|
|
|
|
2014-10-29 03:47:20 +08:00
|
|
|
private:
|
|
|
|
void getAudioInDevices();
|
|
|
|
void getAudioOutDevices();
|
2015-05-14 10:46:28 +08:00
|
|
|
void getVideoDevices();
|
2014-10-06 00:17:01 +08:00
|
|
|
|
2015-05-10 06:03:05 +08:00
|
|
|
void createVideoSurface();
|
|
|
|
void killVideoSurface();
|
|
|
|
|
2015-06-06 03:37:01 +08:00
|
|
|
void retranslateUi();
|
|
|
|
|
2014-10-29 03:47:20 +08:00
|
|
|
private slots:
|
2014-10-22 18:59:48 +08:00
|
|
|
|
2014-10-29 04:21:37 +08:00
|
|
|
// audio
|
2015-11-08 01:23:10 +08:00
|
|
|
void onInDevChanged(QString deviceDescriptor);
|
|
|
|
void onOutDevChanged(QString deviceDescriptor);
|
2014-12-14 16:50:18 +08:00
|
|
|
void onFilterAudioToggled(bool filterAudio);
|
2015-11-08 20:40:32 +08:00
|
|
|
void onPlaybackValueChanged(int value);
|
|
|
|
void onMicrophoneValueChanged(int value);
|
2014-10-29 04:21:37 +08:00
|
|
|
|
2014-10-22 18:59:48 +08:00
|
|
|
// camera
|
2015-05-14 10:46:28 +08:00
|
|
|
void onVideoDevChanged(int index);
|
2015-10-11 14:58:36 +08:00
|
|
|
void onVideoModesIndexChanged(int index);
|
2014-10-06 00:17:01 +08:00
|
|
|
|
2016-01-17 18:34:50 +08:00
|
|
|
void on_btnPlayTestSound_clicked(bool checked);
|
|
|
|
|
2015-03-16 04:29:23 +08:00
|
|
|
protected:
|
2015-05-16 10:01:38 +08:00
|
|
|
void updateVideoModes(int curIndex);
|
2014-12-25 20:29:42 +08:00
|
|
|
|
2015-12-10 13:48:28 +08:00
|
|
|
private:
|
|
|
|
bool eventFilter(QObject *o, QEvent *e) final override;
|
|
|
|
|
|
|
|
void hideEvent(QHideEvent* event) final override;
|
|
|
|
void showEvent(QShowEvent*event) final override;
|
|
|
|
|
2014-09-15 18:45:59 +08:00
|
|
|
private:
|
2014-10-06 00:17:01 +08:00
|
|
|
Ui::AVSettings *bodyUI;
|
2015-12-10 13:48:28 +08:00
|
|
|
bool subscribedToAudioIn;
|
2016-01-17 18:34:50 +08:00
|
|
|
bool mPlayTestSound;
|
2015-11-08 22:50:09 +08:00
|
|
|
VideoSurface *camVideoSurface;
|
|
|
|
CameraSource &camera;
|
2015-05-14 10:46:28 +08:00
|
|
|
QVector<QPair<QString, QString>> videoDeviceList;
|
2015-05-16 10:01:38 +08:00
|
|
|
QVector<VideoMode> videoModes;
|
2014-09-15 18:45:59 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|