Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
b9673fc5
Commit
b9673fc5
authored
Feb 09, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command: add optional range parameter to "load"
parent
b0ea3f42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
NEWS
NEWS
+1
-0
protocol.xml
doc/protocol.xml
+3
-1
command.c
src/command.c
+13
-4
No files found.
NEWS
View file @
b9673fc5
...
...
@@ -3,6 +3,7 @@ ver 0.17 (2011/??/??)
- support client-to-client communication
- "update" and "rescan" need only "CONTROL" permission
- new command "seekcur" for simpler seeking within current song
- add range parameter to command "load"
* input:
- cdio_paranoia: new input plugin to play audio CDs
- curl: enable CURLOPT_NETRC
...
...
doc/protocol.xml
View file @
b9673fc5
...
...
@@ -1312,12 +1312,14 @@ OK
<cmdsynopsis>
<command>
load
</command>
<arg
choice=
"req"
><replaceable>
NAME
</replaceable></arg>
<arg
choice=
"opt"
><replaceable>
START:END
</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Loads the playlist into the current queue. Playlist
plugins are supported.
plugins are supported. A range may be specified to load
only a part of the playlist.
</para>
</listitem>
</varlistentry>
...
...
src/command.c
View file @
b9673fc5
...
...
@@ -796,12 +796,21 @@ handle_save(struct client *client,
}
static
enum
command_return
handle_load
(
struct
client
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_load
(
struct
client
*
client
,
int
argc
,
char
*
argv
[])
{
unsigned
start_index
,
end_index
;
if
(
argc
<
3
)
{
start_index
=
0
;
end_index
=
G_MAXUINT
;
}
else
if
(
!
check_range
(
client
,
&
start_index
,
&
end_index
,
argv
[
2
],
need_range
))
return
COMMAND_RETURN_ERROR
;
enum
playlist_result
result
;
result
=
playlist_open_into_queue
(
argv
[
1
],
0
,
G_MAXUINT
,
start_index
,
end_index
,
&
g_playlist
,
client
->
player_control
,
true
);
if
(
result
!=
PLAYLIST_RESULT_NO_SUCH_LIST
)
...
...
@@ -809,7 +818,7 @@ handle_load(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
GError
*
error
=
NULL
;
return
playlist_load_spl
(
&
g_playlist
,
client
->
player_control
,
argv
[
1
],
0
,
G_MAXUINT
,
argv
[
1
],
start_index
,
end_index
,
&
error
)
?
COMMAND_RETURN_OK
:
print_error
(
client
,
error
);
...
...
@@ -2140,7 +2149,7 @@ static const struct command commands[] = {
{
"listplaylist"
,
PERMISSION_READ
,
1
,
1
,
handle_listplaylist
},
{
"listplaylistinfo"
,
PERMISSION_READ
,
1
,
1
,
handle_listplaylistinfo
},
{
"listplaylists"
,
PERMISSION_READ
,
0
,
0
,
handle_listplaylists
},
{
"load"
,
PERMISSION_ADD
,
1
,
1
,
handle_load
},
{
"load"
,
PERMISSION_ADD
,
1
,
2
,
handle_load
},
{
"lsinfo"
,
PERMISSION_READ
,
0
,
1
,
handle_lsinfo
},
{
"mixrampdb"
,
PERMISSION_CONTROL
,
1
,
1
,
handle_mixrampdb
},
{
"mixrampdelay"
,
PERMISSION_CONTROL
,
1
,
1
,
handle_mixrampdelay
},
...
...
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