Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
41bb970e
Commit
41bb970e
authored
Sep 14, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpris: make sure only one gobject timer is running
parent
b81ff26d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
extras/mpris.py
extras/mpris.py
+6
-5
No files found.
extras/mpris.py
View file @
41bb970e
...
...
@@ -58,7 +58,6 @@ def player_change(newname, a, b):
Connect
(
newname
)
def
itemchange_handler
(
item
):
gobject
.
timeout_add
(
2000
,
timeset
)
try
:
a
=
item
[
"artist"
]
except
:
...
...
@@ -89,7 +88,6 @@ def Connect(name):
player
=
dbus
.
Interface
(
player_o
,
"org.freedesktop.MediaPlayer"
)
player_o
.
connect_to_signal
(
"TrackChange"
,
itemchange_handler
,
dbus_interface
=
"org.freedesktop.MediaPlayer"
)
if
player
.
GetStatus
()
==
0
:
gobject
.
timeout_add
(
2000
,
timeset
)
playing
=
True
window
.
set_title
(
root
.
Identity
())
...
...
@@ -157,7 +155,6 @@ def Pause(widget):
status
=
player
.
GetStatus
()
if
status
==
0
:
img_bt_toggle
.
set_from_stock
(
gtk
.
STOCK_MEDIA_PAUSE
,
gtk
.
ICON_SIZE_SMALL_TOOLBAR
)
gobject
.
timeout_add
(
2000
,
timeset
)
else
:
img_bt_toggle
.
set_from_stock
(
gtk
.
STOCK_MEDIA_PLAY
,
gtk
.
ICON_SIZE_SMALL_TOOLBAR
)
update
(
0
)
...
...
@@ -188,8 +185,9 @@ def timechange(widget, x=None, y=None):
#refresh position
def
timeset
():
global
playing
if
playing
==
True
:
time_s
.
set_value
(
player
.
PositionGet
())
return
playing
return
True
#simple/full display
def
expander
(
widget
):
...
...
@@ -306,6 +304,9 @@ if name != "":
window
.
set_title
(
root
.
Identity
())
vol
.
set_value
(
player
.
VolumeGet
())
#runs timer to update position
gobject
.
timeout_add
(
1000
,
timeset
)
window
.
set_icon_name
(
'audio-x-generic'
)
window
.
show
()
...
...
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