Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
8d433f3d
Commit
8d433f3d
authored
Nov 28, 2006
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a method to export playlists
parent
c5543363
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
13 deletions
+69
-13
modules/control/dbus.c
modules/control/dbus.c
+65
-13
modules/control/dbus.h
modules/control/dbus.h
+4
-0
No files found.
modules/control/dbus.c
View file @
8d433f3d
...
...
@@ -98,6 +98,57 @@ DBUS_METHOD( Nothing )
REPLY_SEND
;
}
DBUS_METHOD
(
PlaylistExport_XSPF
)
{
/* export playlist to an xspf file */
/* reads the filename to export to */
/* returns the status as uint16:
* 0 : success
* 1 : error
* 2 : playlist empty
*/
REPLY_INIT
;
OUT_ARGUMENTS
;
DBusError
error
;
dbus_error_init
(
&
error
);
char
*
psz_file
;
dbus_uint16_t
i_ret
;
dbus_message_get_args
(
p_from
,
&
error
,
DBUS_TYPE_STRING
,
&
psz_file
,
DBUS_TYPE_INVALID
);
if
(
dbus_error_is_set
(
&
error
)
)
{
msg_Err
(
(
vlc_object_t
*
)
p_this
,
"D-Bus message reading : %s
\n
"
,
error
.
message
);
dbus_error_free
(
&
error
);
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
}
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
if
(
(
!
playlist_IsEmpty
(
p_playlist
)
)
&&
(
p_playlist
->
p_root_category
->
i_children
>
0
)
)
{
if
(
playlist_Export
(
p_playlist
,
psz_file
,
p_playlist
->
p_root_category
->
pp_children
[
0
],
"export-xspf"
)
==
VLC_SUCCESS
)
i_ret
=
0
;
else
i_ret
=
1
;
}
else
i_ret
=
2
;
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
ADD_UINT16
(
&
i_ret
);
REPLY_SEND
;
}
DBUS_METHOD
(
Quit
)
{
/* exits vlc */
REPLY_INIT
;
...
...
@@ -365,19 +416,20 @@ DBUS_METHOD( handle_messages )
/* here D-Bus method's names are associated to an handler */
METHOD_FUNC
(
"GetPlayStatus"
,
GetPlayStatus
);
METHOD_FUNC
(
"GetPlayingItem"
,
GetPlayingItem
);
METHOD_FUNC
(
"AddMRL"
,
AddMRL
);
METHOD_FUNC
(
"TogglePause"
,
TogglePause
);
METHOD_FUNC
(
"Nothing"
,
Nothing
);
METHOD_FUNC
(
"Prev"
,
Prev
);
METHOD_FUNC
(
"Next"
,
Next
);
METHOD_FUNC
(
"Quit"
,
Quit
);
METHOD_FUNC
(
"Stop"
,
Stop
);
METHOD_FUNC
(
"VolumeSet"
,
VolumeSet
);
METHOD_FUNC
(
"VolumeGet"
,
VolumeGet
);
METHOD_FUNC
(
"PositionSet"
,
PositionSet
);
METHOD_FUNC
(
"PositionGet"
,
PositionGet
);
METHOD_FUNC
(
"GetPlayStatus"
,
GetPlayStatus
);
METHOD_FUNC
(
"GetPlayingItem"
,
GetPlayingItem
);
METHOD_FUNC
(
"AddMRL"
,
AddMRL
);
METHOD_FUNC
(
"TogglePause"
,
TogglePause
);
METHOD_FUNC
(
"Nothing"
,
Nothing
);
METHOD_FUNC
(
"Prev"
,
Prev
);
METHOD_FUNC
(
"Next"
,
Next
);
METHOD_FUNC
(
"Quit"
,
Quit
);
METHOD_FUNC
(
"Stop"
,
Stop
);
METHOD_FUNC
(
"VolumeSet"
,
VolumeSet
);
METHOD_FUNC
(
"VolumeGet"
,
VolumeGet
);
METHOD_FUNC
(
"PositionSet"
,
PositionSet
);
METHOD_FUNC
(
"PositionGet"
,
PositionGet
);
METHOD_FUNC
(
"PlaylistExport_XSPF"
,
PlaylistExport_XSPF
);
return
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
;
}
...
...
modules/control/dbus.h
View file @
8d433f3d
...
...
@@ -124,6 +124,10 @@ const char* psz_introspection_xml_data =
" <method name=
\"
PositionGet
\"
>
\n
"
" <arg type=
\"
q
\"
direction=
\"
out
\"
/>
\n
"
" </method>
\n
"
" <method name=
\"
PlaylistExport_XSPF
\"
>
\n
"
" <arg type=
\"
s
\"
direction=
\"
in
\"
/>
\n
"
" <arg type=
\"
q
\"
direction=
\"
out
\"
/>
\n
"
" </method>
\n
"
" </interface>
\n
"
"</node>
\n
"
;
...
...
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