Commit 2a53b6d6 authored by Ronan Abhamon's avatar Ronan Abhamon

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

parent fbc4a086
......@@ -236,6 +236,7 @@
<file>ui/modules/Common/Form/Placements/FormTable.qml</file>
<file>ui/modules/Common/Form/Placements/FormVGroup.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/Switch.qml</file>
<file>ui/modules/Common/Form/Tab/TabBar.qml</file>
......@@ -283,6 +284,7 @@
<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/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/Tab/TabButtonStyle.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
// -----------------------------------------------------------------------------
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) {
if (mNotifyCameraFirstFrameReceived) {
mNotifyCameraFirstFrameReceived = false;
......
......@@ -61,6 +61,9 @@ class CallModel : public QObject {
Q_PROPERTY(QString remoteSas READ getRemoteSas 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:
enum CallStatus {
CallStatusConnected,
......@@ -128,6 +131,8 @@ signals:
void statusChanged (CallStatus status);
void videoRequested ();
void securityUpdated ();
void speakerVolumeGainChanged (float volume);
void microVolumeGainChanged (float volume);
void cameraFirstFrameReceived (unsigned int width, unsigned int height);
......@@ -181,6 +186,12 @@ private:
QString iceStateToString (linphone::IceState state) const;
float getSpeakerVolumeGain () const;
void setSpeakerVolumeGain (float volume);
float getMicroVolumeGain () const;
void setMicroVolumeGain (float volume);
bool mIsInConference = false;
bool mPausedByRemote = false;
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.2
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common 1.0
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common 1.0
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls
import QtQuick.Controls 2.2 as Controls
import Common 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.Controls 2.1
import QtQuick.Controls 2.2
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
// =============================================================================
......
import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.3
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls
import QtQuick.Controls 2.2 as Controls
import Common 1.0
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1 as Controls
import QtQuick.Controls 2.2 as Controls
import Common.Styles 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
singleton DroppableTextAreaStyle 1.0 Form/DroppableTextAreaStyle.qml
singleton ListFormStyle 1.0 Form/ListFormStyle.qml
singleton SearchBoxStyle 1.0 Form/SearchBoxStyle.qml
singleton SliderStyle 1.0 Form/SliderStyle.qml
singleton SwitchStyle 1.0 Form/SwitchStyle.qml
singleton TransparentTextInputStyle 1.0 Form/TransparentTextInputStyle.qml
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common 1.0
import Common.Styles 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import 'Window.js' as Logic
......
......@@ -23,6 +23,7 @@ ComboBox 1.0 Form/ComboBox.qml
DroppableTextArea 1.0 Form/DroppableTextArea.qml
ListForm 1.0 Form/ListForm.qml
SearchBox 1.0 Form/SearchBox.qml
Slider 1.0 Form/Slider.qml
StaticListForm 1.0 Form/StaticListForm.qml
Switch 1.0 Form/Switch.qml
TransparentTextInput 1.0 Form/TransparentTextInput.qml
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
......
......@@ -2,6 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Common.Styles 1.0
import Linphone 1.0
import Utils 1.0
......@@ -10,6 +11,10 @@ import App.Styles 1.0
// =============================================================================
DialogPlus {
property var call
// ---------------------------------------------------------------------------
buttons: [
TextButtonB {
text: qsTr('ok')
......@@ -23,6 +28,8 @@ DialogPlus {
height: MultimediaParametersStyle.height
width: MultimediaParametersStyle.width
onCallChanged: !call && exit(0)
// ---------------------------------------------------------------------------
Column {
......@@ -34,19 +41,34 @@ DialogPlus {
width: parent.width
Icon {
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: ComboBoxStyle.background.height
icon: 'speaker'
iconSize: MultimediaParametersStyle.column.entry.iconSize
}
ComboBox {
Column {
Layout.fillWidth: true
currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.playbackDevice
})
model: SettingsModel.playbackDevices
spacing: MultimediaParametersStyle.column.entry.spacing2
ComboBox {
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 {
width: parent.width
Icon {
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: ComboBoxStyle.background.height
icon: 'micro'
iconSize: MultimediaParametersStyle.column.entry.iconSize
}
ComboBox {
Column {
Layout.fillWidth: true
currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.captureDevice
})
model: SettingsModel.captureDevices
spacing: MultimediaParametersStyle.column.entry.spacing2
ComboBox {
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 () {
}
function openMediaParameters () {
window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/MultimediaParameters.qml'))
window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/MultimediaParameters.qml'), {
call: incall.call
})
}
function showFullscreen () {
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Window 2.2
import Utils 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.3
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
......
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
......
......@@ -4,7 +4,7 @@ import QtQml 2.2
// =============================================================================
QtObject {
property int height: 262
property int height: 312
property int width: 450
property QtObject column: QtObject {
......@@ -13,6 +13,7 @@ QtObject {
property QtObject entry: QtObject {
property int iconSize: 24
property int spacing: 10
property int spacing2: 5
}
}
}
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