Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
773a8c76
Commit
773a8c76
authored
Mar 02, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsAudio): supports devices selection
parent
86eb025c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
208 additions
and
0 deletions
+208
-0
en.ts
linphone-desktop/assets/languages/en.ts
+19
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+19
-0
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+83
-0
SettingsModel.hpp
linphone-desktop/src/components/settings/SettingsModel.hpp
+34
-0
SettingsAudio.qml
linphone-desktop/ui/views/App/Settings/SettingsAudio.qml
+53
-0
No files found.
linphone-desktop/assets/languages/en.ts
View file @
773a8c76
...
@@ -663,6 +663,25 @@ Server url not configured.</translation>
...
@@ -663,6 +663,25 @@ Server url not configured.</translation>
<
translation
type
=
"
vanished
"
>
Search
contact
or
enter
SIP
address
<
/translation
>
<
translation
type
=
"
vanished
"
>
Search
contact
or
enter
SIP
address
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
SettingsAudio
<
/name
>
<
message
>
<
source
>
audioTitle
<
/source
>
<
translation
>
Audio
parameters
<
/translation
>
<
/message
>
<
message
>
<
source
>
playbackDeviceLabel
<
/source
>
<
translation
>
Playback
device
<
/translation
>
<
/message
>
<
message
>
<
source
>
captureDeviceLabel
<
/source
>
<
translation
>
Capture
device
<
/translation
>
<
/message
>
<
message
>
<
source
>
ringerDeviceLabel
<
/source
>
<
translation
>
Ringer
device
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
SettingsCallsChat
<
/name
>
<
name
>
SettingsCallsChat
<
/name
>
<
message
>
<
message
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
773a8c76
...
@@ -673,6 +673,25 @@ Url du serveur non configurée.</translation>
...
@@ -673,6 +673,25 @@ Url du serveur non configurée.</translation>
<
translation
type
=
"
vanished
"
>
Rechercher
un
contact
ou
entrer
une
adresse
SIP
<
/translation
>
<
translation
type
=
"
vanished
"
>
Rechercher
un
contact
ou
entrer
une
adresse
SIP
<
/translation
>
<
/message
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
name
>
SettingsAudio
<
/name
>
<
message
>
<
source
>
audioTitle
<
/source
>
<
translation
>
Param
è
tres
audio
<
/translation
>
<
/message
>
<
message
>
<
source
>
playbackDeviceLabel
<
/source
>
<
translation
>
P
é
riph
é
rique
d
&
apos
;
é
coute
<
/translation
>
<
/message
>
<
message
>
<
source
>
captureDeviceLabel
<
/source
>
<
translation
>
P
é
riph
é
rique
de
capture
<
/translation
>
<
/message
>
<
message
>
<
source
>
ringerDeviceLabel
<
/source
>
<
translation
>
P
é
riph
é
rique
de
sonnerie
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
context
>
<
name
>
SettingsCallsChat
<
/name
>
<
name
>
SettingsCallsChat
<
/name
>
<
message
>
<
message
>
...
...
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
773a8c76
...
@@ -38,6 +38,89 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
...
@@ -38,6 +38,89 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
m_config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
m_config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
}
}
// =============================================================================
// Audio.
// =============================================================================
QVariantList
SettingsModel
::
getAudioCodecs
()
const
{
QVariantList
list
;
for
(
const
auto
&
codec
:
CoreManager
::
getInstance
()
->
getCore
()
->
getAudioCodecs
())
{
QVariantMap
map
;
map
[
"mime"
]
=
::
Utils
::
linphoneStringToQString
(
codec
->
getMimeType
());
map
[
"channels"
]
=
codec
->
getChannels
();
map
[
"bitrate"
]
=
codec
->
getNormalBitrate
();
map
[
"type"
]
=
codec
->
getType
();
map
[
"isVbr"
]
=
codec
->
isVbr
();
list
<<
map
;
}
return
list
;
}
void
SettingsModel
::
setAudioCodecs
(
const
QVariantList
&
codecs
)
{
// TODO
emit
audioCodecsChanged
(
codecs
);
}
// -----------------------------------------------------------------------------
QStringList
SettingsModel
::
getAudioDevices
()
const
{
QStringList
list
;
for
(
const
auto
&
device
:
CoreManager
::
getInstance
()
->
getCore
()
->
getSoundDevices
())
list
<<
::
Utils
::
linphoneStringToQString
(
device
);
return
list
;
}
// -----------------------------------------------------------------------------
QString
SettingsModel
::
getCaptureDevice
()
const
{
return
::
Utils
::
linphoneStringToQString
(
CoreManager
::
getInstance
()
->
getCore
()
->
getCaptureDevice
()
);
}
void
SettingsModel
::
setCaptureDevice
(
const
QString
&
device
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setCaptureDevice
(
::
Utils
::
qStringToLinphoneString
(
device
)
);
emit
captureDeviceChanged
(
device
);
}
// -----------------------------------------------------------------------------
QString
SettingsModel
::
getPlaybackDevice
()
const
{
return
::
Utils
::
linphoneStringToQString
(
CoreManager
::
getInstance
()
->
getCore
()
->
getPlaybackDevice
()
);
}
void
SettingsModel
::
setPlaybackDevice
(
const
QString
&
device
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setPlaybackDevice
(
::
Utils
::
qStringToLinphoneString
(
device
)
);
emit
playbackDeviceChanged
(
device
);
}
// -----------------------------------------------------------------------------
QString
SettingsModel
::
getRingerDevice
()
const
{
return
::
Utils
::
linphoneStringToQString
(
CoreManager
::
getInstance
()
->
getCore
()
->
getRingerDevice
()
);
}
void
SettingsModel
::
setRingerDevice
(
const
QString
&
device
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setRingerDevice
(
::
Utils
::
qStringToLinphoneString
(
device
)
);
emit
ringerDeviceChanged
(
device
);
}
// =============================================================================
// =============================================================================
// Chat & calls.
// Chat & calls.
// =============================================================================
// =============================================================================
...
...
linphone-desktop/src/components/settings/SettingsModel.hpp
View file @
773a8c76
...
@@ -35,6 +35,16 @@ class SettingsModel : public QObject {
...
@@ -35,6 +35,16 @@ class SettingsModel : public QObject {
// PROPERTIES.
// PROPERTIES.
// ===========================================================================
// ===========================================================================
// Audio. --------------------------------------------------------------------
Q_PROPERTY
(
QVariantList
audioCodecs
READ
getAudioCodecs
WRITE
setAudioCodecs
NOTIFY
audioCodecsChanged
);
Q_PROPERTY
(
QStringList
audioDevices
READ
getAudioDevices
CONSTANT
);
Q_PROPERTY
(
QString
captureDevice
READ
getCaptureDevice
WRITE
setCaptureDevice
NOTIFY
captureDeviceChanged
);
Q_PROPERTY
(
QString
playbackDevice
READ
getPlaybackDevice
WRITE
setPlaybackDevice
NOTIFY
playbackDeviceChanged
);
Q_PROPERTY
(
QString
ringerDevice
READ
getRingerDevice
WRITE
setRingerDevice
NOTIFY
ringerDeviceChanged
);
// Chat & calls. -------------------------------------------------------------
// Chat & calls. -------------------------------------------------------------
Q_PROPERTY
(
bool
autoAnswerStatus
READ
getAutoAnswerStatus
WRITE
setAutoAnswerStatus
NOTIFY
autoAnswerStatusChanged
);
Q_PROPERTY
(
bool
autoAnswerStatus
READ
getAutoAnswerStatus
WRITE
setAutoAnswerStatus
NOTIFY
autoAnswerStatusChanged
);
...
@@ -111,6 +121,22 @@ public:
...
@@ -111,6 +121,22 @@ public:
// METHODS.
// METHODS.
// ===========================================================================
// ===========================================================================
// Audio. --------------------------------------------------------------------
QVariantList
getAudioCodecs
()
const
;
void
setAudioCodecs
(
const
QVariantList
&
codecs
);
QStringList
getAudioDevices
()
const
;
QString
getCaptureDevice
()
const
;
void
setCaptureDevice
(
const
QString
&
device
);
QString
getPlaybackDevice
()
const
;
void
setPlaybackDevice
(
const
QString
&
device
);
QString
getRingerDevice
()
const
;
void
setRingerDevice
(
const
QString
&
device
);
// Chat & calls. -------------------------------------------------------------
// Chat & calls. -------------------------------------------------------------
bool
getAutoAnswerStatus
()
const
;
bool
getAutoAnswerStatus
()
const
;
...
@@ -201,6 +227,14 @@ public:
...
@@ -201,6 +227,14 @@ public:
// ===========================================================================
// ===========================================================================
signals:
signals:
// Audio. --------------------------------------------------------------------
void
audioCodecsChanged
(
const
QVariantList
&
codecs
);
void
captureDeviceChanged
(
const
QString
&
device
);
void
playbackDeviceChanged
(
const
QString
&
device
);
void
ringerDeviceChanged
(
const
QString
&
device
);
// Chat & calls. -------------------------------------------------------------
// Chat & calls. -------------------------------------------------------------
void
autoAnswerStatusChanged
(
bool
status
);
void
autoAnswerStatusChanged
(
bool
status
);
...
...
linphone-desktop/ui/views/App/Settings/SettingsAudio.qml
View file @
773a8c76
import
QtQuick
2.7
import
QtQuick
2.7
import
Common
1.0
import
Common
1.0
import
Linphone
1.0
import
Utils
1.0
// =============================================================================
// =============================================================================
TabContainer
{
TabContainer
{
Form
{
title
:
qsTr
(
'
audioTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
playbackDeviceLabel
'
)
ComboBox
{
model
:
SettingsModel
.
audioDevices
Component.onCompleted
:
currentIndex
=
Utils
.
findIndex
(
model
,
function
(
device
)
{
return
device
===
SettingsModel
.
playbackDevice
})
onActivated
:
SettingsModel
.
playbackDevice
=
model
[
index
]
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
captureDeviceLabel
'
)
ComboBox
{
model
:
SettingsModel
.
audioDevices
Component.onCompleted
:
currentIndex
=
Utils
.
findIndex
(
model
,
function
(
device
)
{
return
device
===
SettingsModel
.
captureDevice
})
onActivated
:
SettingsModel
.
captureDevice
=
model
[
index
]
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
ringerDeviceLabel
'
)
ComboBox
{
model
:
SettingsModel
.
audioDevices
Component.onCompleted
:
currentIndex
=
Utils
.
findIndex
(
model
,
function
(
device
)
{
return
device
===
SettingsModel
.
ringerDevice
})
onActivated
:
SettingsModel
.
ringerDevice
=
model
[
index
]
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment