/* 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 initPlaybackButton( not_null container, rpl::producer text, rpl::producer resolvedId, Fn set); void initCaptureButton( not_null container, rpl::producer text, rpl::producer resolvedId, Fn set); const not_null _controller; rpl::event_stream _cameraNameStream; rpl::variable _testingMicrophone; }; inline constexpr auto kMicTestUpdateInterval = crl::time(100); inline constexpr auto kMicTestAnimationDuration = crl::time(200); [[nodiscard]] rpl::producer PlaybackDeviceNameValue( rpl::producer id); [[nodiscard]] rpl::producer CaptureDeviceNameValue( rpl::producer id); [[nodiscard]] rpl::producer CameraDeviceNameValue( rpl::producer id); [[nodiscard]] object_ptr ChoosePlaybackDeviceBox( rpl::producer currentId, Fn chosen, const style::Checkbox *st = nullptr, const style::Radio *radioSt = nullptr); [[nodiscard]] object_ptr ChooseCaptureDeviceBox( rpl::producer currentId, Fn chosen, const style::Checkbox *st = nullptr, const style::Radio *radioSt = nullptr); [[nodiscard]] object_ptr ChooseCameraDeviceBox( rpl::producer currentId, Fn chosen, const style::Checkbox *st = nullptr, const style::Radio *radioSt = nullptr); } // namespace Settings