Commit 3ce3a5cc authored by Sylvain Berfini's avatar Sylvain Berfini

Added microVu on conference + updated linphone to fix conference pause/resume

parent b0350122
...@@ -116,6 +116,30 @@ bool ConferenceModel::getRecording () const { ...@@ -116,6 +116,30 @@ bool ConferenceModel::getRecording () const {
return mRecording; return mRecording;
} }
// -----------------------------------------------------------------------------
#define VU_MIN (-20.f)
#define VU_MAX (4.f)
inline float computeVu (float volume) {
if (volume < VU_MIN)
return 0.f;
if (volume > VU_MAX)
return 1.f;
return (volume - VU_MIN) / (VU_MAX - VU_MIN);
}
#undef VU_MIN
#undef VU_MAX
float ConferenceModel::getMicroVu () const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
return computeVu(core->getConferenceLocalInputVolume());
}
// -----------------------------------------------------------------------------
void ConferenceModel::leave() { void ConferenceModel::leave() {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
core->leaveConference(); core->leaveConference();
......
...@@ -35,6 +35,8 @@ class ConferenceModel : public QSortFilterProxyModel { ...@@ -35,6 +35,8 @@ class ConferenceModel : public QSortFilterProxyModel {
Q_PROPERTY(int count READ getCount NOTIFY countChanged); Q_PROPERTY(int count READ getCount NOTIFY countChanged);
Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged); Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged);
Q_PROPERTY(float microVu READ getMicroVu CONSTANT);
Q_PROPERTY(bool recording READ getRecording NOTIFY recordingChanged); Q_PROPERTY(bool recording READ getRecording NOTIFY recordingChanged);
Q_PROPERTY(bool isInConf READ isInConference NOTIFY conferenceChanged); Q_PROPERTY(bool isInConf READ isInConference NOTIFY conferenceChanged);
...@@ -67,6 +69,7 @@ private: ...@@ -67,6 +69,7 @@ private:
bool getMicroMuted () const; bool getMicroMuted () const;
void setMicroMuted (bool status); void setMicroMuted (bool status);
float getMicroVu () const;
bool isInConference () const; bool isInConference () const;
......
...@@ -189,14 +189,40 @@ Rectangle { ...@@ -189,14 +189,40 @@ Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: CallStyle.actionArea.height Layout.preferredHeight: CallStyle.actionArea.height
RowLayout { GridLayout {
anchors { anchors {
left: parent.left left: parent.left
leftMargin: CallStyle.actionArea.leftButtonsGroupMargin leftMargin: CallStyle.actionArea.leftButtonsGroupMargin
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
spacing: ActionBarStyle.spacing columns: incall.width < CallStyle.actionArea.lowWidth ? 2 : 4
rowSpacing: ActionBarStyle.spacing
Row {
spacing: CallStyle.actionArea.vu.spacing
VuMeter {
Timer {
interval: 50
repeat: true
running: micro.enabled
onTriggered: parent.value = conference.conferenceModel.microVu
}
enabled: micro.enabled
}
ActionSwitch {
id: micro
icon: 'micro'
iconSize: CallStyle.actionArea.iconSize
onClicked: conference.conferenceModel.microMuted = !conference.conferenceModel.microMuted
}
}
} }
ActionBar { ActionBar {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment