From b555c27f438231da68d965ac483ea9da61694e1a Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 30 Jun 2022 20:32:30 +0200 Subject: [PATCH] Options to set default video conference layout and camera mode. Make OccupyAllSpace as default for Camera mode. Remove closing preview feature. --- linphone-app/assets/languages/da.ts | 40 ++ linphone-app/assets/languages/de.ts | 40 ++ linphone-app/assets/languages/en.ts | 40 ++ linphone-app/assets/languages/es.ts | 40 ++ linphone-app/assets/languages/fr_FR.ts | 40 ++ linphone-app/assets/languages/hu.ts | 40 ++ linphone-app/assets/languages/it.ts | 40 ++ linphone-app/assets/languages/ja.ts | 40 ++ linphone-app/assets/languages/lt.ts | 40 ++ linphone-app/assets/languages/pt_BR.ts | 40 ++ linphone-app/assets/languages/ru.ts | 40 ++ linphone-app/assets/languages/sv.ts | 40 ++ linphone-app/assets/languages/tr.ts | 40 ++ linphone-app/assets/languages/uk.ts | 40 ++ linphone-app/assets/languages/zh_CN.ts | 40 ++ .../src/components/settings/SettingsModel.cpp | 34 +- .../src/components/settings/SettingsModel.hpp | 21 + .../ui/modules/Linphone/Camera/CameraView.qml | 2 +- .../views/App/Calls/VideoConferenceGrid.qml | 2 +- .../ui/views/App/Calls/WaitingRoom.qml | 6 +- .../ui/views/App/Main/Conferences.qml | 3 +- .../ui/views/App/Settings/SettingsVideo.qml | 396 ++++++++++-------- 22 files changed, 884 insertions(+), 180 deletions(-) diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts index 7670abbaa..cf41d4eaa 100644 --- a/linphone-app/assets/languages/da.ts +++ b/linphone-app/assets/languages/da.ts @@ -3030,6 +3030,46 @@ Klik her: <a href="%1">%1</a> videoSettingsInCallWarning Videoopkald i gang: Nogle indstillinger er ikke tilgængelige. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts index 88d317780..93c4c827d 100644 --- a/linphone-app/assets/languages/de.ts +++ b/linphone-app/assets/languages/de.ts @@ -3030,6 +3030,46 @@ Klicken Sie hier: <a href="%1">%1</a> videoSettingsInCallWarning Videoanruf wird ausgeführt: Einige Einstellungen sind nicht verfügbar. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index e2c34e324..e86d74ed4 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -3053,6 +3053,46 @@ Click here: <a href="%1">%1</a> videoSettingsInCallWarning Video call in progress: some settings are not available. + + videoDisplayTitle + 'Video display' : Title for display parameters + Video display + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + Camera mode + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + Hybrid + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + Occupy all space + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + Black bars + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + Default video layout + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + Active speaker + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + Mosaic + SettingsVideoPreview diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts index 61eec87f6..186358154 100644 --- a/linphone-app/assets/languages/es.ts +++ b/linphone-app/assets/languages/es.ts @@ -3030,6 +3030,46 @@ Haga clic aquí: <a href="%1">%1 </a> videoSettingsInCallWarning Videollamada en curso: algunos ajustes no están disponibles. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts index ff41daf43..7c58bb4b2 100644 --- a/linphone-app/assets/languages/fr_FR.ts +++ b/linphone-app/assets/languages/fr_FR.ts @@ -3030,6 +3030,46 @@ Cliquez ici : <a href="%1">%1</a> videoSettingsInCallWarning Appel vidéo en cours : certains paramètres ne sont pas disponibles. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts index 2db35b9a9..c1a7cc6ec 100644 --- a/linphone-app/assets/languages/hu.ts +++ b/linphone-app/assets/languages/hu.ts @@ -3017,6 +3017,46 @@ Kattintson ide: <a href="%1">%1</a> videoSettingsInCallWarning Videohívás folyamatban: egyes beállítások nem állnak rendelkezésre. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts index 5c4b2250f..51a9fffba 100644 --- a/linphone-app/assets/languages/it.ts +++ b/linphone-app/assets/languages/it.ts @@ -3030,6 +3030,46 @@ Clicca: <a href="%1">%1</a> videoSettingsInCallWarning Videochiamata in corso: alcune impostazioni non sono disponibili. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts index 943b53944..ceeb02cc4 100644 --- a/linphone-app/assets/languages/ja.ts +++ b/linphone-app/assets/languages/ja.ts @@ -3017,6 +3017,46 @@ videoSettingsInCallWarning ビデオ通話中:一部の設定が使用できません。 + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts index e74598a8b..0f5139afb 100644 --- a/linphone-app/assets/languages/lt.ts +++ b/linphone-app/assets/languages/lt.ts @@ -3043,6 +3043,46 @@ Spustelėkite čia: <a href="%1">%1</a> videoSettingsInCallWarning Vyksta vaizdo skambutis: kai kurie nustatymai negalimi. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts index f8de63a3a..2d425b931 100644 --- a/linphone-app/assets/languages/pt_BR.ts +++ b/linphone-app/assets/languages/pt_BR.ts @@ -3030,6 +3030,46 @@ Clique aqui: <a href="%1">%1 </a> videoSettingsInCallWarning Chamada de vídeo em andamento: algumas configurações não estão disponíveis. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts index 438cda2c3..aad7e64bf 100644 --- a/linphone-app/assets/languages/ru.ts +++ b/linphone-app/assets/languages/ru.ts @@ -3043,6 +3043,46 @@ videoSettingsInCallWarning Видеозвонок выполняется: некоторые настройки недоступны. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts index 836bb662e..39214bfef 100644 --- a/linphone-app/assets/languages/sv.ts +++ b/linphone-app/assets/languages/sv.ts @@ -3030,6 +3030,46 @@ Klicka här: <a href="%1">%1</a> videoSettingsInCallWarning Videosamtal pågår: vissa inställningar är inte tillgängliga. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts index 5db3385f5..4dfee474a 100644 --- a/linphone-app/assets/languages/tr.ts +++ b/linphone-app/assets/languages/tr.ts @@ -3017,6 +3017,46 @@ Buraya tıklayın: <a href="%1">%1</a> videoSettingsInCallWarning Görüntülü arama devam ediyor: bazı ayarlar mevcut değil. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts index 3daf9c27b..0df39ecdd 100644 --- a/linphone-app/assets/languages/uk.ts +++ b/linphone-app/assets/languages/uk.ts @@ -3043,6 +3043,46 @@ videoSettingsInCallWarning Відеодзвінок в процесі: деякі настройки недоступні. + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts index 0d841d6a8..82a1dca38 100644 --- a/linphone-app/assets/languages/zh_CN.ts +++ b/linphone-app/assets/languages/zh_CN.ts @@ -3017,6 +3017,46 @@ videoSettingsInCallWarning 视频呼叫正在进行中:某些设置不可用。 + + videoDisplayTitle + 'Video display' : Title for display parameters + + + + videoModeLabel + 'Camera mode' : Label to choose a camera mode. + + + + videoHybrid + 'Hybrid' : Hybrid mode for camera. + + + + videoOccupyAllSpace + 'Occupy all space' : Camera mode for a centered cropping view. + + + + videoBlackBars + 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + + + + videoLayout + 'Default video layout' : Label to choose the default layout in video conference. + + + + videoActiveSpeakerLayout + 'Active speaker' : Active speaker layout for video conference. + + + + videoMosaicLayout + 'Mosaic' : Mosaic layout invideo conference. + + SettingsVideoPreview diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index e92c7e94c..ee5e77c1e 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -585,10 +585,42 @@ void SettingsModel::setShowVideoCodecs (bool status) { // ============================================================================= void SettingsModel::updateCameraMode(){ - auto mode = mConfig->getString("video", "main_display_mode", "BlackBars"); + auto mode = mConfig->getString("video", "main_display_mode", "OccupyAllSpace"); mConfig->setString("video", "main_display_mode", mode); mConfig->setString("video", "other_display_mode", mode); } + +SettingsModel::CameraMode SettingsModel::getCameraMode() const{ + auto mode = mConfig->getString("video", "main_display_mode", "OccupyAllSpace"); + if( mode == "Hybrid") + return CameraMode::CameraMode_Hybrid; + else if( mode == "BlackBars") + return CameraMode::CameraMode_BlackBars; + else + return CameraMode::CameraMode_OccupyAllSpace; +} + +void SettingsModel::setCameraMode(CameraMode mode){ + std::string modeToSet; + switch(mode){ + case CameraMode::CameraMode_Hybrid : modeToSet = "Hybrid";break; + case CameraMode::CameraMode_BlackBars: modeToSet = "BlackBars";break; + default: modeToSet = "OccupyAllSpace"; + } + mConfig->setString("video", "main_display_mode", modeToSet); + mConfig->setString("video", "other_display_mode", modeToSet); + emit cameraModeChanged(); +} + +LinphoneEnums::ConferenceLayout SettingsModel::getVideoConferenceLayout() const{ + return (LinphoneEnums::ConferenceLayout) mConfig->getInt(UiSection, "video_conference_layout", (int)LinphoneEnums::ConferenceLayoutActiveSpeaker); +} + +void SettingsModel::setVideoConferenceLayout(LinphoneEnums::ConferenceLayout layout){ + mConfig->setInt(UiSection, "video_conference_layout", (int)layout); + emit videoConferenceLayoutChanged(); +} + // ============================================================================= // Chat & calls. // ============================================================================= diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index 7f897abeb..1d8cd268d 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -29,6 +29,7 @@ #include "components/core/CoreHandlers.hpp" #include "components/contacts/ContactsImporterModel.hpp" +#include "utils/LinphoneEnums.hpp" // ============================================================================= class TunnelModel; @@ -95,6 +96,10 @@ class SettingsModel : public QObject { Q_PROPERTY(bool showVideoCodecs READ getShowVideoCodecs WRITE setShowVideoCodecs NOTIFY showVideoCodecsChanged) + Q_PROPERTY(CameraMode cameraMode READ getCameraMode WRITE setCameraMode NOTIFY cameraModeChanged) + Q_PROPERTY(LinphoneEnums::ConferenceLayout videoConferenceLayout READ getVideoConferenceLayout WRITE setVideoConferenceLayout NOTIFY videoConferenceLayoutChanged) + + // Chat & calls. ------------------------------------------------------------- Q_PROPERTY(bool autoAnswerStatus READ getAutoAnswerStatus WRITE setAutoAnswerStatus NOTIFY autoAnswerStatusChanged) @@ -228,6 +233,13 @@ public: }; Q_ENUM(VersionCheckType); + enum CameraMode{ + CameraMode_Hybrid = 0, + CameraMode_OccupyAllSpace = 1, + CameraMode_BlackBars = 2 + }; + Q_ENUM(CameraMode); + SettingsModel (QObject *parent = Q_NULLPTR); virtual ~SettingsModel (); @@ -346,6 +358,12 @@ public: void setShowVideoCodecs (bool status); void updateCameraMode(); + CameraMode getCameraMode() const; + void setCameraMode(CameraMode mode); + + LinphoneEnums::ConferenceLayout getVideoConferenceLayout() const; + void setVideoConferenceLayout(LinphoneEnums::ConferenceLayout layout); + // Chat & calls. ------------------------------------------------------------- @@ -639,6 +657,9 @@ signals: void showVideoCodecsChanged (bool status); + void cameraModeChanged(); + void videoConferenceLayoutChanged(); + // Chat & calls. ------------------------------------------------------------- void autoAnswerStatusChanged (bool status); diff --git a/linphone-app/ui/modules/Linphone/Camera/CameraView.qml b/linphone-app/ui/modules/Linphone/Camera/CameraView.qml index 0756be86a..c35f713e9 100644 --- a/linphone-app/ui/modules/Linphone/Camera/CameraView.qml +++ b/linphone-app/ui/modules/Linphone/Camera/CameraView.qml @@ -20,7 +20,7 @@ Item{ property alias isPreview: camera.isPreview property alias isFullscreen: camera.isFullscreen property alias isCameraFromDevice: camera.isCameraFromDevice - property bool showCloseButton: true + property bool showCloseButton: false property bool showActiveSpeakerOverlay: true property color color : camera.isReady ? CameraViewStyle.cameraBackgroundColor : CameraViewStyle.outBackgroundColor signal closeRequested() diff --git a/linphone-app/ui/views/App/Calls/VideoConferenceGrid.qml b/linphone-app/ui/views/App/Calls/VideoConferenceGrid.qml index 2506ebf11..d789f3213 100644 --- a/linphone-app/ui/views/App/Calls/VideoConferenceGrid.qml +++ b/linphone-app/ui/views/App/Calls/VideoConferenceGrid.qml @@ -53,7 +53,7 @@ Mosaic { isCameraFromDevice: true isPaused: grid.callModel.pausedByUser || avatarCell.currentDevice && avatarCell.currentDevice.isPaused onCloseRequested: participantDevices.showMe = false - showCloseButton: participantDevices.count > 1 + //showCloseButton: participantDevices.count > 1 } } } diff --git a/linphone-app/ui/views/App/Calls/WaitingRoom.qml b/linphone-app/ui/views/App/Calls/WaitingRoom.qml index 9ea88443c..f8f561e4d 100644 --- a/linphone-app/ui/views/App/Calls/WaitingRoom.qml +++ b/linphone-app/ui/views/App/Calls/WaitingRoom.qml @@ -208,11 +208,11 @@ Rectangle { ActionButton{ id: modeChoice - property int selectedMode: 0 + property int selectedMode: SettingsModel.videoConferenceLayout isCustom: true backgroundRadius: width/2 - colorSet: selectedMode == 0 ? WaitingRoomStyle.buttons.gridLayout : - selectedMode == 1 ? WaitingRoomStyle.buttons.activeSpeakerLayout : WaitingRoomStyle.buttons.audioOnly + colorSet: selectedMode == LinphoneEnums.ConferenceLayoutGrid ? WaitingRoomStyle.buttons.gridLayout : + selectedMode == LinphoneEnums.ConferenceLayoutActiveSpeaker ? WaitingRoomStyle.buttons.activeSpeakerLayout : WaitingRoomStyle.buttons.audioOnly onClicked: selectedMode = (selectedMode + 1) % 3 } } diff --git a/linphone-app/ui/views/App/Main/Conferences.qml b/linphone-app/ui/views/App/Main/Conferences.qml index c881b42ee..0da8a5b80 100644 --- a/linphone-app/ui/views/App/Main/Conferences.qml +++ b/linphone-app/ui/views/App/Main/Conferences.qml @@ -180,8 +180,7 @@ Item{ width: parent.width height: parent.height conferenceInfoModel: $modelData - gotoButtonMode: mainItem.filterType == ConferenceInfoProxyModel.Scheduled ? 1 - : mainItem.filterType == ConferenceInfoProxyModel.Ended ? -1 + gotoButtonMode: mainItem.filterType == ConferenceInfoProxyModel.Scheduled || mainItem.filterType == ConferenceInfoProxyModel.Ended? 1 : 0 onExpandToggle: calendarGrid.expanded = !calendarGrid.expanded isExpanded: calendarGrid.expanded diff --git a/linphone-app/ui/views/App/Settings/SettingsVideo.qml b/linphone-app/ui/views/App/Settings/SettingsVideo.qml index 56bd288ad..3c973cc84 100644 --- a/linphone-app/ui/views/App/Settings/SettingsVideo.qml +++ b/linphone-app/ui/views/App/Settings/SettingsVideo.qml @@ -3,6 +3,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 +import LinphoneEnums 1.0 import Utils 1.0 import App.Styles 1.0 @@ -12,176 +13,227 @@ import 'SettingsVideo.js' as Logic // ============================================================================= TabContainer { - Column { - spacing: SettingsWindowStyle.forms.spacing - width: parent.width - - // ------------------------------------------------------------------------- - // Video parameters. - // ------------------------------------------------------------------------- - - Form { - title: qsTr('videoCaptureTitle') - width: parent.width - - //Warning if in call - FormLine { - visible: SettingsModel.isInCall - FormGroup { - RowLayout { - spacing: SettingsWindowStyle.video.warningMessage.iconSize - Icon { - icon: 'warning' - iconSize: SettingsWindowStyle.video.warningMessage.iconSize - anchors { - rightMargin: SettingsWindowStyle.video.warningMessage.iconSize - leftMargin: SettingsWindowStyle.video.warningMessage.iconSize - } - } - Text { - text: qsTr('videoSettingsInCallWarning') - } - } - } - } - - FormLine { - FormGroup { - label: qsTr('videoInputDeviceLabel') - - ComboBox { - currentIndex: Number(Utils.findIndex(model, function (device) { - return device === SettingsModel.videoDevice - })) // Number cast => Index is null if app does not support video. - model: SettingsModel.videoDevices - - onActivated: SettingsModel.videoDevice = model[index] - } - } - } - - FormLine { - FormGroup { - label: qsTr('videoPresetLabel') - - ComboBox { - currentIndex: { - var preset = SettingsModel.videoPreset - - return Number(Utils.findIndex(model, function (value) { - return preset === value.value - })) - } - - model: [{ - key: qsTr('presetDefault'), - value: 'default' - }, { - key: qsTr('presetHighFps'), - value: 'high-fps' - }, { - key: qsTr('presetCustom'), - value: 'custom' - }] - - textRole: 'key' - - onActivated: SettingsModel.videoPreset = model[index].value - } - } - } - - FormLine { - FormGroup { - label: qsTr('videoSizeLabel') - - ComboBox { - currentIndex: Number(Utils.findIndex(model, function (definition) { - return definition.value.name === SettingsModel.videoDefinition.name - })) // Number cast => Index is null if app does not support video. - model: SettingsModel.supportedVideoDefinitions.map(function (definition) { - return { - key: definition.name + ' (' + definition.width + 'x' + definition.height + ')', - value: definition - } - }) - - textRole: 'key' - - onActivated: SettingsModel.videoDefinition = model[index].value - } - } - - FormGroup { - label: qsTr('videoFramerateLabel') - visible: SettingsModel.videoPreset === 'custom' - - NumericField { - maxValue: 60 - minValue: 1 - text: SettingsModel.videoFramerate - - onEditingFinished: SettingsModel.videoFramerate = text - } - } - } - - FormEmptyLine {} - } - - TextButtonB { - id: showCameraPreview - - anchors.right: parent.right - enabled: CallsListModel.rowCount() === 0 - - text: qsTr('showCameraPreview') - - onClicked: Logic.showVideoPreview() - - Connections { - target: CallsListModel - - onRowsInserted: Logic.updateVideoPreview() - onRowsRemoved: Logic.updateVideoPreview() - } - - Connections { - target: window - - onClosing: Logic.hideVideoPreview() - } - } - - // ------------------------------------------------------------------------- - // Video Codecs. - // ------------------------------------------------------------------------- - - Form { - title: qsTr('videoCodecsTitle') - visible: SettingsModel.showVideoCodecs || SettingsModel.developerSettingsEnabled - width: parent.width - - FormLine { - visible: SettingsModel.developerSettingsEnabled - - FormGroup { - label: qsTr('showVideoCodecsLabel') - - Switch { - checked: SettingsModel.showVideoCodecs - - onClicked: SettingsModel.showVideoCodecs = !checked - } - } - } - - CodecsViewer { - model: VideoCodecsModel - width: parent.width - - onDownloadRequested: Logic.handleCodecDownloadRequested(codecInfo) - } - } - } + Column { + spacing: SettingsWindowStyle.forms.spacing + width: parent.width + + // ------------------------------------------------------------------------- + // Video parameters. + // ------------------------------------------------------------------------- + + Form { + title: qsTr('videoCaptureTitle') + width: parent.width + + //Warning if in call + FormLine { + visible: SettingsModel.isInCall + FormGroup { + RowLayout { + spacing: SettingsWindowStyle.video.warningMessage.iconSize + Icon { + icon: 'warning' + iconSize: SettingsWindowStyle.video.warningMessage.iconSize + anchors { + rightMargin: SettingsWindowStyle.video.warningMessage.iconSize + leftMargin: SettingsWindowStyle.video.warningMessage.iconSize + } + } + Text { + text: qsTr('videoSettingsInCallWarning') + } + } + } + } + + FormLine { + FormGroup { + label: qsTr('videoInputDeviceLabel') + + ComboBox { + currentIndex: Number(Utils.findIndex(model, function (device) { + return device === SettingsModel.videoDevice + })) // Number cast => Index is null if app does not support video. + model: SettingsModel.videoDevices + + onActivated: SettingsModel.videoDevice = model[index] + } + } + } + + FormLine { + FormGroup { + label: qsTr('videoPresetLabel') + + ComboBox { + currentIndex: { + var preset = SettingsModel.videoPreset + + return Number(Utils.findIndex(model, function (value) { + return preset === value.value + })) + } + + model: [{ + key: qsTr('presetDefault'), + value: 'default' + }, { + key: qsTr('presetHighFps'), + value: 'high-fps' + }, { + key: qsTr('presetCustom'), + value: 'custom' + }] + + textRole: 'key' + + onActivated: SettingsModel.videoPreset = model[index].value + } + } + } + + FormLine { + FormGroup { + label: qsTr('videoSizeLabel') + + ComboBox { + currentIndex: Number(Utils.findIndex(model, function (definition) { + return definition.value.name === SettingsModel.videoDefinition.name + })) // Number cast => Index is null if app does not support video. + model: SettingsModel.supportedVideoDefinitions.map(function (definition) { + return { + key: definition.name + ' (' + definition.width + 'x' + definition.height + ')', + value: definition + } + }) + + textRole: 'key' + + onActivated: SettingsModel.videoDefinition = model[index].value + } + } + + FormGroup { + label: qsTr('videoFramerateLabel') + visible: SettingsModel.videoPreset === 'custom' + + NumericField { + maxValue: 60 + minValue: 1 + text: SettingsModel.videoFramerate + + onEditingFinished: SettingsModel.videoFramerate = text + } + } + } + + FormEmptyLine {} + } + + TextButtonB { + id: showCameraPreview + + anchors.right: parent.right + enabled: CallsListModel.rowCount() === 0 + + text: qsTr('showCameraPreview') + + onClicked: Logic.showVideoPreview() + + Connections { + target: CallsListModel + + onRowsInserted: Logic.updateVideoPreview() + onRowsRemoved: Logic.updateVideoPreview() + } + + Connections { + target: window + + onClosing: Logic.hideVideoPreview() + } + } + + // ------------------------------------------------------------------------- + // Video Codecs. + // ------------------------------------------------------------------------- + + Form { + title: qsTr('videoCodecsTitle') + visible: SettingsModel.showVideoCodecs || SettingsModel.developerSettingsEnabled + width: parent.width + + FormLine { + visible: SettingsModel.developerSettingsEnabled + + FormGroup { + label: qsTr('showVideoCodecsLabel') + + Switch { + checked: SettingsModel.showVideoCodecs + + onClicked: SettingsModel.showVideoCodecs = !checked + } + } + } + + CodecsViewer { + model: VideoCodecsModel + width: parent.width + + onDownloadRequested: Logic.handleCodecDownloadRequested(codecInfo) + } + } + + // ------------------------------------------------------------------------- + // Diplay Video. + // ------------------------------------------------------------------------- + + Form { + //: 'Video display' : Title for display parameters + title: qsTr('videoDisplayTitle') + width: parent.width + + FormLine { + FormGroup { + //: 'Camera mode' : Label to choose a camera mode. + label: qsTr('videoModeLabel') + + ComboBox { + //: 'Hybrid' : Hybrid mode for camera. + model:[{text:qsTr('videoHybrid'), value: SettingsModel.CameraMode_Hybrid} + //: 'Occupy all space' : Camera mode for a centered cropping view. + , {text:qsTr('videoOccupyAllSpace'), value:SettingsModel.CameraMode_OccupyAllSpace} + //: 'Black bars' : Camera mode for a fit view with black bars to keep ratio. + ,{text:qsTr('videoBlackBars'), value:SettingsModel.CameraMode_BlackBars} + ] + textRole: 'text' + currentIndex: SettingsModel.cameraMode == SettingsModel.CameraMode_Hybrid + ? 0 + : SettingsModel.cameraMode == SettingsModel.CameraMode_OccupyAllSpace + ? 1 + : 2 + onActivated: SettingsModel.cameraMode = model[index].value + } + } + } + FormLine { + FormGroup { + //: 'Default video layout' : Label to choose the default layout in video conference. + label: qsTr('videoLayout') + + ComboBox { + //: 'Mosaic' : Mosaic layout invideo conference. + model:[{text:qsTr('videoMosaicLayout'), value:LinphoneEnums.ConferenceLayoutGrid} + //: 'Active speaker' : Active speaker layout for video conference. + , {text:qsTr('videoActiveSpeakerLayout'), value:LinphoneEnums.ConferenceLayoutActiveSpeaker} + ] + textRole: 'text' + currentIndex: SettingsModel.videoConferenceLayout == LinphoneEnums.ConferenceLayoutGrid ? 0 : 1 + onActivated: SettingsModel.videoConferenceLayout = model[index].value + } + } + } + } + } }