diff --git a/src/avadapter.cpp b/src/avadapter.cpp index 541216c3304d400cfce8914121d61d393f0ecba8..9568fdba055a28181da75b5b23b88deeaf96159a 100644 --- a/src/avadapter.cpp +++ b/src/avadapter.cpp @@ -88,11 +88,12 @@ AvAdapter::shareEntireScreen(int screenNumber) return; QRect rect = screen->geometry(); - auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(), - rect.x(), - rect.y(), - rect.width() * screen->devicePixelRatio(), - rect.height() * screen->devicePixelRatio()); + auto resource = lrcInstance_->getCurrentCallModel() + ->getDisplay(getScreenNumber(), + rect.x(), + rect.y(), + rect.width() * screen->devicePixelRatio(), + rect.height() * screen->devicePixelRatio()); auto callId = lrcInstance_->getCurrentCallId(); lrcInstance_->getCurrentCallModel() ->requestMediaChange(callId, @@ -100,7 +101,8 @@ AvAdapter::shareEntireScreen(int screenNumber) resource, lrc::api::NewCallModel::MediaRequestType::SCREENSHARING, false); - set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); + set_currentRenderingDeviceType( + lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type); } void @@ -108,11 +110,11 @@ AvAdapter::shareAllScreens() { const auto arrangementRect = getAllScreensBoundingRect(); - auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(), - arrangementRect.x(), - arrangementRect.y(), - arrangementRect.width(), - arrangementRect.height()); + auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(), + arrangementRect.x(), + arrangementRect.y(), + arrangementRect.width(), + arrangementRect.height()); auto callId = lrcInstance_->getCurrentCallId(); lrcInstance_->getCurrentCallModel() ->requestMediaChange(callId, @@ -120,7 +122,8 @@ AvAdapter::shareAllScreens() resource, lrc::api::NewCallModel::MediaRequestType::SCREENSHARING, false); - set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); + set_currentRenderingDeviceType( + lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type); } void @@ -189,7 +192,7 @@ AvAdapter::shareFile(const QString& filePath) lrc::api::NewCallModel::MediaRequestType::FILESHARING, false); set_currentRenderingDeviceType( - lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); + lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type); } } @@ -203,11 +206,11 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig QTimer::singleShot(100, [=]() mutable { x = y = width = height = 0; xrectsel(&x, &y, &width, &height); - auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(), - x, - y, - width < 128 ? 128 : width, - height < 128 ? 128 : height); + auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(), + x, + y, + width < 128 ? 128 : width, + height < 128 ? 128 : height); auto callId = lrcInstance_->getCurrentCallId(); lrcInstance_->getCurrentCallModel() ->requestMediaChange(callId, @@ -216,14 +219,14 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig lrc::api::NewCallModel::MediaRequestType::SCREENSHARING, false); set_currentRenderingDeviceType( - lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); + lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type); }); #else - auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(), - x, - y, - width < 128 ? 128 : width, - height < 128 ? 128 : height); + auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(), + x, + y, + width < 128 ? 128 : width, + height < 128 ? 128 : height); auto callId = lrcInstance_->getCurrentCallId(); lrcInstance_->getCurrentCallModel() ->requestMediaChange(callId, @@ -231,7 +234,8 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig resource, lrc::api::NewCallModel::MediaRequestType::SCREENSHARING, false); - set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); + set_currentRenderingDeviceType( + lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type); #endif } diff --git a/src/calladapter.cpp b/src/calladapter.cpp index 153b7b40da6a3dca150d586e668163287445c2f6..23765f8002099233569ec95310619517b442cd1b 100644 --- a/src/calladapter.cpp +++ b/src/calladapter.cpp @@ -682,7 +682,8 @@ CallAdapter::saveConferenceSubcalls() const auto& currentConvId = lrcInstance_->get_selectedConvUid(); const auto& convInfo = lrcInstance_->getConversationFromConvUid(currentConvId); if (!convInfo.confId.isEmpty()) { - currentConfSubcalls_ = lrcInstance_->getConferenceSubcalls(convInfo.confId); + auto* callModel = lrcInstance_->getAccountInfo(accountId_).callModel.get(); + currentConfSubcalls_ = callModel->getConferenceSubcalls(convInfo.confId); } } diff --git a/src/lrcinstance.cpp b/src/lrcinstance.cpp index cd947070c940bca68d298653b44bb8dc7463def2..2e42534a63f99431c80a7ea808547b7cdf73a19b 100644 --- a/src/lrcinstance.cpp +++ b/src/lrcinstance.cpp @@ -69,12 +69,6 @@ LRCInstance::LRCInstance(migrateCallback willMigrateCb, } }; -VectorString -LRCInstance::getConferenceSubcalls(const QString& callId) -{ - return lrc_->getConferenceSubcalls(callId); -} - RenderManager* LRCInstance::renderer() { diff --git a/src/lrcinstance.h b/src/lrcinstance.h index 3433710a9d1e40c0b855461fc2f0624edc5faa88..266b4bde6760f76b90c93e17eaf0d3dace8e617f 100644 --- a/src/lrcinstance.h +++ b/src/lrcinstance.h @@ -122,7 +122,6 @@ public: void monitor(bool continous); bool hasActiveCall(bool withVideo = false); - VectorString getConferenceSubcalls(const QString& callId); QString get_selectedConvUid(); diff --git a/src/videodevices.cpp b/src/videodevices.cpp index 9cdccbed01004f8fa11eb07c36e82f5c5099126f..3783bcff6bdce4911448d9aa6c2f5b777d1cbe71 100644 --- a/src/videodevices.cpp +++ b/src/videodevices.cpp @@ -273,7 +273,7 @@ VideoDevices::setDefaultDevice(int index, bool useSourceModel) lrcInstance_->avModel().setDefaultDevice(deviceId); if (!callId.isEmpty()) - lrcInstance_->avModel().switchInputTo(deviceId, callId); + lrcInstance_->getCurrentCallModel()->switchInputTo(deviceId, callId); updateData(); } @@ -435,6 +435,7 @@ void VideoDevices::onVideoDeviceEvent() { auto& avModel = lrcInstance_->avModel(); + auto* callModel = lrcInstance_->getCurrentCallModel(); auto defaultDevice = avModel.getDefaultDevice(); QString callId = lrcInstance_->getCurrentCallId(); @@ -455,11 +456,12 @@ VideoDevices::onVideoDeviceEvent() auto cb = [this, currentDeviceListSize, deviceEvent, defaultDevice, callId] { auto& avModel = lrcInstance_->avModel(); + auto* callModel = lrcInstance_->getCurrentCallModel(); if (currentDeviceListSize == 0) { - avModel.switchInputTo({}, callId); + callModel->switchInputTo({}, callId); avModel.stopPreview(this->getDefaultDevice()); } else if (deviceEvent == DeviceEvent::Removed) { - avModel.switchInputTo(defaultDevice, callId); + callModel->switchInputTo(defaultDevice, callId); } updateData(); @@ -475,7 +477,7 @@ VideoDevices::onVideoDeviceEvent() if (callId.isEmpty()) { Q_EMIT deviceAvailable(); } else { - avModel.switchInputTo(defaultDevice, callId); + callModel->switchInputTo(defaultDevice, callId); } Q_EMIT deviceListChanged(currentDeviceListSize);