diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2023-03-29 09:24:29 +0100 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2023-07-02 12:14:33 -0400 |
commit | 9ba51e355287f234260977e8cd978773e2528cae (patch) | |
tree | 324d3e172f9958bd239621105b7be6cbdd7c57a3 /apps/filetree.c | |
parent | 129fb4016bb081d9fc204fb66aa56cd4955e868e (diff) | |
download | rockbox-9ba51e355287f234260977e8cd978773e2528cae.tar.gz rockbox-9ba51e355287f234260977e8cd978773e2528cae.zip |
playlist: Remove playlist_add()
It was only used in filetree.c. It's still implemented in Lua so
scripts using rb.playlist_add() won't break, but has been removed
from the Lua API "backend".
Change-Id: I5625a47f0692456008c6b10dee14755151d22f29
Diffstat (limited to 'apps/filetree.c')
-rw-r--r-- | apps/filetree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/filetree.c b/apps/filetree.c index b652b6515b..7e6ba4eb8d 100644 --- a/apps/filetree.c +++ b/apps/filetree.c | |||
@@ -74,6 +74,7 @@ int ft_build_playlist(struct tree_context* c, int start_index) | |||
74 | int i; | 74 | int i; |
75 | int res = 0; | 75 | int res = 0; |
76 | int start=start_index; | 76 | int start=start_index; |
77 | struct playlist_info *playlist = playlist_get_current(); | ||
77 | 78 | ||
78 | tree_lock_cache(c); | 79 | tree_lock_cache(c); |
79 | struct entry *entries = tree_get_entries(c); | 80 | struct entry *entries = tree_get_entries(c); |
@@ -82,7 +83,8 @@ int ft_build_playlist(struct tree_context* c, int start_index) | |||
82 | { | 83 | { |
83 | if((entries[i].attr & FILE_ATTR_MASK) == FILE_ATTR_AUDIO) | 84 | if((entries[i].attr & FILE_ATTR_MASK) == FILE_ATTR_AUDIO) |
84 | { | 85 | { |
85 | res = playlist_add(entries[i].name); | 86 | res = playlist_insert_track(playlist, entries[i].name, |
87 | PLAYLIST_INSERT_LAST, false, false); | ||
86 | if (res < 0) | 88 | if (res < 0) |
87 | break; | 89 | break; |
88 | } | 90 | } |
@@ -127,10 +129,9 @@ bool ft_play_playlist(char* pathname, char* dirname, | |||
127 | if (playlist_create(dirname, filename) != -1) | 129 | if (playlist_create(dirname, filename) != -1) |
128 | { | 130 | { |
129 | if (global_settings.playlist_shuffle) | 131 | if (global_settings.playlist_shuffle) |
130 | { | ||
131 | playlist_shuffle(current_tick, -1); | 132 | playlist_shuffle(current_tick, -1); |
132 | } | ||
133 | 133 | ||
134 | playlist_set_modified(NULL, false); | ||
134 | playlist_start(0, 0, 0); | 135 | playlist_start(0, 0, 0); |
135 | return true; | 136 | return true; |
136 | } | 137 | } |
@@ -528,6 +529,7 @@ int ft_enter(struct tree_context* c) | |||
528 | start_index = 0; | 529 | start_index = 0; |
529 | } | 530 | } |
530 | 531 | ||
532 | playlist_set_modified(NULL, false); | ||
531 | playlist_start(start_index, 0, 0); | 533 | playlist_start(start_index, 0, 0); |
532 | play = true; | 534 | play = true; |
533 | } | 535 | } |