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
b0ea3f42
Commit
b0ea3f42
authored
Feb 09, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist_save: add start/end_index parameters
parent
0103219f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
command.c
src/command.c
+2
-1
playlist_save.c
src/playlist_save.c
+7
-2
playlist_save.h
src/playlist_save.h
+3
-1
No files found.
src/command.c
View file @
b0ea3f42
...
@@ -809,7 +809,8 @@ handle_load(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -809,7 +809,8 @@ handle_load(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
return
playlist_load_spl
(
&
g_playlist
,
client
->
player_control
,
return
playlist_load_spl
(
&
g_playlist
,
client
->
player_control
,
argv
[
1
],
&
error
)
argv
[
1
],
0
,
G_MAXUINT
,
&
error
)
?
COMMAND_RETURN_OK
?
COMMAND_RETURN_OK
:
print_error
(
client
,
error
);
:
print_error
(
client
,
error
);
}
}
...
...
src/playlist_save.c
View file @
b0ea3f42
...
@@ -112,7 +112,9 @@ spl_save_playlist(const char *name_utf8, const struct playlist *playlist)
...
@@ -112,7 +112,9 @@ spl_save_playlist(const char *name_utf8, const struct playlist *playlist)
bool
bool
playlist_load_spl
(
struct
playlist
*
playlist
,
struct
player_control
*
pc
,
playlist_load_spl
(
struct
playlist
*
playlist
,
struct
player_control
*
pc
,
const
char
*
name_utf8
,
GError
**
error_r
)
const
char
*
name_utf8
,
unsigned
start_index
,
unsigned
end_index
,
GError
**
error_r
)
{
{
GPtrArray
*
list
;
GPtrArray
*
list
;
...
@@ -120,7 +122,10 @@ playlist_load_spl(struct playlist *playlist, struct player_control *pc,
...
@@ -120,7 +122,10 @@ playlist_load_spl(struct playlist *playlist, struct player_control *pc,
if
(
list
==
NULL
)
if
(
list
==
NULL
)
return
false
;
return
false
;
for
(
unsigned
i
=
0
;
i
<
list
->
len
;
++
i
)
{
if
(
list
->
len
<
end_index
)
end_index
=
list
->
len
;
for
(
unsigned
i
=
start_index
;
i
<
end_index
;
++
i
)
{
const
char
*
temp
=
g_ptr_array_index
(
list
,
i
);
const
char
*
temp
=
g_ptr_array_index
(
list
,
i
);
if
((
playlist_append_uri
(
playlist
,
pc
,
temp
,
NULL
))
!=
PLAYLIST_RESULT_SUCCESS
)
{
if
((
playlist_append_uri
(
playlist
,
pc
,
temp
,
NULL
))
!=
PLAYLIST_RESULT_SUCCESS
)
{
/* for windows compatibility, convert slashes */
/* for windows compatibility, convert slashes */
...
...
src/playlist_save.h
View file @
b0ea3f42
...
@@ -54,6 +54,8 @@ spl_save_playlist(const char *name_utf8, const struct playlist *playlist);
...
@@ -54,6 +54,8 @@ spl_save_playlist(const char *name_utf8, const struct playlist *playlist);
*/
*/
bool
bool
playlist_load_spl
(
struct
playlist
*
playlist
,
struct
player_control
*
pc
,
playlist_load_spl
(
struct
playlist
*
playlist
,
struct
player_control
*
pc
,
const
char
*
name_utf8
,
GError
**
error_r
);
const
char
*
name_utf8
,
unsigned
start_index
,
unsigned
end_index
,
GError
**
error_r
);
#endif
#endif
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