2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Move call management to Core::App.

This commit is contained in:
John Preston
2020-06-25 21:57:36 +04:00
parent 8c4d3a86e7
commit 79a361ba43
23 changed files with 204 additions and 167 deletions

View File

@@ -135,7 +135,7 @@ void Calls::setupContent() {
Core::App().settings().setCallOutputDeviceID(
QString::fromStdString(deviceId));
_controller->session().saveSettingsDelayed();
if (const auto call = _controller->session().calls().currentCall()) {
if (const auto call = Core::App().calls().currentCall()) {
call->setCurrentAudioDevice(false, deviceId);
}
});
@@ -165,7 +165,7 @@ void Calls::setupContent() {
_needWriteSettings = true;
updateOutputLabel(value);
Core::App().settings().setCallOutputVolume(value);
if (const auto call = _controller->session().calls().currentCall()) {
if (const auto call = Core::App().calls().currentCall()) {
call->setAudioVolume(false, value / 100.0f);
}
};
@@ -214,7 +214,7 @@ void Calls::setupContent() {
if (_micTester) {
stopTestingMicrophone();
}
if (const auto call = _controller->session().calls().currentCall()) {
if (const auto call = Core::App().calls().currentCall()) {
call->setCurrentAudioDevice(true, deviceId);
}
});
@@ -244,7 +244,7 @@ void Calls::setupContent() {
_needWriteSettings = true;
updateInputLabel(value);
Core::App().settings().setCallInputVolume(value);
if (const auto call = _controller->session().calls().currentCall()) {
if (const auto call = Core::App().calls().currentCall()) {
call->setAudioVolume(true, value / 100.0f);
}
};
@@ -299,7 +299,7 @@ void Calls::setupContent() {
}) | rpl::start_with_next([=](bool enabled) {
Core::App().settings().setCallAudioDuckingEnabled(enabled);
Core::App().saveSettingsDelayed();
if (const auto call = _controller->session().calls().currentCall()) {
if (const auto call = Core::App().calls().currentCall()) {
call->setAudioDuckingEnabled(enabled);
}
}, content->lifetime());