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
02ca3cb1
Commit
02ca3cb1
authored
May 03, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsAudio): unload ring player when window is not visible
parent
933b441a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
13 deletions
+28
-13
SoundPlayer.cpp
linphone-desktop/src/components/sound-player/SoundPlayer.cpp
+5
-0
SoundPlayer.hpp
linphone-desktop/src/components/sound-player/SoundPlayer.hpp
+1
-1
SettingsAudio.qml
linphone-desktop/ui/views/App/Settings/SettingsAudio.qml
+22
-12
No files found.
linphone-desktop/src/components/sound-player/SoundPlayer.cpp
View file @
02ca3cb1
...
...
@@ -68,6 +68,11 @@ SoundPlayer::SoundPlayer (QObject *parent) : QObject(parent) {
mInternalPlayer
->
setListener
(
mHandlers
);
}
SoundPlayer
::~
SoundPlayer
()
{
mForceCloseTimer
->
stop
();
mInternalPlayer
->
close
();
}
// -----------------------------------------------------------------------------
void
SoundPlayer
::
pause
()
{
...
...
linphone-desktop/src/components/sound-player/SoundPlayer.hpp
View file @
02ca3cb1
...
...
@@ -56,7 +56,7 @@ public:
Q_ENUM
(
PlaybackState
);
SoundPlayer
(
QObject
*
parent
=
Q_NULLPTR
);
~
SoundPlayer
()
=
default
;
~
SoundPlayer
();
Q_INVOKABLE
void
pause
();
Q_INVOKABLE
void
play
();
...
...
linphone-desktop/ui/views/App/Settings/SettingsAudio.qml
View file @
02ca3cb1
...
...
@@ -74,7 +74,11 @@ TabContainer {
selectedFile
:
SettingsModel
.
ringPath
onAccepted
:
{
ringPlayer
.
stop
()
var
item
=
ringPlayer
.
item
if
(
item
)
{
item
.
stop
()
}
SettingsModel
.
ringPath
=
selectedFile
}
...
...
@@ -84,27 +88,33 @@ TabContainer {
leftMargin
:
SettingsAudioStyle
.
ringPlayer
.
leftMargin
}
enabled
:
ringPlayer
.
playbackState
===
SoundPlayer
.
PlayingState
enabled
:
{
var
item
=
ringPlayer
.
item
return
item
&&
item
.
playbackState
===
SoundPlayer
.
PlayingState
}
icon
:
'
pause
'
onClicked
:
{
var
item
=
ringPlayer
.
item
if
(
!
item
)
{
return
}
if
(
enabled
)
{
ringPlayer
.
stop
()
item
.
stop
()
}
else
{
ringPlayer
.
play
()
item
.
play
()
}
}
SoundPlay
er
{
Load
er
{
id
:
ringPlayer
source
:
SettingsModel
.
ringPath
}
Connections
{
target
:
window
onClosing
:
ringPlayer
.
stop
()
active
:
window
.
visible
sourceComponent
:
SoundPlayer
{
source
:
SettingsModel
.
ringPath
}
}
}
}
...
...
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