summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/rocklib.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-12-05 23:06:22 -0500
committerWilliam Wilgus <wilgus.william@gmail.com>2021-12-05 23:10:19 -0500
commit221e8752cce3509660abe8848f731062ae2ceb81 (patch)
treebec9c6b9f23edee7a7eee99c3f860a1da25541c3 /apps/plugins/lua/rocklib.c
parentf02cd18ad027cdb4992a19a16cfbd336ffb63124 (diff)
downloadrockbox-221e8752cce3509660abe8848f731062ae2ceb81.tar.gz
rockbox-221e8752cce3509660abe8848f731062ae2ceb81.zip
plugin.h & lua add playlist_insert_playlist
having issues running lua and loading a playlist Change-Id: I72d32d77e6567ceed7e8e5fd492eebf0ee44561a
Diffstat (limited to 'apps/plugins/lua/rocklib.c')
-rw-r--r--apps/plugins/lua/rocklib.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 2672d446fc..6131a479db 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -320,11 +320,12 @@ RB_WRAP(playlist)
320 enum e_playlist {PLAYL_AMOUNT = 0, PLAYL_ADD, PLAYL_CREATE, 320 enum e_playlist {PLAYL_AMOUNT = 0, PLAYL_ADD, PLAYL_CREATE,
321 PLAYL_START, PLAYL_RESUMETRACK, PLAYL_RESUME, 321 PLAYL_START, PLAYL_RESUMETRACK, PLAYL_RESUME,
322 PLAYL_SHUFFLE, PLAYL_SYNC, PLAYL_REMOVEALLTRACKS, 322 PLAYL_SHUFFLE, PLAYL_SYNC, PLAYL_REMOVEALLTRACKS,
323 PLAYL_INSERTTRACK, PLAYL_INSERTDIRECTORY, PLAYL_ECOUNT}; 323 PLAYL_INSERTTRACK, PLAYL_INSERTDIRECTORY, PLAYL_INSERTPLAYL,
324 PLAYL_ECOUNT};
324 325
325 const char *playlist_option[] = {"amount", "add", "create", "start", "resume_track", 326 const char *playlist_option[] = {"amount", "add", "create", "start", "resume_track",
326 "resume", "shuffle", "sync", "remove_all_tracks", 327 "resume", "shuffle", "sync", "remove_all_tracks",
327 "insert_track", "insert_directory", NULL}; 328 "insert_track", "insert_directory", "insert_playlist", NULL};
328 329
329 const char *filename, *dir; 330 const char *filename, *dir;
330 int result = 0; 331 int result = 0;
@@ -388,6 +389,12 @@ RB_WRAP(playlist)
388 recurse = lua_toboolean(L, 5); /* default to false */ 389 recurse = lua_toboolean(L, 5); /* default to false */
389 result = rb->playlist_insert_directory(NULL, dir, pos, queue, recurse); 390 result = rb->playlist_insert_directory(NULL, dir, pos, queue, recurse);
390 break; 391 break;
392 case PLAYL_INSERTPLAYL:
393 filename = luaL_checkstring(L, 2); /* only required parameter */
394 pos = luaL_optint(L, 3, 0);
395 queue = lua_toboolean(L, 4); /* default to false */
396 result = rb->playlist_insert_playlist(NULL, filename, pos, queue);
397 break;
391 } 398 }
392 399
393 yield(); 400 yield();