Fixes, debug feedback, set duration, allow manual set on time, fix mosaic test mode

This commit is contained in:
Julien Wadel 2021-12-13 00:27:14 +01:00
parent d376abadbe
commit c83212fbeb
9 changed files with 67 additions and 22 deletions

View file

@ -679,7 +679,10 @@ void CallModel::setVideoEnabled (bool status) {
case linphone::Call::State::Connected:
case linphone::Call::State::StreamsRunning:
break;
default: return;
default: {
qWarning() << "Cannot set Video mode because of call status : " << (int)mCall->getState() << " is not in {" <<(int)linphone::Call::State::Connected << ", " <<(int)linphone::Call::State::StreamsRunning << "}";
return;
}
}
if (status == getVideoEnabled())

View file

@ -413,7 +413,7 @@ QVariantMap CallsListModel::createConference(ConferenceInfoModel * conferenceInf
auto proxy = core->getDefaultProxyConfig();
params->setVideoEnabled(true);
params->setStartTime(conferenceInfo->getConferenceInfo()->getDateTime());
params->setEndTime(conferenceInfo->getConferenceInfo()->getDateTime()+conferenceInfo->getConferenceInfo()->getDuration()*60*1000);
params->setEndTime(conferenceInfo->getConferenceInfo()->getDateTime()+conferenceInfo->getConferenceInfo()->getDuration()*60);
params->setLayout(linphone::ConferenceLayout::Grid);
//params->setDescription(conferenceInfo->getConferenceInfo()->getDescription());

View file

@ -109,7 +109,13 @@ QDateTime ConferenceInfoModel::getDateTime() const{
}
int ConferenceInfoModel::getDuration() const{
return mConferenceInfo->getDuration();
int duration = mConferenceInfo->getDuration();
qWarning() << "Duration: " << duration;
return duration;
}
QDateTime ConferenceInfoModel::getEndDateTime() const{
return getDateTime().addSecs(getDuration()*60);
}
QString ConferenceInfoModel::getOrganizer() const{
@ -149,6 +155,7 @@ void ConferenceInfoModel::setDateTime(const QDateTime& dateTime){
}
void ConferenceInfoModel::setDuration(const int& duration){
qWarning() << "Set Duration: " << duration;
mConferenceInfo->setDuration(duration);
emit durationChanged();
}

View file

@ -34,6 +34,7 @@ public:
Q_PROPERTY(QDateTime dateTime READ getDateTime WRITE setDateTime NOTIFY dateTimeChanged)
Q_PROPERTY(int duration READ getDuration WRITE setDuration NOTIFY durationChanged)
Q_PROPERTY(QDateTime endDateTime READ getEndDateTime NOTIFY dateTimeChanged)
Q_PROPERTY(QString organizer READ getOrganizer WRITE setOrganizer NOTIFY organizerChanged)
Q_PROPERTY(QString subject READ getSubject WRITE setSubject NOTIFY subjectChanged)
Q_PROPERTY(QString description READ getDescription WRITE setDescription NOTIFY descriptionChanged)
@ -52,6 +53,7 @@ public:
QDateTime getDateTime() const;
int getDuration() const;
QDateTime getEndDateTime() const;
QString getOrganizer() const;
QString getSubject() const;
QString getDescription() const;

View file

@ -328,6 +328,7 @@ void CoreHandlers::onEcCalibrationResult(
void CoreHandlers::onConferenceInfoCreated(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo){
qWarning() << "onConferenceInfoCreated : sending invitation only for known participants (API fail? this should be done from SDK)";
qWarning() << "onConferenceInfoCreated : Duration: " << conferenceInfo->getDuration();
for(auto participant : conferenceInfo->getParticipants()){
std::shared_ptr<linphone::ChatRoomParams> params = core->createDefaultChatRoomParams();

View file

@ -14,7 +14,7 @@ Avatar {
property var participantDeviceModel
readonly property var _sipAddressObserver: call ? SipAddressesModel.getSipAddressObserver(call.fullPeerAddress, call.fullLocalAddress)
: SipAddressesModel.getSipAddressObserver(participantdeviceModel.address, '')
: SipAddressesModel.getSipAddressObserver(participantDeviceModel.address, '')
readonly property var _username: UtilsCpp.getDisplayName(_sipAddressObserver.peerAddress)
backgroundColor: CallStyle.container.avatar.backgroundColor
@ -23,11 +23,14 @@ Avatar {
: 'transparent'
image: {
var contact = _sipAddressObserver.contact
return contact && contact.vcard.avatar
if (_sipAddressObserver) {
var contact = _sipAddressObserver.contact
return contact && contact.vcard.avatar
}else
return null;
}
username: call && call.status === CallModel.CallStatusPaused ? '' : _username
username: call && call.status === CallModel.CallStatusPaused || !_username? '' : _username
Text {
anchors.fill: parent

View file

@ -11,6 +11,10 @@ import UtilsCpp 1.0
import App.Styles 1.0
// Temp
import 'Incall.js' as Logic
// =============================================================================
Rectangle {
@ -18,15 +22,19 @@ Rectangle {
property CallModel callModel
onCallModelChanged: if(callModel) {
grid.setParticipantDevicesMode()
}else
grid.setTestMode()
// ---------------------------------------------------------------------------
color: VideoConferenceStyle.backgroundColor
Component.onCompleted: {
for(var i = 0 ; i < 5 ; ++i)
grid.add({color: '#'+ Math.floor(Math.random()*255).toString(16)
+Math.floor(Math.random()*255).toString(16)
+Math.floor(Math.random()*255).toString(16)})
if(!callModel){
grid.setTestMode()
}else
grid.setParticipantDevicesMode()
}
// ---------------------------------------------------------------------------
@ -113,6 +121,20 @@ Rectangle {
anchors.fill: parent
property int radius : 8
function setTestMode(){
grid.clear()
gridModel.model = gridModel.defaultList
for(var i = 0 ; i < 5 ; ++i)
grid.add({color: '#'+ Math.floor(Math.random()*255).toString(16)
+Math.floor(Math.random()*255).toString(16)
+Math.floor(Math.random()*255).toString(16)})
console.log("Setting test mode : count=" + gridModel.defaultList.count)
}
function setParticipantDevicesMode(){
console.log("Setting participant mode : count=" + gridModel.participantDevices.count)
grid.clear()
gridModel.model = gridModel.participantDevices
}
delegateModel: DelegateModel{
id: gridModel
@ -131,7 +153,7 @@ Rectangle {
delegate: Rectangle{
color: gridModel.defaultList.get(index).color ? gridModel.defaultList.get(index).color : ''
color: !conference.callModel && gridModel.defaultList.get(index).color ? gridModel.defaultList.get(index).color : ''
//color: gridModel.model.get(index) && gridModel.model.get(index).color ? gridModel.model.get(index).color : '' // modelIndex is a custom index because by Mosaic modelisation, it is not accessible.
//color: modelData.color ? modelData.color : ''
radius: grid.radius
@ -165,7 +187,8 @@ Rectangle {
active: conference.callModel && (gridModel.participantDevices.getAt(index).videoEnabled && !_fullscreen)
sourceComponent: gridModel.participantDevices.getAt(index).isMe ? cameraPreview : camera
sourceComponent: conference.callModel ? gridModel.participantDevices.getAt(index).isMe ? cameraPreview : camera
: null
Component {
id: camera
@ -321,9 +344,9 @@ Rectangle {
id: camera
isCustom: true
backgroundRadius: 90
colorSet: conference.callModel.videoEnabled ? VideoConferenceStyle.buttons.cameraOn : VideoConferenceStyle.buttons.cameraOff
updating: conference.callModel.videoEnabled && conference.callModel.updating
onClicked: conference.callModel.videoEnabled = !conference.callModel.videoEnabled
colorSet: conference.callModel && conference.callModel.videoEnabled ? VideoConferenceStyle.buttons.cameraOn : VideoConferenceStyle.buttons.cameraOff
//updating: conference.callModel.videoEnabled && conference.callModel.updating
onClicked: if(conference.callModel) conference.callModel.videoEnabled = !conference.callModel.videoEnabled
}
}
RowLayout{

View file

@ -189,6 +189,7 @@ ColumnLayout {
elide: Text.ElideRight
font.pointSize: ConferencesStyle.conference.schedule.pointSize
text: Qt.formatDateTime(modelData.dateTime, 'yyyy/MM/dd hh:mm')
+', end at: ' +Qt.formatDateTime(modelData.endDateTime, 'yyyy/MM/dd hh:mm')
}
}
Text{

View file

@ -87,7 +87,7 @@ DialogPlus {
onClicked: exit(0)
},
TextButtonB {
//enabled: selectedParticipants.count >= conferenceManager.minParticipants && subject.text != '' && AccountSettingsModel.conferenceURI != ''
enabled: selectedParticipants.count >= conferenceManager.minParticipants && subject.text != '' && AccountSettingsModel.conferenceURI != ''
//: 'Launch' : Start button
text: qsTr('startButton')
capitalization: Font.AllUppercase
@ -100,13 +100,15 @@ DialogPlus {
onClicked: {
if( scheduledSwitch.checked){
var startDateTime = new Date()
startDateTime.setDate(Date.fromLocaleDateString(locale, dateField.text, Locale.ShortFormat))
startDateTime.setTime( Date.fromLocaleTimeString(locale, timeField.text, Locale.ShortFormat))
startDateTime.setDate(dateField.getDate())
startDateTime.setTime(timeField.getTime())
conferenceInfoModel.dateTime = startDateTime
conferenceInfoModel.duration = durationField.text
}
conferenceInfoModel.subject = subject.text
conferenceInfoModel.description = description.text
conferenceInfoModel.setParticipants(selectedParticipants.participantListModel)
var callsWindow = App.getCallsWindow()
App.smartShowWindow(callsWindow)
@ -265,7 +267,10 @@ DialogPlus {
text = date.toLocaleTimeString(scheduleForm.locale, 'hh:mm')
}
MouseArea{
anchors.fill: parent
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width-50
onClicked: {
if( rightStackView.currentItemType === 2) {
rightStackView.currentItemType = 0
@ -279,7 +284,7 @@ DialogPlus {
}
}
}
NumericField{ text: '1200'; readOnly: true; Layout.preferredWidth: parent.cellWidth}
NumericField{id: durationField; text: '1200'; Layout.preferredWidth: parent.cellWidth}
TextField{ text: 'Paris'; readOnly: true; Layout.preferredWidth: parent.cellWidth}
function updateDateTime(){
var storedDate = new Date()
@ -289,7 +294,7 @@ DialogPlus {
}
var currentDate = new Date()
if(currentDate >= storedDate){
var nextStoredDate = UtilsCpp.addMinutes(new Date(), 5)
var nextStoredDate = UtilsCpp.addMinutes(new Date(), 1)
dateField.setDate(nextStoredDate)
timeField.setTime(nextStoredDate)
}