Commit 2a53b6d6 authored by Ronan's avatar Ronan

feat(Call): add 2 sliders to set speaker/micro volume in media parameters popup

parent fbc4a086
...@@ -236,6 +236,7 @@ ...@@ -236,6 +236,7 @@
<file>ui/modules/Common/Form/Placements/FormTable.qml</file> <file>ui/modules/Common/Form/Placements/FormTable.qml</file>
<file>ui/modules/Common/Form/Placements/FormVGroup.qml</file> <file>ui/modules/Common/Form/Placements/FormVGroup.qml</file>
<file>ui/modules/Common/Form/SearchBox.qml</file> <file>ui/modules/Common/Form/SearchBox.qml</file>
<file>ui/modules/Common/Form/Slider.qml</file>
<file>ui/modules/Common/Form/StaticListForm.qml</file> <file>ui/modules/Common/Form/StaticListForm.qml</file>
<file>ui/modules/Common/Form/Switch.qml</file> <file>ui/modules/Common/Form/Switch.qml</file>
<file>ui/modules/Common/Form/Tab/TabBar.qml</file> <file>ui/modules/Common/Form/Tab/TabBar.qml</file>
...@@ -283,6 +284,7 @@ ...@@ -283,6 +284,7 @@
<file>ui/modules/Common/Styles/Form/Placements/FormTableStyle.qml</file> <file>ui/modules/Common/Styles/Form/Placements/FormTableStyle.qml</file>
<file>ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml</file> <file>ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml</file>
<file>ui/modules/Common/Styles/Form/SearchBoxStyle.qml</file> <file>ui/modules/Common/Styles/Form/SearchBoxStyle.qml</file>
<file>ui/modules/Common/Styles/Form/SliderStyle.qml</file>
<file>ui/modules/Common/Styles/Form/SwitchStyle.qml</file> <file>ui/modules/Common/Styles/Form/SwitchStyle.qml</file>
<file>ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml</file> <file>ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml</file>
<file>ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml</file> <file>ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml</file>
......
...@@ -105,6 +105,28 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -105,6 +105,28 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
float CallModel::getSpeakerVolumeGain () const {
return mCall->getSpeakerVolumeGain();
}
void CallModel::setSpeakerVolumeGain (float volume) {
Q_ASSERT(volume >= 0.0f && volume <= 1.0f);
mCall->setSpeakerVolumeGain(volume);
emit speakerVolumeGainChanged(mCall->getSpeakerVolumeGain());
}
float CallModel::getMicroVolumeGain () const {
return mCall->getMicrophoneVolumeGain();
}
void CallModel::setMicroVolumeGain (float volume) {
Q_ASSERT(volume >= 0.0f && volume <= 1.0f);
mCall->setMicrophoneVolumeGain(volume);
emit microVolumeGainChanged(mCall->getMicrophoneVolumeGain());
}
// -----------------------------------------------------------------------------
void CallModel::notifyCameraFirstFrameReceived (unsigned int width, unsigned int height) { void CallModel::notifyCameraFirstFrameReceived (unsigned int width, unsigned int height) {
if (mNotifyCameraFirstFrameReceived) { if (mNotifyCameraFirstFrameReceived) {
mNotifyCameraFirstFrameReceived = false; mNotifyCameraFirstFrameReceived = false;
......
...@@ -61,6 +61,9 @@ class CallModel : public QObject { ...@@ -61,6 +61,9 @@ class CallModel : public QObject {
Q_PROPERTY(QString remoteSas READ getRemoteSas NOTIFY securityUpdated); Q_PROPERTY(QString remoteSas READ getRemoteSas NOTIFY securityUpdated);
Q_PROPERTY(QString securedString READ getSecuredString NOTIFY securityUpdated); Q_PROPERTY(QString securedString READ getSecuredString NOTIFY securityUpdated);
Q_PROPERTY(float speakerVolumeGain READ getSpeakerVolumeGain WRITE setSpeakerVolumeGain NOTIFY speakerVolumeGainChanged);
Q_PROPERTY(float microVolumeGain READ getMicroVolumeGain WRITE setMicroVolumeGain NOTIFY microVolumeGainChanged);
public: public:
enum CallStatus { enum CallStatus {
CallStatusConnected, CallStatusConnected,
...@@ -128,6 +131,8 @@ signals: ...@@ -128,6 +131,8 @@ signals:
void statusChanged (CallStatus status); void statusChanged (CallStatus status);
void videoRequested (); void videoRequested ();
void securityUpdated (); void securityUpdated ();
void speakerVolumeGainChanged (float volume);
void microVolumeGainChanged (float volume);
void cameraFirstFrameReceived (unsigned int width, unsigned int height); void cameraFirstFrameReceived (unsigned int width, unsigned int height);
...@@ -181,6 +186,12 @@ private: ...@@ -181,6 +186,12 @@ private:
QString iceStateToString (linphone::IceState state) const; QString iceStateToString (linphone::IceState state) const;
float getSpeakerVolumeGain () const;
void setSpeakerVolumeGain (float volume);
float getMicroVolumeGain () const;
void setMicroVolumeGain (float volume);
bool mIsInConference = false; bool mIsInConference = false;
bool mPausedByRemote = false; bool mPausedByRemote = false;
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common 1.0 import Common 1.0
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common 1.0 import Common 1.0
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls import QtQuick.Controls 2.2 as Controls
import Common 1.0 import Common 1.0
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.2 as Controls
import Common.Styles 1.0
// =============================================================================
Controls.Slider {
id: slider
background: Rectangle {
color: SliderStyle.background.color
x: slider.leftPadding
y: slider.topPadding + slider.availableHeight / 2 - height / 2
implicitHeight: SliderStyle.background.height
implicitWidth: SliderStyle.background.width
height: implicitHeight
width: slider.availableWidth
radius: SliderStyle.background.radius
Rectangle {
color: SliderStyle.background.content.color
height: parent.height
width: slider.visualPosition * parent.width
radius: SliderStyle.background.content.radius
}
}
handle: Rectangle {
border.color: slider.pressed
? SliderStyle.handle.border.color.pressed
: SliderStyle.handle.border.color.normal
color: slider.pressed
? SliderStyle.handle.color.pressed
: SliderStyle.handle.color.normal
x: slider.leftPadding + slider.visualPosition * (slider.availableWidth - width)
y: slider.topPadding + slider.availableHeight / 2 - height / 2
implicitWidth: SliderStyle.handle.width
implicitHeight: SliderStyle.handle.height
radius: SliderStyle.handle.radius
}
}
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
// ============================================================================= // =============================================================================
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls import QtQuick.Controls 2.2 as Controls
import Common 1.0 import Common 1.0
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls import QtQuick.Controls 2.2 as Controls
import Common.Styles 1.0 import Common.Styles 1.0
import Utils 1.0 import Utils 1.0
......
pragma Singleton
import QtQml 2.2
import Colors 1.0
// =============================================================================
QtObject {
property QtObject background: QtObject {
property color color: Colors.n
property int height: 4
property int radius: 2
property int width: 200
property QtObject content: QtObject {
property color color: Colors.t
property int radius: 2
}
}
property QtObject handle: QtObject {
property int height: 16
property int radius: 13
property int width: 16
property QtObject border: QtObject {
property QtObject color: QtObject {
property color normal: Colors.n
property color pressed: Colors.n
}
}
property QtObject color: QtObject {
property color normal: Colors.e
property color pressed: Colors.q
}
}
}
...@@ -14,6 +14,7 @@ singleton ComboBoxStyle 1.0 Form/ComboBoxStyle.qml ...@@ -14,6 +14,7 @@ singleton ComboBoxStyle 1.0 Form/ComboBoxStyle.qml
singleton DroppableTextAreaStyle 1.0 Form/DroppableTextAreaStyle.qml singleton DroppableTextAreaStyle 1.0 Form/DroppableTextAreaStyle.qml
singleton ListFormStyle 1.0 Form/ListFormStyle.qml singleton ListFormStyle 1.0 Form/ListFormStyle.qml
singleton SearchBoxStyle 1.0 Form/SearchBoxStyle.qml singleton SearchBoxStyle 1.0 Form/SearchBoxStyle.qml
singleton SliderStyle 1.0 Form/SliderStyle.qml
singleton SwitchStyle 1.0 Form/SwitchStyle.qml singleton SwitchStyle 1.0 Form/SwitchStyle.qml
singleton TransparentTextInputStyle 1.0 Form/TransparentTextInputStyle.qml singleton TransparentTextInputStyle 1.0 Form/TransparentTextInputStyle.qml
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common 1.0 import Common 1.0
import Common.Styles 1.0 import Common.Styles 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import 'Window.js' as Logic import 'Window.js' as Logic
......
...@@ -23,6 +23,7 @@ ComboBox 1.0 Form/ComboBox.qml ...@@ -23,6 +23,7 @@ ComboBox 1.0 Form/ComboBox.qml
DroppableTextArea 1.0 Form/DroppableTextArea.qml DroppableTextArea 1.0 Form/DroppableTextArea.qml
ListForm 1.0 Form/ListForm.qml ListForm 1.0 Form/ListForm.qml
SearchBox 1.0 Form/SearchBox.qml SearchBox 1.0 Form/SearchBox.qml
Slider 1.0 Form/Slider.qml
StaticListForm 1.0 Form/StaticListForm.qml StaticListForm 1.0 Form/StaticListForm.qml
Switch 1.0 Form/Switch.qml Switch 1.0 Form/Switch.qml
TransparentTextInput 1.0 Form/TransparentTextInput.qml TransparentTextInput 1.0 Form/TransparentTextInput.qml
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
...@@ -2,6 +2,7 @@ import QtQuick 2.7 ...@@ -2,6 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
import Common.Styles 1.0
import Linphone 1.0 import Linphone 1.0
import Utils 1.0 import Utils 1.0
...@@ -10,6 +11,10 @@ import App.Styles 1.0 ...@@ -10,6 +11,10 @@ import App.Styles 1.0
// ============================================================================= // =============================================================================
DialogPlus { DialogPlus {
property var call
// ---------------------------------------------------------------------------
buttons: [ buttons: [
TextButtonB { TextButtonB {
text: qsTr('ok') text: qsTr('ok')
...@@ -23,6 +28,8 @@ DialogPlus { ...@@ -23,6 +28,8 @@ DialogPlus {
height: MultimediaParametersStyle.height height: MultimediaParametersStyle.height
width: MultimediaParametersStyle.width width: MultimediaParametersStyle.width
onCallChanged: !call && exit(0)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
Column { Column {
...@@ -34,19 +41,34 @@ DialogPlus { ...@@ -34,19 +41,34 @@ DialogPlus {
width: parent.width width: parent.width
Icon { Icon {
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: ComboBoxStyle.background.height
icon: 'speaker' icon: 'speaker'
iconSize: MultimediaParametersStyle.column.entry.iconSize iconSize: MultimediaParametersStyle.column.entry.iconSize
} }
ComboBox { Column {
Layout.fillWidth: true Layout.fillWidth: true
currentIndex: Utils.findIndex(model, function (device) { spacing: MultimediaParametersStyle.column.entry.spacing2
return device === SettingsModel.playbackDevice
}) ComboBox {
model: SettingsModel.playbackDevices currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.playbackDevice
})
model: SettingsModel.playbackDevices
width: parent.width
onActivated: SettingsModel.playbackDevice = model[index] onActivated: SettingsModel.playbackDevice = model[index]
}
Slider {
width: parent.width
Component.onCompleted: value = call.speakerVolumeGain
onPositionChanged: call.speakerVolumeGain = position
}
} }
} }
...@@ -55,19 +77,34 @@ DialogPlus { ...@@ -55,19 +77,34 @@ DialogPlus {
width: parent.width width: parent.width
Icon { Icon {
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: ComboBoxStyle.background.height
icon: 'micro' icon: 'micro'
iconSize: MultimediaParametersStyle.column.entry.iconSize iconSize: MultimediaParametersStyle.column.entry.iconSize
} }
ComboBox { Column {
Layout.fillWidth: true Layout.fillWidth: true
currentIndex: Utils.findIndex(model, function (device) { spacing: MultimediaParametersStyle.column.entry.spacing2
return device === SettingsModel.captureDevice
}) ComboBox {
model: SettingsModel.captureDevices currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.captureDevice
})
model: SettingsModel.captureDevices
width: parent.width
onActivated: SettingsModel.captureDevice = model[index]
}
Slider {
width: parent.width
onActivated: SettingsModel.captureDevice = model[index] Component.onCompleted: value = call.microVolumeGain
onPositionChanged: call.microVolumeGain = position
}
} }
} }
......
...@@ -106,7 +106,9 @@ function openCallStatistics () { ...@@ -106,7 +106,9 @@ function openCallStatistics () {
} }
function openMediaParameters () { function openMediaParameters () {
window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/MultimediaParameters.qml')) window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/MultimediaParameters.qml'), {
call: incall.call
})
} }
function showFullscreen () { function showFullscreen () {
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import Utils 1.0 import Utils 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.1 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
......
...@@ -4,7 +4,7 @@ import QtQml 2.2 ...@@ -4,7 +4,7 @@ import QtQml 2.2
// ============================================================================= // =============================================================================
QtObject { QtObject {
property int height: 262 property int height: 312
property int width: 450 property int width: 450
property QtObject column: QtObject { property QtObject column: QtObject {
...@@ -13,6 +13,7 @@ QtObject { ...@@ -13,6 +13,7 @@ QtObject {
property QtObject entry: QtObject { property QtObject entry: QtObject {
property int iconSize: 24 property int iconSize: 24
property int spacing: 10 property int spacing: 10