This commit is contained in:
gaelle.braud 2024-07-15 16:41:37 +02:00 committed by Gaelle Braud
parent a7f06efb47
commit cd45e786df
16 changed files with 89 additions and 44 deletions

View file

@ -199,7 +199,8 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
mCallModelConnection->makeConnectToCore(&CallCore::lStopRecording, [this]() { mCallModelConnection->makeConnectToCore(&CallCore::lStopRecording, [this]() {
mCallModelConnection->invokeToModel([this]() { mCallModel->stopRecording(); }); mCallModelConnection->invokeToModel([this]() { mCallModel->stopRecording(); });
}); });
mCallModelConnection->makeConnectToModel(&CallModel::recordingChanged, [this](bool recording) { mCallModelConnection->makeConnectToModel(
&CallModel::recordingChanged, [this](const std::shared_ptr<linphone::Call> &call, bool recording) {
mCallModelConnection->invokeToCore([this, recording]() { mCallModelConnection->invokeToCore([this, recording]() {
setRecording(recording); setRecording(recording);
if (recording == false) { if (recording == false) {
@ -224,9 +225,16 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
emit tokenVerified(); emit tokenVerified();
}); });
}); });
mCallModelConnection->makeConnectToModel( mCallModelConnection->makeConnectToModel(&CallModel::remoteRecording,
&CallModel::remoteRecording, [this](const std::shared_ptr<linphone::Call> &call, bool recording) { [this](const std::shared_ptr<linphone::Call> &call, bool recording) {
mCallModelConnection->invokeToCore([this, recording]() { setRemoteRecording(recording); }); bool confRecording = false;
if (call->getConference()) {
confRecording = call->getConference()->isRecording();
}
mCallModelConnection->invokeToCore([this, recording, confRecording]() {
if (mConference) mConference->setRecording(confRecording);
setRemoteRecording(recording);
});
}); });
mCallModelConnection->makeConnectToModel(&CallModel::localVideoEnabledChanged, [this](bool enabled) { mCallModelConnection->makeConnectToModel(&CallModel::localVideoEnabledChanged, [this](bool enabled) {
mCallModelConnection->invokeToCore([this, enabled]() { setLocalVideoEnabled(enabled); }); mCallModelConnection->invokeToCore([this, enabled]() { setLocalVideoEnabled(enabled); });

View file

@ -41,6 +41,7 @@ ConferenceCore::ConferenceCore(const std::shared_ptr<linphone::Conference> &conf
mParticipantDeviceCount = conference->getParticipantDeviceList().size(); mParticipantDeviceCount = conference->getParticipantDeviceList().size();
mIsLocalScreenSharing = mConferenceModel->isLocalScreenSharing(); mIsLocalScreenSharing = mConferenceModel->isLocalScreenSharing();
mIsScreenSharingEnabled = mConferenceModel->isScreenSharingEnabled(); mIsScreenSharingEnabled = mConferenceModel->isScreenSharingEnabled();
mIsRecording = conference->isRecording();
auto me = conference->getMe(); auto me = conference->getMe();
if (me) { if (me) {
mMe = ParticipantCore::create(me); mMe = ParticipantCore::create(me);
@ -105,6 +106,17 @@ Q_INVOKABLE qint64 ConferenceCore::getElapsedSeconds() const {
return 0; return 0;
} }
bool ConferenceCore::isRecording() const {
return mIsRecording;
}
void ConferenceCore::setRecording(bool recording) {
if (mIsRecording != recording) {
mIsRecording = recording;
emit isRecordingChanged();
}
}
void ConferenceCore::setParticipantDeviceCount(int count) { void ConferenceCore::setParticipantDeviceCount(int count) {
if (mParticipantDeviceCount != count) { if (mParticipantDeviceCount != count) {
mParticipantDeviceCount = count; mParticipantDeviceCount = count;

View file

@ -40,6 +40,7 @@ public:
// Q_PROPERTY(ParticipantDeviceList *participantDevices READ getParticipantDeviceList CONSTANT) // Q_PROPERTY(ParticipantDeviceList *participantDevices READ getParticipantDeviceList CONSTANT)
// Q_PROPERTY(ParticipantModel* localParticipant READ getLocalParticipant NOTIFY localParticipantChanged) // Q_PROPERTY(ParticipantModel* localParticipant READ getLocalParticipant NOTIFY localParticipantChanged)
Q_PROPERTY(bool isReady MEMBER mIsReady WRITE setIsReady NOTIFY isReadyChanged) Q_PROPERTY(bool isReady MEMBER mIsReady WRITE setIsReady NOTIFY isReadyChanged)
Q_PROPERTY(bool isRecording READ isRecording WRITE setRecording NOTIFY isRecordingChanged)
Q_PROPERTY(QString subject READ getSubject WRITE setSubject NOTIFY subjectChanged) Q_PROPERTY(QString subject READ getSubject WRITE setSubject NOTIFY subjectChanged)
Q_PROPERTY(bool isLocalScreenSharing MEMBER mIsLocalScreenSharing WRITE setIsLocalScreenSharing NOTIFY Q_PROPERTY(bool isLocalScreenSharing MEMBER mIsLocalScreenSharing WRITE setIsLocalScreenSharing NOTIFY
@ -65,6 +66,9 @@ public:
int getParticipantDeviceCount() const; int getParticipantDeviceCount() const;
void setParticipantDeviceCount(int count); void setParticipantDeviceCount(int count);
bool isRecording() const;
void setRecording(bool recording);
ParticipantDeviceCore *getActiveSpeaker() const; ParticipantDeviceCore *getActiveSpeaker() const;
ParticipantDeviceGui *getActiveSpeakerGui() const; ParticipantDeviceGui *getActiveSpeakerGui() const;
ParticipantGui *getMeGui() const; ParticipantGui *getMeGui() const;
@ -86,6 +90,7 @@ signals:
void participantDeviceCountChanged(); void participantDeviceCountChanged();
void activeSpeakerChanged(); void activeSpeakerChanged();
void subjectChanged(); void subjectChanged();
void isRecordingChanged();
void lToggleScreenSharing(); void lToggleScreenSharing();
@ -97,6 +102,7 @@ private:
int mParticipantDeviceCount = 0; int mParticipantDeviceCount = 0;
bool mIsReady = false; bool mIsReady = false;
bool mIsRecording = false;
bool mIsLocalScreenSharing = false; bool mIsLocalScreenSharing = false;
bool mIsScreenSharingEnabled = false; bool mIsScreenSharingEnabled = false;
QString mSubject; QString mSubject;

View file

@ -542,6 +542,7 @@ void ConferenceInfoCore::writeIntoModel(std::shared_ptr<ConferenceInfoModel> mod
model->setDateTime(mIsScheduled ? mDateTime : QDateTime()); model->setDateTime(mIsScheduled ? mDateTime : QDateTime());
model->setDuration(mDuration); model->setDuration(mDuration);
model->setSubject(mSubject); model->setSubject(mSubject);
model->enableInvite(mInviteEnabled);
if (!mOrganizerAddress.isEmpty()) { if (!mOrganizerAddress.isEmpty()) {
model->setOrganizer(mOrganizerAddress); model->setOrganizer(mOrganizerAddress);
lDebug() << "Use of " << mOrganizerAddress; lDebug() << "Use of " << mOrganizerAddress;

View file

@ -180,13 +180,13 @@ void CallModel::setLocalVideoEnabled(bool enabled) {
void CallModel::startRecording() { void CallModel::startRecording() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->startRecording(); mMonitor->startRecording();
emit recordingChanged(mMonitor->getParams()->isRecording()); emit recordingChanged(mMonitor, mMonitor->getParams()->isRecording());
} }
void CallModel::stopRecording() { void CallModel::stopRecording() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->stopRecording(); mMonitor->stopRecording();
emit recordingChanged(mMonitor->getParams()->isRecording()); emit recordingChanged(mMonitor, mMonitor->getParams()->isRecording());
} }
void CallModel::setRecordFile(const std::string &path) { void CallModel::setRecordFile(const std::string &path) {

View file

@ -97,7 +97,7 @@ signals:
void pausedChanged(bool paused); void pausedChanged(bool paused);
void remoteVideoEnabledChanged(bool remoteVideoEnabled); void remoteVideoEnabledChanged(bool remoteVideoEnabled);
void localVideoEnabledChanged(bool enabled); void localVideoEnabledChanged(bool enabled);
void recordingChanged(bool recording); void recordingChanged(const std::shared_ptr<linphone::Call> &call, bool recording);
void speakerVolumeGainChanged(float volume); void speakerVolumeGainChanged(float volume);
void microphoneVolumeGainChanged(float volume); void microphoneVolumeGainChanged(float volume);
void inputAudioDeviceChanged(const std::string &id); void inputAudioDeviceChanged(const std::string &id);

View file

@ -143,6 +143,7 @@ void ConferenceModel::toggleScreenSharing() {
if (enable) { if (enable) {
params->setConferenceVideoLayout(linphone::Conference::Layout::ActiveSpeaker); params->setConferenceVideoLayout(linphone::Conference::Layout::ActiveSpeaker);
params->enableVideo(true); params->enableVideo(true);
params->enableCamera(false);
auto videoDirection = params->getVideoDirection(); auto videoDirection = params->getVideoDirection();
if (videoDirection != linphone::MediaDirection::SendOnly && if (videoDirection != linphone::MediaDirection::SendOnly &&
videoDirection != linphone::MediaDirection::SendRecv) videoDirection != linphone::MediaDirection::SendRecv)

View file

@ -139,6 +139,9 @@ bool ToolModel::createCall(const QString &sipAddress,
std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr); std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr);
CallModel::activateLocalVideo(params, nullptr, localVideoEnabled); CallModel::activateLocalVideo(params, nullptr, localVideoEnabled);
bool micEnabled = options.contains("microEnabled") ? options["microEnabled"].toBool() : true;
params->enableMic(micEnabled);
params->setMediaEncryption(mediaEncryption); params->setMediaEncryption(mediaEncryption);
if (Utils::coreStringToAppString(params->getRecordFile()).isEmpty()) { if (Utils::coreStringToAppString(params->getRecordFile()).isEmpty()) {

View file

@ -7,6 +7,8 @@ import SettingsCpp 1.0
ApplicationWindow { ApplicationWindow {
id: mainWindow id: mainWindow
width: Math.min(1512 * DefaultStyle.dp, Screen.desktopAvailableWidth)
height: Math.min(982 * DefaultStyle.dp, Screen.desktopAvailableHeight)
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent

View file

@ -10,8 +10,6 @@ import DesktopToolsCpp 1.0
AppWindow { AppWindow {
id: mainWindow id: mainWindow
width: 1512 * DefaultStyle.dp
height: 982 * DefaultStyle.dp
flags: Qt.Window flags: Qt.Window
// modality: Qt.WindowModal // modality: Qt.WindowModal
@ -204,8 +202,9 @@ AppWindow {
height: 115 * DefaultStyle.dp height: 115 * DefaultStyle.dp
Connections { Connections {
target: mainWindow target: mainWindow
function ontransferStateChanged() { function onTransferStateChanged() {
if (mainWindow.transferState === LinphoneEnums.CallState.Error if (mainWindow.transferState === LinphoneEnums.CallState.OutgoingInit) waitingPopup.open()
else if (mainWindow.transferState === LinphoneEnums.CallState.Error
|| mainWindow.transferState === LinphoneEnums.CallState.End || mainWindow.transferState === LinphoneEnums.CallState.End
|| mainWindow.transferState === LinphoneEnums.CallState.Released || mainWindow.transferState === LinphoneEnums.CallState.Released
|| mainWindow.transferState === LinphoneEnums.CallState.Connected) || mainWindow.transferState === LinphoneEnums.CallState.Connected)
@ -281,7 +280,7 @@ AppWindow {
id: callStatusText id: callStatusText
text: (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released) text: (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released)
? qsTr("End of the call") ? qsTr("End of the call")
: mainWindow.call.core.paused : mainWindow.call && mainWindow.call.core.paused
|| (mainWindow.callState === LinphoneEnums.CallState.Paused || (mainWindow.callState === LinphoneEnums.CallState.Paused
|| mainWindow.callState === LinphoneEnums.CallState.PausedByRemote) || mainWindow.callState === LinphoneEnums.CallState.PausedByRemote)
? (mainWindow.conference ? qsTr('Réunion mise ') : qsTr('Appel mis')) + qsTr(" en pause") ? (mainWindow.conference ? qsTr('Réunion mise ') : qsTr('Appel mis')) + qsTr(" en pause")
@ -416,7 +415,7 @@ AppWindow {
hoverEnabled: true hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: { onClicked: {
if (rightPanel.visible) rightPanel.visible = false if (rightPanel.visible && rightPanel.contentStackView.currentItem.objectName === "statsPanel") rightPanel.visible = false
else { else {
rightPanel.visible = true rightPanel.visible = true
rightPanel.replace(statsPanel) rightPanel.replace(statsPanel)
@ -427,7 +426,11 @@ AppWindow {
} }
Control.Control { Control.Control {
visible: mainWindow.call && (mainWindow.call.core.recording || mainWindow.call.core.remoteRecording) visible: mainWindow.call
? !!mainWindow.conference
? mainWindow.conference.core.isRecording
: (mainWindow.call.core.recording || mainWindow.call.core.remoteRecording)
: false
anchors.centerIn: parent anchors.centerIn: parent
leftPadding: 14 * DefaultStyle.dp leftPadding: 14 * DefaultStyle.dp
rightPadding: 14 * DefaultStyle.dp rightPadding: 14 * DefaultStyle.dp
@ -508,7 +511,6 @@ AppWindow {
searchBarBorderColor: DefaultStyle.grey_200 searchBarBorderColor: DefaultStyle.grey_200
onSelectedContactChanged: { onSelectedContactChanged: {
if (selectedContact) mainWindow.transferCallToContact(mainWindow.call, selectedContact, callcontactslist) if (selectedContact) mainWindow.transferCallToContact(mainWindow.call, selectedContact, callcontactslist)
waitingPopup.open()
} }
} }
} }
@ -1013,6 +1015,7 @@ AppWindow {
Component { Component {
id: statsPanel id: statsPanel
ColumnLayout { ColumnLayout {
property string objectName: "statsPanel"
spacing: 20 * DefaultStyle.dp spacing: 20 * DefaultStyle.dp
Control.StackView.onActivated: { Control.StackView.onActivated: {
rightPanel.headerTitleText = qsTr("Statistiques") rightPanel.headerTitleText = qsTr("Statistiques")
@ -1072,6 +1075,8 @@ AppWindow {
Layout.leftMargin: 16 * DefaultStyle.dp Layout.leftMargin: 16 * DefaultStyle.dp
Layout.rightMargin: 16 * DefaultStyle.dp Layout.rightMargin: 16 * DefaultStyle.dp
visible: mainWindow.call && (mainWindow.call.core.localVideoEnabled || mainWindow.call.core.remoteVideoEnabled)
contentItem: ColumnLayout { contentItem: ColumnLayout {
spacing: 12 * DefaultStyle.dp spacing: 12 * DefaultStyle.dp
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -1341,6 +1346,7 @@ AppWindow {
} }
CheckableButton { CheckableButton {
iconUrl: AppIcons.screencast iconUrl: AppIcons.screencast
visible: !!mainWindow.conference
checkedColor: DefaultStyle.main2_400 checkedColor: DefaultStyle.main2_400
Layout.preferredWidth: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
@ -1480,6 +1486,7 @@ AppWindow {
} }
MenuButton { MenuButton {
checkable: true checkable: true
visible: mainWindow.call && !mainWindow.conference
enabled: mainWindow.call && mainWindow.call.core.recordable enabled: mainWindow.call && mainWindow.call.core.recordable
icon.source: AppIcons.recordFill icon.source: AppIcons.recordFill
icon.width: 32 * DefaultStyle.dp icon.width: 32 * DefaultStyle.dp

View file

@ -273,14 +273,13 @@ Item {
background.visible: false background.visible: false
Layout.preferredWidth: 54 * DefaultStyle.dp Layout.preferredWidth: 54 * DefaultStyle.dp
Layout.preferredHeight: width Layout.preferredHeight: width
popup.padding: 14 * DefaultStyle.dp
contentItem: Avatar { contentItem: Avatar {
id: avatar id: avatar
height: avatarButton.height height: avatarButton.height
width: avatarButton.width width: avatarButton.width
account: accountProxy.defaultAccount account: accountProxy.defaultAccount
} }
popup.x: width - popup.width
popup.padding: 0
popup.contentItem: ColumnLayout { popup.contentItem: ColumnLayout {
Accounts { Accounts {
id: accounts id: accounts
@ -293,8 +292,8 @@ Item {
id: settingsButton id: settingsButton
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
popup.x: width - popup.width
popup.width: 271 * DefaultStyle.dp popup.width: 271 * DefaultStyle.dp
popup.padding: 14 * DefaultStyle.dp
popup.contentItem: ColumnLayout { popup.contentItem: ColumnLayout {
spacing: 20 * DefaultStyle.dp spacing: 20 * DefaultStyle.dp
IconLabelButton { IconLabelButton {

View file

@ -1,5 +1,6 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Window
import QtQuick.Controls import QtQuick.Controls
import Linphone import Linphone
import UtilsCpp 1.0 import UtilsCpp 1.0
@ -7,8 +8,7 @@ import SettingsCpp 1.0
AppWindow { AppWindow {
id: mainWindow id: mainWindow
width: 1512 * DefaultStyle.dp // height: 982 * DefaultStyle.dp
height: 982 * DefaultStyle.dp
visible: true visible: true
title: qsTr("Linphone") title: qsTr("Linphone")
// TODO : handle this bool when security mode is implemented // TODO : handle this bool when security mode is implemented

View file

@ -110,6 +110,7 @@ ColumnLayout {
height: 219 * DefaultStyle.dp height: 219 * DefaultStyle.dp
screenIndex: index screenIndex: index
onClicked: {//screensLayout.selectedIndex = index onClicked: {//screensLayout.selectedIndex = index
screensLayout.currentIndex = index
mainItem.desc.core.screenSharingIndex = index mainItem.desc.core.screenSharingIndex = index
if( mainItem.conference.core.isLocalScreenSharing) if( mainItem.conference.core.isLocalScreenSharing)
mainItem.call.core.videoSourceDescriptor = mainItem.desc mainItem.call.core.videoSourceDescriptor = mainItem.desc
@ -126,6 +127,7 @@ ColumnLayout {
id: windowsList id: windowsList
mode: ScreenList.WINDOWS mode: ScreenList.WINDOWS
} }
currentIndex: -1
onVisibleChanged: if(visible) windowsList.update() onVisibleChanged: if(visible) windowsList.update()
cellWidth: width / 2 cellWidth: width / 2
cellHeight: (112 + 15) * DefaultStyle.dp cellHeight: (112 + 15) * DefaultStyle.dp
@ -139,6 +141,7 @@ ColumnLayout {
displayScreen: false displayScreen: false
screenIndex: index screenIndex: index
onClicked: { onClicked: {
windowsLayout.currentIndex = index
mainItem.desc.core.windowId = $modelData.windowId mainItem.desc.core.windowId = $modelData.windowId
if( mainItem.conference.core.isLocalScreenSharing) if( mainItem.conference.core.isLocalScreenSharing)
mainItem.call.core.videoSourceDescriptor = mainItem.desc mainItem.call.core.videoSourceDescriptor = mainItem.desc
@ -153,6 +156,7 @@ ColumnLayout {
} }
Button { Button {
visible: mainItem.screenSharingAvailable visible: mainItem.screenSharingAvailable
enabled: windowsLayout.currentIndex !== -1 || screensLayout.currentIndex !== -1
text: mainItem.conference && mainItem.conference.core.isLocalScreenSharing text: mainItem.conference && mainItem.conference.core.isLocalScreenSharing
? qsTr("Stop") ? qsTr("Stop")
: qsTr("Partager") : qsTr("Partager")

View file

@ -55,12 +55,12 @@ Button {
// Do not use popup.height as it is not consistent. // Do not use popup.height as it is not consistent.
var position = mainItem.mapToItem(mainItem.Window.contentItem, mainItem.x + popup.implicitContentWidth + popup.padding, mainItem.y + mainItem.height + popup.implicitContentHeight + popup.padding) var position = mainItem.mapToItem(mainItem.Window.contentItem, mainItem.x + popup.implicitContentWidth + popup.padding, mainItem.y + mainItem.height + popup.implicitContentHeight + popup.padding)
if (position.y >= mainItem.Window.height) { if (position.y >= mainItem.Window.height) {
y = -mainItem.height - popup.implicitContentHeight y = -mainItem.height - popup.implicitContentHeight - popup.padding
}else { }else {
y = mainItem.height + popup.padding y = mainItem.height + popup.padding
} }
if (position.x >= mainItem.Window.width) { if (position.x >= mainItem.Window.width) {
x = -popup.implicitContentWidth x = mainItem.width - Math.max(popup.width, popup.implicitContentWidth)
} else { } else {
x = 0 x = 0
} }

View file

@ -36,7 +36,7 @@ AbstractMainPage {
friendGui.core.givenName = UtilsCpp.getGivenNameFromFullName(name) friendGui.core.givenName = UtilsCpp.getGivenNameFromFullName(name)
friendGui.core.familyName = UtilsCpp.getFamilyNameFromFullName(name) friendGui.core.familyName = UtilsCpp.getFamilyNameFromFullName(name)
friendGui.core.defaultAddress = address friendGui.core.defaultAddress = address
if (rightPanelStackView.currentItem && rightPanelStackView.currentItem.objectName != "contactEdition") if (!rightPanelStackView.currentItem || rightPanelStackView.currentItem.objectName != "contactEdition")
rightPanelStackView.push(contactEdition, {"contact": friendGui, "title": qsTr("Nouveau contact"), "saveButtonText": qsTr("Créer")}) rightPanelStackView.push(contactEdition, {"contact": friendGui, "title": qsTr("Nouveau contact"), "saveButtonText": qsTr("Créer")})
} }

View file

@ -28,6 +28,8 @@ AbstractMainPage {
} }
} }
onNoItemButtonPressed: editConference()
function editConference(confInfoGui = null) { function editConference(confInfoGui = null) {
var isCreation = !confInfoGui var isCreation = !confInfoGui
if (isCreation) { if (isCreation) {