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
34315944
Commit
34315944
authored
Sep 15, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes vlc the 2nd Media Player in history to implement the MPRIS draft (after audacious)
parent
979f5cc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
extras/mpris.py
extras/mpris.py
+11
-0
modules/control/dbus.c
modules/control/dbus.c
+6
-6
No files found.
extras/mpris.py
View file @
34315944
...
@@ -85,6 +85,16 @@ def TrackChange(Track):
...
@@ -85,6 +85,16 @@ def TrackChange(Track):
t
=
Track
[
"title"
]
t
=
Track
[
"title"
]
except
:
except
:
t
=
Track
[
"URI"
]
t
=
Track
[
"URI"
]
try
:
length
=
Track
[
"length"
]
except
:
length
=
0
if
length
>
0
:
time_s
.
set_range
(
0
,
Track
[
"length"
])
time_s
.
set_sensitive
(
True
)
else
:
# disable the position scale if length isn't available
time_s
.
set_sensitive
(
False
)
# update the labels
# update the labels
l_artist
.
set_text
(
a
)
l_artist
.
set_text
(
a
)
l_title
.
set_text
(
t
)
l_title
.
set_text
(
t
)
...
@@ -110,6 +120,7 @@ def Connect(name):
...
@@ -110,6 +120,7 @@ def Connect(name):
# determine if the Media Player is playing something
# determine if the Media Player is playing something
if
player
.
GetStatus
()
==
0
:
if
player
.
GetStatus
()
==
0
:
playing
=
True
playing
=
True
TrackChange
(
player
.
GetMetadata
())
# gets its identity (name and version)
# gets its identity (name and version)
identity
=
root
.
Identity
()
identity
=
root
.
Identity
()
...
...
modules/control/dbus.c
View file @
34315944
...
@@ -97,7 +97,7 @@ DBUS_METHOD( Quit )
...
@@ -97,7 +97,7 @@ DBUS_METHOD( Quit )
}
}
DBUS_METHOD
(
PositionGet
)
DBUS_METHOD
(
PositionGet
)
{
/* returns position
as an int in the range [0;1000]
*/
{
/* returns position
in milliseconds
*/
REPLY_INIT
;
REPLY_INIT
;
OUT_ARGUMENTS
;
OUT_ARGUMENTS
;
vlc_value_t
position
;
vlc_value_t
position
;
...
@@ -110,8 +110,8 @@ DBUS_METHOD( PositionGet )
...
@@ -110,8 +110,8 @@ DBUS_METHOD( PositionGet )
i_pos
=
0
;
i_pos
=
0
;
else
else
{
{
var_Get
(
p_input
,
"
position
"
,
&
position
);
var_Get
(
p_input
,
"
time
"
,
&
position
);
i_pos
=
position
.
f_float
*
1000
;
i_pos
=
position
.
i_time
/
1000
;
}
}
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
ADD_INT32
(
&
i_pos
);
ADD_INT32
(
&
i_pos
);
...
@@ -119,7 +119,7 @@ DBUS_METHOD( PositionGet )
...
@@ -119,7 +119,7 @@ DBUS_METHOD( PositionGet )
}
}
DBUS_METHOD
(
PositionSet
)
DBUS_METHOD
(
PositionSet
)
{
/* set position
from an int in the range [0;1000]
*/
{
/* set position
in milliseconds
*/
REPLY_INIT
;
REPLY_INIT
;
vlc_value_t
position
;
vlc_value_t
position
;
...
@@ -145,8 +145,8 @@ DBUS_METHOD( PositionSet )
...
@@ -145,8 +145,8 @@ DBUS_METHOD( PositionSet )
if
(
p_input
)
if
(
p_input
)
{
{
position
.
f_float
=
((
float
)
i_pos
)
/
1000
;
position
.
i_time
=
i_pos
*
1000
;
var_Set
(
p_input
,
"
position
"
,
position
);
var_Set
(
p_input
,
"
time
"
,
position
);
}
}
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
REPLY_SEND
;
REPLY_SEND
;
...
...
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