1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/src/widget/form/settings/avform.h

89 lines
2.2 KiB
C
Raw Normal View History

/*
Copyright © 2014-2015 by The qTox Project
This file is part of qTox, a Qt-based graphical interface for Tox.
qTox is libre software: you can redistribute it and/or modify
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.
qTox 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AVFORM_H
#define AVFORM_H
2015-05-14 10:46:28 +08:00
#include <QObject>
#include <QString>
2015-05-14 10:46:28 +08:00
#include <QList>
#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;
2015-06-26 21:12:45 +08:00
class AVForm : public GenericForm
{
Q_OBJECT
public:
2014-10-08 20:25:32 +08:00
AVForm();
~AVForm();
QString getFormName() final override {return tr("Audio/Video");}
private:
void getAudioInDevices();
void getAudioOutDevices();
2015-05-14 10:46:28 +08:00
void getVideoDevices();
2014-10-06 00:17:01 +08:00
void createVideoSurface();
void killVideoSurface();
void retranslateUi();
private slots:
2014-10-29 04:21:37 +08:00
// audio
void onInDevChanged(QString deviceDescriptor);
void onOutDevChanged(QString deviceDescriptor);
void onFilterAudioToggled(bool filterAudio);
void onPlaybackValueChanged(int value);
void onMicrophoneValueChanged(int value);
2014-10-29 04:21:37 +08:00
// camera
2015-05-14 10:46:28 +08:00
void onVideoDevChanged(int index);
void onVideoModesIndexChanged(int index);
2014-10-06 00:17:01 +08:00
void on_btnPlayTestSound_clicked(bool checked);
protected:
2015-05-16 10:01:38 +08:00
void updateVideoModes(int curIndex);
2014-12-25 20:29:42 +08:00
private:
bool eventFilter(QObject *o, QEvent *e) final override;
void hideEvent(QHideEvent* event) final override;
void showEvent(QShowEvent*event) final override;
private:
2014-10-06 00:17:01 +08:00
Ui::AVSettings *bodyUI;
bool subscribedToAudioIn;
bool mPlayTestSound;
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;
};
#endif