From 31340bc224b5e4e0ed2e40cf55b73be4bc2e56b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Thu, 6 Oct 2022 10:18:24 -0400 Subject: [PATCH] participantoverlay: add recording state https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/699 Change-Id: Ia480eef38ee054750ffbaf08ae0aed84090dc9a5 --- src/app/callparticipantsmodel.cpp | 2 + src/app/callparticipantsmodel.h | 1 + src/app/constant/JamiTheme.qml | 4 ++ .../components/ParticipantOverlay.qml | 40 +++++++++++++++++++ .../mainview/components/ParticipantsLayer.qml | 1 + .../ParticipantsLayoutHorizontal.qml | 2 + .../components/ParticipantsLayoutVertical.qml | 2 + src/libclient/api/callparticipantsmodel.h | 6 ++- src/libclient/callparticipantsmodel.cpp | 1 + 9 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/app/callparticipantsmodel.cpp b/src/app/callparticipantsmodel.cpp index 48a8544fe..e79b29771 100644 --- a/src/app/callparticipantsmodel.cpp +++ b/src/app/callparticipantsmodel.cpp @@ -87,6 +87,8 @@ CallParticipantsModel::data(const QModelIndex& index, int role) const return QVariant(item.value(HANDRAISED).toBool()); case Role::VoiceActivity: return QVariant(item.value(VOICEACTIVITY).toBool()); + case Role::IsRecording: + return QVariant(item.value(ISRECORDING).toBool()); } return QVariant(); } diff --git a/src/app/callparticipantsmodel.h b/src/app/callparticipantsmodel.h index 15330360c..b701cf239 100644 --- a/src/app/callparticipantsmodel.h +++ b/src/app/callparticipantsmodel.h @@ -46,6 +46,7 @@ X(IsLocal) \ X(IsContact) \ X(VoiceActivity) \ + X(IsRecording) \ X(HandRaised) namespace CallParticipant { diff --git a/src/app/constant/JamiTheme.qml b/src/app/constant/JamiTheme.qml index 5267a12e9..67447c788 100644 --- a/src/app/constant/JamiTheme.qml +++ b/src/app/constant/JamiTheme.qml @@ -322,6 +322,10 @@ Item { property real lineEditContextMenuItemsWidth: 100 property real lineEditContextMenuSeparatorsHeight: 2 + // Recording + property real recordingBtnSize: 12 + property real recordingIndicatorSize: 24 + //TimestampInfo property int timestampLinePadding: 40 property int dayTimestampTopMargin: 30 diff --git a/src/app/mainview/components/ParticipantOverlay.qml b/src/app/mainview/components/ParticipantOverlay.qml index 1adbc5968..e66bdb54b 100644 --- a/src/app/mainview/components/ParticipantOverlay.qml +++ b/src/app/mainview/components/ParticipantOverlay.qml @@ -58,6 +58,7 @@ Item { property bool videoMuted: true property bool voiceActive: false property bool isLocalMuted: true + property bool isRecording: false property bool meHost: CallAdapter.isCurrentHost() property bool meModerator: CallAdapter.isModerator() @@ -331,6 +332,45 @@ Item { radius: 5 } + Item { + id: recordingIndicator + + visible: root.isRecording + z: participantRect.z + 1 + + width: JamiTheme.recordingIndicatorSize + height: shapeHeight + + anchors.right: isRaiseHandIndicator.visible ? isRaiseHandIndicator.left : participantRect.right + anchors.top: participantRect.top + + Rectangle { + anchors.centerIn: parent + + height: JamiTheme.recordingBtnSize + width: JamiTheme.recordingBtnSize + + radius: height / 2 + color: JamiTheme.recordIconColor + + SequentialAnimation on color { + loops: Animation.Infinite + running: recordingIndicator.visible + ColorAnimation { + from: JamiTheme.recordIconColor + to: "transparent" + duration: JamiTheme.recordBlinkDuration + } + ColorAnimation { + from: "transparent" + to: JamiTheme.recordIconColor + duration: JamiTheme.recordBlinkDuration + } + } + } + } + + Rectangle { id: alertMessage diff --git a/src/app/mainview/components/ParticipantsLayer.qml b/src/app/mainview/components/ParticipantsLayer.qml index 2e5c8b78c..b3fddbf0d 100644 --- a/src/app/mainview/components/ParticipantsLayer.qml +++ b/src/app/mainview/components/ParticipantsLayer.qml @@ -65,6 +65,7 @@ Item { participantIsActive: active_ isLocalMuted: audioLocalMuted_ voiceActive: voiceActive_ + isRecording: isRecording_ participantIsModeratorMuted: audioModeratorMuted_ participantHandIsRaised: isHandRaised_ diff --git a/src/app/mainview/components/ParticipantsLayoutHorizontal.qml b/src/app/mainview/components/ParticipantsLayoutHorizontal.qml index 285be9528..79d472ca5 100644 --- a/src/app/mainview/components/ParticipantsLayoutHorizontal.qml +++ b/src/app/mainview/components/ParticipantsLayoutHorizontal.qml @@ -121,6 +121,7 @@ SplitView { property bool audioModeratorMuted_: AudioModeratorMuted property bool isHandRaised_: HandRaised property bool voiceActive_: VoiceActivity + property bool isRecording_: IsRecording } } } @@ -309,6 +310,7 @@ SplitView { property bool audioModeratorMuted_: AudioModeratorMuted property bool isHandRaised_: HandRaised property bool voiceActive_: VoiceActivity + property bool isRecording_: IsRecording } } } diff --git a/src/app/mainview/components/ParticipantsLayoutVertical.qml b/src/app/mainview/components/ParticipantsLayoutVertical.qml index 23a834e17..0d466e00c 100644 --- a/src/app/mainview/components/ParticipantsLayoutVertical.qml +++ b/src/app/mainview/components/ParticipantsLayoutVertical.qml @@ -216,6 +216,7 @@ SplitView { property bool audioModeratorMuted_: AudioModeratorMuted property bool isHandRaised_: HandRaised property bool voiceActive_: VoiceActivity + property bool isRecording_: IsRecording } } } @@ -290,6 +291,7 @@ SplitView { property bool audioModeratorMuted_: AudioModeratorMuted property bool isHandRaised_: HandRaised property bool voiceActive_: VoiceActivity + property bool isRecording_: IsRecording } } } diff --git a/src/libclient/api/callparticipantsmodel.h b/src/libclient/api/callparticipantsmodel.h index c51cb1019..c1c7bf9b2 100644 --- a/src/libclient/api/callparticipantsmodel.h +++ b/src/libclient/api/callparticipantsmodel.h @@ -53,6 +53,7 @@ const QString AUDIOMODERATORMUTED = "audioModeratorMuted"; const QString ISMODERATOR = "isModerator"; const QString HANDRAISED = "handRaised"; const QString VOICEACTIVITY = "voiceActivity"; +const QString ISRECORDING = "recording"; const QString STREAMID = "sinkId"; // TODO update const QString BESTNAME = "bestName"; const QString ISLOCAL = "isLocal"; @@ -83,6 +84,7 @@ struct ParticipantInfos isModerator = infos[ParticipantsInfosStrings::ISMODERATOR] == "true"; handRaised = infos[ParticipantsInfosStrings::HANDRAISED] == "true"; voiceActivity = infos[ParticipantsInfosStrings::VOICEACTIVITY] == "true"; + isRecording = infos[ParticipantsInfosStrings::ISRECORDING] == "true"; if (infos[ParticipantsInfosStrings::STREAMID].isEmpty()) sinkId = callId + uri + device; @@ -110,6 +112,7 @@ struct ParticipantInfos bool isContact {false}; bool handRaised {false}; bool voiceActivity {false}; + bool isRecording {false}; bool operator==(const ParticipantInfos& other) const { @@ -118,7 +121,8 @@ struct ParticipantInfos && audioModeratorMuted == other.audioModeratorMuted && avatar == other.avatar && bestName == other.bestName && isContact == other.isContact && islocal == other.islocal && videoMuted == other.videoMuted - && handRaised == other.handRaised && voiceActivity == other.voiceActivity; + && handRaised == other.handRaised && voiceActivity == other.voiceActivity + && isRecording == other.isRecording; } }; diff --git a/src/libclient/callparticipantsmodel.cpp b/src/libclient/callparticipantsmodel.cpp index 523a38ec9..cfe85f52b 100644 --- a/src/libclient/callparticipantsmodel.cpp +++ b/src/libclient/callparticipantsmodel.cpp @@ -201,6 +201,7 @@ CallParticipants::toQJsonObject(uint index) const ret[ParticipantsInfosStrings::ISCONTACT] = participant->isContact; ret[ParticipantsInfosStrings::HANDRAISED] = participant->handRaised; ret[ParticipantsInfosStrings::VOICEACTIVITY] = participant->voiceActivity; + ret[ParticipantsInfosStrings::ISRECORDING] = participant->isRecording; ret[ParticipantsInfosStrings::CALLID] = callId_; return ret; -- GitLab