forked from len0rd/rockbox
plugin.h & lua add playlist_insert_playlist
having issues running lua and loading a playlist Change-Id: I72d32d77e6567ceed7e8e5fd492eebf0ee44561a
This commit is contained in:
parent
f02cd18ad0
commit
221e8752cc
4 changed files with 70 additions and 17 deletions
|
@ -320,11 +320,12 @@ RB_WRAP(playlist)
|
|||
enum e_playlist {PLAYL_AMOUNT = 0, PLAYL_ADD, PLAYL_CREATE,
|
||||
PLAYL_START, PLAYL_RESUMETRACK, PLAYL_RESUME,
|
||||
PLAYL_SHUFFLE, PLAYL_SYNC, PLAYL_REMOVEALLTRACKS,
|
||||
PLAYL_INSERTTRACK, PLAYL_INSERTDIRECTORY, PLAYL_ECOUNT};
|
||||
PLAYL_INSERTTRACK, PLAYL_INSERTDIRECTORY, PLAYL_INSERTPLAYL,
|
||||
PLAYL_ECOUNT};
|
||||
|
||||
const char *playlist_option[] = {"amount", "add", "create", "start", "resume_track",
|
||||
"resume", "shuffle", "sync", "remove_all_tracks",
|
||||
"insert_track", "insert_directory", NULL};
|
||||
"insert_track", "insert_directory", "insert_playlist", NULL};
|
||||
|
||||
const char *filename, *dir;
|
||||
int result = 0;
|
||||
|
@ -388,6 +389,12 @@ RB_WRAP(playlist)
|
|||
recurse = lua_toboolean(L, 5); /* default to false */
|
||||
result = rb->playlist_insert_directory(NULL, dir, pos, queue, recurse);
|
||||
break;
|
||||
case PLAYL_INSERTPLAYL:
|
||||
filename = luaL_checkstring(L, 2); /* only required parameter */
|
||||
pos = luaL_optint(L, 3, 0);
|
||||
queue = lua_toboolean(L, 4); /* default to false */
|
||||
result = rb->playlist_insert_playlist(NULL, filename, pos, queue);
|
||||
break;
|
||||
}
|
||||
|
||||
yield();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue