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
a9dd52e4
Commit
a9dd52e4
authored
May 19, 2011
by
Mirsal Ennaime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbus: make the RemoveTrack method compliant with MPRIS2
parent
d4c5140c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
modules/control/dbus/dbus_tracklist.c
modules/control/dbus/dbus_tracklist.c
+24
-11
No files found.
modules/control/dbus/dbus_tracklist.c
View file @
a9dd52e4
/*****************************************************************************
* dbus-tracklist.c : dbus control module (mpris v1.0) - /TrackList object
*****************************************************************************
* Copyright © 2006-20
08
Rafaël Carré
* Copyright © 2007-201
0
Mirsal Ennaime
* Copyright © 2006-20
11
Rafaël Carré
* Copyright © 2007-201
1
Mirsal Ennaime
* Copyright © 2009-2010 The VideoLAN team
* $Id$
*
...
...
@@ -129,18 +129,20 @@ DBUS_METHOD( GetLength )
REPLY_SEND
;
}
DBUS_METHOD
(
Del
Track
)
DBUS_METHOD
(
Remove
Track
)
{
REPLY_INIT
;
DBusError
error
;
dbus_error_init
(
&
error
);
dbus_int32_t
i_position
;
int
i_id
=
-
1
,
i
;
char
*
psz_id
=
NULL
;
playlist_t
*
p_playlist
=
PL
;
input_item_t
*
p_input
=
NULL
;
dbus_message_get_args
(
p_from
,
&
error
,
DBUS_TYPE_
INT32
,
&
i_position
,
DBUS_TYPE_
OBJECT_PATH
,
&
psz_id
,
DBUS_TYPE_INVALID
);
if
(
dbus_error_is_set
(
&
error
)
)
...
...
@@ -151,15 +153,26 @@ DBUS_METHOD( DelTrack )
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
}
if
(
1
!=
sscanf
(
psz_id
,
MPRIS_TRACKID_FORMAT
,
&
i_id
)
)
{
msg_Err
(
(
vlc_object_t
*
)
p_this
,
"Invalid track id: %s"
,
psz_id
);
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
}
PL_LOCK
;
if
(
i_position
<
p_playlist
->
current
.
i_size
)
for
(
i
=
0
;
i
<
playlist_CurrentSize
(
p_playlist
);
i
++
)
{
playlist_DeleteFromInput
(
p_playlist
,
p_playlist
->
current
.
p_elems
[
i_position
]
->
p_input
,
pl_Locked
);
p_input
=
p_playlist
->
current
.
p_elems
[
i
]
->
p_input
;
if
(
i_id
==
p_input
->
i_id
)
{
playlist_DeleteFromInput
(
p_playlist
,
p_input
,
true
);
break
;
}
}
PL_UNLOCK
;
PL_UNLOCK
;
REPLY_SEND
;
}
...
...
@@ -254,7 +267,7 @@ handle_tracklist ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this )
METHOD_FUNC
(
DBUS_MPRIS_TRACKLIST_INTERFACE
,
"GetCurrentTrack"
,
GetCurrentTrack
);
METHOD_FUNC
(
DBUS_MPRIS_TRACKLIST_INTERFACE
,
"GetLength"
,
GetLength
);
METHOD_FUNC
(
DBUS_MPRIS_TRACKLIST_INTERFACE
,
"AddTrack"
,
AddTrack
);
METHOD_FUNC
(
DBUS_MPRIS_TRACKLIST_INTERFACE
,
"
DelTrack"
,
Del
Track
);
METHOD_FUNC
(
DBUS_MPRIS_TRACKLIST_INTERFACE
,
"
RemoveTrack"
,
Remove
Track
);
METHOD_FUNC
(
DBUS_MPRIS_TRACKLIST_INTERFACE
,
"SetLoop"
,
SetLoop
);
METHOD_FUNC
(
DBUS_MPRIS_TRACKLIST_INTERFACE
,
"SetRandom"
,
SetRandom
);
...
...
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