This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#12469 - add a few playlist wrappers for Lua
Attached to Project:
Rockbox
Opened by Albert Bloomfield (abloomfield) - Tuesday, 20 December 2011, 15:43 GMT+2
Last edited by Maurus Cuelenaere (mcuelenaere) - Friday, 17 February 2012, 12:07 GMT+2
Opened by Albert Bloomfield (abloomfield) - Tuesday, 20 December 2011, 15:43 GMT+2
Last edited by Maurus Cuelenaere (mcuelenaere) - Friday, 17 February 2012, 12:07 GMT+2
|
Detailsadds wrappers for playlist_sync, playlist_remove_all_tracks, and playlist_insert_track, playlist_insert_directory
also constants for: PLAYLIST_PREPEND, PLAYLIST_INSERT, PLAYLIST_INSERT_LAST, PLAYLIST_INSERT_FIRST, PLAYLIST_INSERT_SHUFFLED, PLAYLIST_REPLACE, and PLAYLIST_INSERT_LAST_SHUFFLED I made all the functions take the same parameters, but right now it just ignores any struct playlist_info* parameter and just passes NULL to work with the current playlist. |
This task depends upon
Closed by Maurus Cuelenaere (mcuelenaere)
Friday, 17 February 2012, 12:07 GMT+2
Reason for closing: Fixed
Additional comments about closing: Merged.
Friday, 17 February 2012, 12:07 GMT+2
Reason for closing: Fixed
Additional comments about closing: Merged.
Also, I'm not sure the luaL_optint() will work as it's not the last parameter/it's followed by non-optional parameters.
Besides these, the patch looks OK.
Regarding the luaL_optint(), my idea was that passing in nil would be the same as passing in PLAYLIST_INSERT. But I guess that doesn't really make sense and I didn't do that on playlist_insert_directory(). So I guess I should just change those to luaL_checknumber() then?
Currently, Lua is underdocumented in Rockbox (most of the plugin API is too).
Having all the boolean parameters as optional sounds good. Later on, if people are interested, one could port struct playlist_info over to Lua.