fix record ui + pause

This commit is contained in:
Gaelle Braud 2024-07-05 10:57:30 +02:00
parent fa259d2a31
commit e3b587bdbd
4 changed files with 31 additions and 31 deletions

View file

@ -268,6 +268,7 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
setSpeakerVolumeGain(speakerVolume);
setMicrophoneVolumeGain(micVolume);
setRecordable(state == linphone::Call::State::StreamsRunning);
setPaused(state == linphone::Call::State::Paused || state == linphone::Call::State::PausedByRemote);
});
});
mCallModelConnection->makeConnectToModel(&CallModel::statusChanged, [this](linphone::Call::Status status) {
@ -276,9 +277,6 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
mCallModelConnection->makeConnectToCore(&CallCore::lSetPaused, [this](bool paused) {
mCallModelConnection->invokeToModel([this, paused]() { mCallModel->setPaused(paused); });
});
mCallModelConnection->makeConnectToModel(&CallModel::pausedChanged, [this](bool paused) {
mCallModelConnection->invokeToCore([this, paused]() { setPaused(paused); });
});
mCallModelConnection->makeConnectToCore(&CallCore::lTransferCall, [this](QString address) {
mCallModelConnection->invokeToModel([this, address]() {

View file

@ -90,15 +90,12 @@ void CallModel::terminate() {
void CallModel::setPaused(bool paused) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
linphone::Status status = -1;
if (paused) {
if (mMonitor->getConference()) status = mMonitor->getConference()->leave();
else status = mMonitor->pause();
if (status == 0) emit pausedChanged(paused);
if (mMonitor->getConference()) mMonitor->getConference()->leave();
mMonitor->pause();
} else {
if (mMonitor->getConference()) status = mMonitor->getConference()->enter();
else status = mMonitor->resume();
if (status == 0) emit pausedChanged(paused);
if (mMonitor->getConference()) mMonitor->getConference()->enter();
mMonitor->resume();
}
}

View file

@ -421,31 +421,35 @@ AppWindow {
Control.Control {
visible: mainWindow.call && (mainWindow.call.core.recording || mainWindow.call.core.remoteRecording)
width: 563 * DefaultStyle.dp
height: 45 * DefaultStyle.dp
anchors.centerIn: parent
leftPadding: 15 * DefaultStyle.dp
leftPadding: 14 * DefaultStyle.dp
rightPadding: 14 * DefaultStyle.dp
topPadding: 6 * DefaultStyle.dp
bottomPadding: 6 * DefaultStyle.dp
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_500
radius: 10 * DefaultStyle.dp
}
contentItem: RowLayout {
EffectImage {
imageSource: AppIcons.recordFill
colorizationColor: DefaultStyle.danger_500main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
}
Text {
color: DefaultStyle.danger_500main
font.pixelSize: 14 * DefaultStyle.dp
text: mainWindow.call
? mainWindow.call.core.recording
? mainWindow.conference ? qsTr("Vous enregistrez la réunion") : qsTr("Vous enregistrez l'appel")
: mainWindow.conference ? qsTr("Un participant enregistre la réunion") : qsTr("Votre correspondant enregistre l'appel")
: ""
spacing: 85 * DefaultStyle.dp
RowLayout {
spacing: 15 * DefaultStyle.dp
EffectImage {
imageSource: AppIcons.recordFill
colorizationColor: DefaultStyle.danger_500main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
}
Text {
color: DefaultStyle.danger_500main
font.pixelSize: 14 * DefaultStyle.dp
text: mainWindow.call
? mainWindow.call.core.recording
? mainWindow.conference ? qsTr("Vous enregistrez la réunion") : qsTr("Vous enregistrez l'appel")
: mainWindow.conference ? qsTr("Un participant enregistre la réunion") : qsTr("Votre correspondant enregistre l'appel")
: ""
}
}
Button {
visible: mainWindow.call && mainWindow.call.core.recording
@ -738,6 +742,7 @@ AppWindow {
}
}
onClicked: {
console.log("call is paused", modelData.core.paused)
modelData.core.lSetPaused(!modelData.core.paused)
}
}

View file

@ -280,11 +280,11 @@ Item {
CheckableButton {
id: muteIcon
icon.source: AppIcons.microphoneSlash
Layout.preferredWidth: 18 * DefaultStyle.dp
Layout.preferredHeight: 18 * DefaultStyle.dp
Layout.preferredWidth: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp)
Layout.preferredHeight: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp)
visible: mainItem.mutedStatus
icon.width: 19 * DefaultStyle.dp
icon.height: 19 * DefaultStyle.dp
icon.width: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp)
icon.height: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp)
enabled: false
contentImageColor: DefaultStyle.main2_500main
backgroundColor: DefaultStyle.grey_0