Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
aab07f7f
Commit
aab07f7f
authored
Aug 25, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes mpris.py really a mpris controller
parent
29b25343
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
14 deletions
+32
-14
extras/mpris.glade
extras/mpris.glade
+3
-3
extras/mpris.py
extras/mpris.py
+29
-11
No files found.
extras/mpris.glade
View file @
aab07f7f
...
...
@@ -97,7 +97,7 @@
<property
name=
"width_request"
>
37
</property>
<property
name=
"height_request"
>
37
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"tooltip"
translatable=
"yes"
>
Quit
vlc
</property>
<property
name=
"tooltip"
translatable=
"yes"
>
Quit
Player
</property>
<property
name=
"relief"
>
GTK_RELIEF_NONE
</property>
<property
name=
"response_id"
>
0
</property>
<child>
...
...
@@ -283,12 +283,12 @@
<widget
class=
"GtkEventBox"
id=
"eventicon"
>
<property
name=
"visible"
>
True
</property>
<child>
<widget
class=
"GtkImage"
id=
"
vlc
icon"
>
<widget
class=
"GtkImage"
id=
"
audio
icon"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"events"
></property>
<property
name=
"tooltip"
translatable=
"yes"
>
Update meta info
</property>
<property
name=
"xpad"
>
8
</property>
<property
name=
"icon_name"
>
vl
c
</property>
<property
name=
"icon_name"
>
audio-x-generi
c
</property>
</widget>
</child>
</widget>
...
...
extras/mpris.py
View file @
aab07f7f
...
...
@@ -58,9 +58,27 @@ def itemchange_handler(item):
#connect to the bus
bus
=
dbus
.
SessionBus
()
player_o
=
bus
.
get_object
(
"org.mpris.vlc"
,
"/Player"
)
tracklist_o
=
bus
.
get_object
(
"org.mpris.vlc"
,
"/TrackList"
)
#find the first media player available
dbus_o
=
bus
.
get_object
(
"org.freedesktop.DBus"
,
"/"
)
dbus_intf
=
dbus
.
Interface
(
dbus_o
,
"org.freedesktop.DBus"
)
name_list
=
dbus_intf
.
ListNames
()
name
=
""
for
n
in
name_list
:
if
"org.mpris."
in
n
:
name
=
n
break
if
name
==
""
:
print
"No MPRIS enabled players on the bus !"
exit
()
root_o
=
bus
.
get_object
(
name
,
"/"
)
player_o
=
bus
.
get_object
(
name
,
"/Player"
)
tracklist_o
=
bus
.
get_object
(
name
,
"/TrackList"
)
root
=
dbus
.
Interface
(
root_o
,
"org.freedesktop.MediaPlayer"
)
tracklist
=
dbus
.
Interface
(
tracklist_o
,
"org.freedesktop.MediaPlayer"
)
player
=
dbus
.
Interface
(
player_o
,
"org.freedesktop.MediaPlayer"
)
try
:
...
...
@@ -109,7 +127,7 @@ def update(widget):
l_title
.
set_text
(
t
)
GetPlayStatus
(
0
)
#get playing status from remote
vlc
#get playing status from remote
player
def
GetPlayStatus
(
widget
):
global
playing
status
=
player
.
GetStatus
()
...
...
@@ -179,7 +197,7 @@ def tray_button(widget):
window
.
move
(
position
[
0
],
position
[
1
])
window
.
show
()
xml
=
gtk
.
glade
.
XML
(
'
dbus-vlc
.glade'
)
xml
=
gtk
.
glade
.
XML
(
'
mpris
.glade'
)
bt_close
=
xml
.
get_widget
(
'close'
)
bt_quit
=
xml
.
get_widget
(
'quit'
)
...
...
@@ -196,7 +214,7 @@ window = xml.get_widget('window1')
img_bt_toggle
=
xml
.
get_widget
(
'image6'
)
exp
=
xml
.
get_widget
(
'expander2'
)
expvbox
=
xml
.
get_widget
(
'expandvbox'
)
vlcicon
=
xml
.
get_widget
(
'eventicon'
)
audioicon
=
xml
.
get_widget
(
'eventicon'
)
vol
=
xml
.
get_widget
(
'vol'
)
time_s
=
xml
.
get_widget
(
'time_s'
)
time_l
=
xml
.
get_widget
(
'time_l'
)
...
...
@@ -205,7 +223,7 @@ window.connect('delete_event', delete_event)
window
.
connect
(
'destroy'
,
destroy
)
window
.
connect
(
'key_release_event'
,
key_release
)
tray
=
gtk
.
status_icon_new_from_icon_name
(
"
vl
c"
)
tray
=
gtk
.
status_icon_new_from_icon_name
(
"
audio-x-generi
c"
)
tray
.
connect
(
'activate'
,
tray_button
)
def
icon_clicked
(
widget
,
event
):
...
...
@@ -222,8 +240,8 @@ exp.connect('activate', expander)
vol
.
connect
(
'change-value'
,
volchange
)
vol
.
connect
(
'scroll-event'
,
volchange
)
time_s
.
connect
(
'adjust-bounds'
,
timechange
)
vlc
icon
.
set_events
(
gtk
.
gdk
.
BUTTON_PRESS_MASK
)
vlc
icon
.
connect
(
'button_press_event'
,
icon_clicked
)
audio
icon
.
set_events
(
gtk
.
gdk
.
BUTTON_PRESS_MASK
)
audio
icon
.
connect
(
'button_press_event'
,
icon_clicked
)
time_s
.
set_update_policy
(
gtk
.
UPDATE_DISCONTINUOUS
)
gobject
.
timeout_add
(
2000
,
timeset
)
...
...
@@ -235,8 +253,8 @@ try:
except
:
print
"edit this file to point to your media library"
window
.
set_icon_name
(
'
vl
c'
)
window
.
set_title
(
"VLC - D-Bus ctrl"
)
window
.
set_icon_name
(
'
audio-x-generi
c'
)
window
.
set_title
(
root
.
Identity
()
)
window
.
show
()
try
:
...
...
@@ -246,7 +264,7 @@ except:
icon_theme
=
gtk
.
icon_theme_get_default
()
try
:
pix
=
icon_theme
.
load_icon
(
"
vl
c"
,
24
,
0
)
pix
=
icon_theme
.
load_icon
(
"
audio-x-generi
c"
,
24
,
0
)
window
.
set_icon
(
pix
)
except
:
True
...
...
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