/* 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_session.h" #include "ui/effects/animations.h" #include "base/timer.h" namespace style { struct Checkbox; struct Radio; } // namespace style namespace Calls { class Call; } // namespace Calls namespace Ui { class LevelMeter; class GenericBox; class Show; } // namespace Ui namespace Webrtc { class AudioInputTester; class VideoTrack; } // namespace Webrtc namespace Settings { class Calls : public Section { public: Calls(QWidget *parent, not_null controller); ~Calls(); [[nodiscard]] rpl::producer title() override; void sectionSaveChanges(FnMut done) override; static Webrtc::VideoTrack *AddCameraSubsection( std::shared_ptr show, not_null content, bool saveToSettings); private: void setupContent(); void requestPermissionAndStartTestingMicrophone(); void startTestingMicrophone(); const not_null _controller; rpl::event_stream _cameraNameStream; rpl::event_stream _outputNameStream; rpl::event_stream _inputNameStream; std::unique_ptr _micTester; Ui::LevelMeter *_micTestLevel = nullptr; float _micLevel = 0.; Ui::Animations::Simple _micLevelAnimation; base::Timer _levelUpdateTimer; }; inline constexpr auto kMicTestUpdateInterval = crl::time(100); inline constexpr auto kMicTestAnimationDuration = crl::time(200); [[nodiscard]] QString CurrentAudioOutputName(); [[nodiscard]] QString CurrentAudioInputName(); [[nodiscard]] object_ptr ChooseAudioOutputBox( Fn chosen, const style::Checkbox *st = nullptr, const style::Radio *radioSt = nullptr); [[nodiscard]] object_ptr ChooseAudioInputBox( Fn chosen, const style::Checkbox *st = nullptr, const style::Radio *radioSt = nullptr); //[[nodiscard]] object_ptr ChooseAudioBackendBox( // const style::Checkbox *st = nullptr, // const style::Radio *radioSt = nullptr); } // namespace Settings