tdesktop/Telegram/SourceFiles/settings/settings_calls.h

53 lines
1.2 KiB
C
Raw Normal View History

2019-01-05 11:08:02 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "settings/settings_common.h"
#include "base/timer.h"
namespace Calls {
2019-07-24 14:00:30 +00:00
class Call;
2019-01-05 11:08:02 +00:00
} // namespace Calls
namespace Ui {
2019-07-24 14:00:30 +00:00
class LevelMeter;
} // namespace Ui
2019-01-05 11:08:02 +00:00
namespace tgvoip {
2019-07-24 14:00:30 +00:00
class AudioInputTester;
} // namespace tgvoip
2019-01-05 11:08:02 +00:00
namespace Settings {
class Calls : public Section {
public:
2019-07-24 14:00:30 +00:00
Calls(QWidget *parent, not_null<Window::SessionController*> controller);
~Calls();
void sectionSaveChanges(FnMut<void()> done) override;
2019-01-05 11:08:02 +00:00
private:
void setupContent();
2019-01-05 11:08:02 +00:00
void requestPermissionAndStartTestingMicrophone();
void startTestingMicrophone();
void stopTestingMicrophone();
const not_null<Window::SessionController*> _controller;
2019-01-05 11:08:02 +00:00
rpl::event_stream<QString> _outputNameStream;
rpl::event_stream<QString> _inputNameStream;
rpl::event_stream<QString> _micTestTextStream;
bool _needWriteSettings = false;
std::unique_ptr<tgvoip::AudioInputTester> _micTester;
Ui::LevelMeter *_micTestLevel = nullptr;
base::Timer _levelUpdateTimer;
2019-07-24 14:00:30 +00:00
2019-01-05 11:08:02 +00:00
};
} // namespace Settings