diff --git a/Linphone/core/call/CallCore.cpp b/Linphone/core/call/CallCore.cpp index 495db902..9837af33 100644 --- a/Linphone/core/call/CallCore.cpp +++ b/Linphone/core/call/CallCore.cpp @@ -246,31 +246,33 @@ void CallCore::setSelf(QSharedPointer me) { mCallModelConnection->makeConnectToModel(&CallModel::microphoneVolumeChanged, [this](float volume) { mCallModelConnection->invokeToCore([this, volume]() { setMicrophoneVolume(volume); }); }); - mCallModelConnection->makeConnectToModel( - &CallModel::stateChanged, - [this](std::shared_ptr call, linphone::Call::State state, const std::string &message) { - mCallModelConnection->invokeToCore([this, state, message]() { - setState(LinphoneEnums::fromLinphone(state), Utils::coreStringToAppString(message)); - }); - double speakerVolume = mSpeakerVolumeGain; - double micVolume = mMicrophoneVolumeGain; - if (state == linphone::Call::State::StreamsRunning) { - speakerVolume = mCallModel->getSpeakerVolumeGain(); - if (speakerVolume < 0) { - speakerVolume = CoreModel::getInstance()->getCore()->getPlaybackGainDb(); - } - micVolume = mCallModel->getMicrophoneVolumeGain(); - if (micVolume < 0) { - micVolume = CoreModel::getInstance()->getCore()->getMicGainDb(); - } - } - mCallModelConnection->invokeToCore([this, state, speakerVolume, micVolume]() { - setSpeakerVolumeGain(speakerVolume); - setMicrophoneVolumeGain(micVolume); - setRecordable(state == linphone::Call::State::StreamsRunning); - setPaused(state == linphone::Call::State::Paused || state == linphone::Call::State::PausedByRemote); - }); - }); + mCallModelConnection->makeConnectToModel(&CallModel::stateChanged, [this](std::shared_ptr call, + linphone::Call::State state, + const std::string &message) { + mCallModelConnection->invokeToCore([this, state, message]() { + setState(LinphoneEnums::fromLinphone(state), Utils::coreStringToAppString(message)); + }); + double speakerVolume = mSpeakerVolumeGain; + double micVolume = mMicrophoneVolumeGain; + if (state == linphone::Call::State::StreamsRunning) { + speakerVolume = mCallModel->getSpeakerVolumeGain(); + if (speakerVolume < 0) { + speakerVolume = CoreModel::getInstance()->getCore()->getPlaybackGainDb(); + } + micVolume = mCallModel->getMicrophoneVolumeGain(); + if (micVolume < 0) { + micVolume = CoreModel::getInstance()->getCore()->getMicGainDb(); + } + } + auto subject = call->getConference() ? Utils::coreStringToAppString(call->getConference()->getSubject()) : ""; + mCallModelConnection->invokeToCore([this, state, speakerVolume, micVolume, subject]() { + setSpeakerVolumeGain(speakerVolume); + setMicrophoneVolumeGain(micVolume); + setRecordable(state == linphone::Call::State::StreamsRunning); + setPaused(state == linphone::Call::State::Paused || state == linphone::Call::State::PausedByRemote); + if (mConference) mConference->setSubject(subject); + }); + }); mCallModelConnection->makeConnectToModel(&CallModel::statusChanged, [this](linphone::Call::Status status) { mCallModelConnection->invokeToCore([this, status]() { setStatus(LinphoneEnums::fromLinphone(status)); }); }); diff --git a/Linphone/core/conference/ConferenceCore.cpp b/Linphone/core/conference/ConferenceCore.cpp index f4d3f011..3ef608cc 100644 --- a/Linphone/core/conference/ConferenceCore.cpp +++ b/Linphone/core/conference/ConferenceCore.cpp @@ -59,7 +59,7 @@ void ConferenceCore::setSelf(QSharedPointer me) { [this](const std::shared_ptr &participantDevice) { auto device = ParticipantDeviceCore::create(participantDevice); mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); }); - }); + }); mConferenceModelConnection->makeConnectToModel(&ConferenceModel::participantDeviceStateChanged, [this]() { int count = mConferenceModel->getParticipantDeviceCount(); @@ -89,6 +89,14 @@ bool ConferenceCore::updateLocalParticipant() { // true if changed QString ConferenceCore::getSubject() const { return mSubject; } + +void ConferenceCore::setSubject(const QString &subject) { + if (mSubject != subject) { + mSubject = subject; + emit subjectChanged(); + } +} + QDateTime ConferenceCore::getStartDate() const { return mStartDate; } diff --git a/Linphone/core/conference/ConferenceCore.hpp b/Linphone/core/conference/ConferenceCore.hpp index efab3838..bb53d43a 100644 --- a/Linphone/core/conference/ConferenceCore.hpp +++ b/Linphone/core/conference/ConferenceCore.hpp @@ -41,7 +41,7 @@ public: // Q_PROPERTY(ParticipantModel* localParticipant READ getLocalParticipant NOTIFY localParticipantChanged) Q_PROPERTY(bool isReady MEMBER mIsReady WRITE setIsReady NOTIFY isReadyChanged) - Q_PROPERTY(QString subject MEMBER mSubject CONSTANT) + Q_PROPERTY(QString subject READ getSubject WRITE setSubject NOTIFY subjectChanged) Q_PROPERTY(bool isLocalScreenSharing MEMBER mIsLocalScreenSharing WRITE setIsLocalScreenSharing NOTIFY isLocalScreenSharingChanged) Q_PROPERTY(bool isScreenSharingEnabled MEMBER mIsScreenSharingEnabled WRITE setIsScreenSharingEnabled NOTIFY @@ -59,6 +59,7 @@ public: bool updateLocalParticipant(); // true if changed QString getSubject() const; + void setSubject(const QString &subject); QDateTime getStartDate() const; Q_INVOKABLE qint64 getElapsedSeconds() const; int getParticipantDeviceCount() const; @@ -84,6 +85,7 @@ signals: void isScreenSharingEnabledChanged(); void participantDeviceCountChanged(); void activeSpeakerChanged(); + void subjectChanged(); void lToggleScreenSharing(); diff --git a/Linphone/model/conference/ConferenceModel.cpp b/Linphone/model/conference/ConferenceModel.cpp index 300e6bc6..a0fa4288 100644 --- a/Linphone/model/conference/ConferenceModel.cpp +++ b/Linphone/model/conference/ConferenceModel.cpp @@ -143,6 +143,10 @@ void ConferenceModel::toggleScreenSharing() { if (enable) { params->setConferenceVideoLayout(linphone::Conference::Layout::ActiveSpeaker); params->enableVideo(true); + auto videoDirection = params->getVideoDirection(); + if (videoDirection != linphone::MediaDirection::SendOnly && + videoDirection != linphone::MediaDirection::SendRecv) + params->setVideoDirection(linphone::MediaDirection::SendOnly); } if (params->isValid()) mMonitor->getCall()->update(params); else lCritical() << log().arg("Cannot toggle screen sharing because parameters are invalid");