2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-25 03:37:11 +00:00

98 lines
2.6 KiB
C
Raw Normal View History

2019-01-05 14:08:02 +03: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_session.h"
#include "ui/effects/animations.h"
2019-01-05 14:08:02 +03:00
#include "base/timer.h"
namespace style {
struct Checkbox;
struct Radio;
} // namespace style
2019-01-05 14:08:02 +03:00
namespace Calls {
2019-07-24 16:00:30 +02:00
class Call;
2019-01-05 14:08:02 +03:00
} // namespace Calls
namespace Ui {
2019-07-24 16:00:30 +02:00
class LevelMeter;
class GenericBox;
class Show;
2019-07-24 16:00:30 +02:00
} // namespace Ui
2019-01-05 14:08:02 +03:00
namespace Webrtc {
2019-07-24 16:00:30 +02:00
class AudioInputTester;
class VideoTrack;
} // namespace Webrtc
2019-01-05 14:08:02 +03:00
namespace Settings {
class Calls : public Section<Calls> {
2019-01-05 14:08:02 +03:00
public:
2019-07-24 16:00:30 +02:00
Calls(QWidget *parent, not_null<Window::SessionController*> controller);
~Calls();
[[nodiscard]] rpl::producer<QString> title() override;
2019-07-24 16:00:30 +02:00
void sectionSaveChanges(FnMut<void()> done) override;
2019-01-05 14:08:02 +03:00
static Webrtc::VideoTrack *AddCameraSubsection(
std::shared_ptr<Ui::Show> show,
not_null<Ui::VerticalLayout*> content,
bool saveToSettings);
2019-01-05 14:08:02 +03:00
private:
void setupContent();
2019-01-05 14:08:02 +03:00
void requestPermissionAndStartTestingMicrophone();
2024-01-24 12:42:37 +04:00
void initPlaybackButton(
not_null<Ui::VerticalLayout*> container,
rpl::producer<QString> text,
rpl::producer<QString> resolvedId,
Fn<void(QString)> set);
void initCaptureButton(
not_null<Ui::VerticalLayout*> container,
rpl::producer<QString> text,
rpl::producer<QString> resolvedId,
Fn<void(QString)> set);
2019-01-05 14:08:02 +03:00
const not_null<Window::SessionController*> _controller;
rpl::event_stream<QString> _cameraNameStream;
2024-01-24 12:42:37 +04:00
rpl::variable<bool> _testingMicrophone;
2019-07-24 16:00:30 +02:00
2019-01-05 14:08:02 +03:00
};
2020-11-28 19:18:51 +03:00
inline constexpr auto kMicTestUpdateInterval = crl::time(100);
inline constexpr auto kMicTestAnimationDuration = crl::time(200);
[[nodiscard]] rpl::producer<QString> PlaybackDeviceNameValue(
rpl::producer<QString> id);
[[nodiscard]] rpl::producer<QString> CaptureDeviceNameValue(
rpl::producer<QString> id);
2024-01-24 12:42:37 +04:00
[[nodiscard]] rpl::producer<QString> CameraDeviceNameValue(
rpl::producer<QString> id);
[[nodiscard]] object_ptr<Ui::GenericBox> ChoosePlaybackDeviceBox(
rpl::producer<QString> currentId,
Fn<void(QString id)> chosen,
const style::Checkbox *st = nullptr,
const style::Radio *radioSt = nullptr);
[[nodiscard]] object_ptr<Ui::GenericBox> ChooseCaptureDeviceBox(
rpl::producer<QString> currentId,
Fn<void(QString id)> chosen,
const style::Checkbox *st = nullptr,
const style::Radio *radioSt = nullptr);
2024-01-24 12:42:37 +04:00
[[nodiscard]] object_ptr<Ui::GenericBox> ChooseCameraDeviceBox(
rpl::producer<QString> currentId,
Fn<void(QString id)> chosen,
const style::Checkbox *st = nullptr,
const style::Radio *radioSt = nullptr);
2020-11-28 19:18:51 +03:00
2019-01-05 14:08:02 +03:00
} // namespace Settings