diff options
author | William Wilgus <me.theuser@yahoo.com> | 2018-10-31 09:23:00 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2018-10-31 09:23:00 -0400 |
commit | bbfe4778114c76e23e9c391225da2d6f74812735 (patch) | |
tree | 880218b3cc344e6345b192a5e9f514a93257db2a /apps | |
parent | 74fe5203d06aee3ad3498fa9164762cfa1efa3d5 (diff) | |
download | rockbox-bbfe4778114c76e23e9c391225da2d6f74812735.tar.gz rockbox-bbfe4778114c76e23e9c391225da2d6f74812735.zip |
Lua Add underscores in audio, pcm, playlist functions
Lessen confusion for end users looking for the underlying function names in
plugin.h
Change-Id: I6662dc7bd9f22d83af372b3d3c5af53d9a1eac9a
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/lua/include_lua/audio.lua | 6 | ||||
-rw-r--r-- | apps/plugins/lua/include_lua/pcm.lua | 20 | ||||
-rw-r--r-- | apps/plugins/lua/include_lua/playlist.lua | 8 | ||||
-rw-r--r-- | apps/plugins/lua/rocklib.c | 19 |
4 files changed, 25 insertions, 28 deletions
diff --git a/apps/plugins/lua/include_lua/audio.lua b/apps/plugins/lua/include_lua/audio.lua index 51e5fbe228..8f343c8486 100644 --- a/apps/plugins/lua/include_lua/audio.lua +++ b/apps/plugins/lua/include_lua/audio.lua | |||
@@ -31,6 +31,6 @@ rb.audio_pause = function() rb.audio("pause") end | |||
31 | rb.audio_resume = function() rb.audio("resume") end | 31 | rb.audio_resume = function() rb.audio("resume") end |
32 | rb.audio_next = function() rb.audio("next") end | 32 | rb.audio_next = function() rb.audio("next") end |
33 | rb.audio_prev = function() rb.audio("prev") end | 33 | rb.audio_prev = function() rb.audio("prev") end |
34 | rb.audio_ff_rewind = function (newtime) rb.audio("ffrewind", newtime) end | 34 | rb.audio_ff_rewind = function (newtime) rb.audio("ff_rewind", newtime) end |
35 | rb.audio_flush_and_reload_tracks = function() rb.audio("flushandreloadtracks") end | 35 | rb.audio_flush_and_reload_tracks = function() rb.audio("flush_and_reload_tracks") end |
36 | rb.audio_get_file_pos = function() return rb.audio("getfilepos") end | 36 | rb.audio_get_file_pos = function() return rb.audio("get_file_pos") end |
diff --git a/apps/plugins/lua/include_lua/pcm.lua b/apps/plugins/lua/include_lua/pcm.lua index 318669bd67..6b2b6db204 100644 --- a/apps/plugins/lua/include_lua/pcm.lua +++ b/apps/plugins/lua/include_lua/pcm.lua | |||
@@ -24,13 +24,13 @@ | |||
24 | -- [[ conversion to old style pcm_ functions ]] | 24 | -- [[ conversion to old style pcm_ functions ]] |
25 | if not rb.pcm then rb.splash(rb.HZ, "No Support!") return nil end | 25 | if not rb.pcm then rb.splash(rb.HZ, "No Support!") return nil end |
26 | 26 | ||
27 | rb.pcm_apply_settings = function() rb.pcm("applysettings") end | 27 | rb.pcm_apply_settings = function() rb.pcm("apply_settings") end |
28 | rb.pcm_set_frequency = function(freq) rb.pcm("setfrequency", freq) end | 28 | rb.pcm_set_frequency = function(freq) rb.pcm("set_frequency", freq) end |
29 | rb.pcm_play_pause = function(bplay) rb.pcm("playpause", bplay) end | 29 | rb.pcm_play_pause = function(bplay) rb.pcm("play_pause", bplay) end |
30 | rb.pcm_play_stop = function() rb.pcm("playstop") end | 30 | rb.pcm_play_stop = function() rb.pcm("play_stop") end |
31 | rb.pcm_play_lock = function() rb.pcm("playlock") end | 31 | rb.pcm_play_lock = function() rb.pcm("play_lock") end |
32 | rb.pcm_play_unlock = function() rb.pcm("playunlock") end | 32 | rb.pcm_play_unlock = function() rb.pcm("play_unlock") end |
33 | rb.pcm_is_playing = function() return rb.pcm("isplaying") end | 33 | rb.pcm_is_playing = function() return rb.pcm("is_playing") end |
34 | rb.pcm_is_paused = function() return rb.pcm("ispaused") end | 34 | rb.pcm_is_paused = function() return rb.pcm("is_paused") end |
35 | rb.pcm_calculate_peaks = function() return rb.pcm("calculatepeaks") end | 35 | rb.pcm_calculate_peaks = function() return rb.pcm("calculate_peaks") end |
36 | rb.pcm_get_bytes_waiting = function() return rb.pcm("getbyteswaiting") end | 36 | rb.pcm_get_bytes_waiting = function() return rb.pcm("get_bytes_waiting") end |
diff --git a/apps/plugins/lua/include_lua/playlist.lua b/apps/plugins/lua/include_lua/playlist.lua index 3952334d9b..e11b30fe7d 100644 --- a/apps/plugins/lua/include_lua/playlist.lua +++ b/apps/plugins/lua/include_lua/playlist.lua | |||
@@ -37,19 +37,19 @@ rb.playlist_start = function(index, elapsed, offset) | |||
37 | rb.playlist("start", index, elapsed, offset) | 37 | rb.playlist("start", index, elapsed, offset) |
38 | end | 38 | end |
39 | rb.playlist_resume_track = function(index, crc, elapsed, offset) | 39 | rb.playlist_resume_track = function(index, crc, elapsed, offset) |
40 | rb.playlist("resumetrack", index, crc, elapsed, offset) | 40 | rb.playlist("resume_track", index, crc, elapsed, offset) |
41 | end | 41 | end |
42 | rb.playlist_resume = function() return rb.playlist("resume") end | 42 | rb.playlist_resume = function() return rb.playlist("resume") end |
43 | rb.playlist_shuffle = function(random_seed, index) | 43 | rb.playlist_shuffle = function(random_seed, index) |
44 | rb.playlist("shuffle", random_seed, index) | 44 | rb.playlist("shuffle", random_seed, index) |
45 | end | 45 | end |
46 | rb.playlist_sync = function () rb.playlist("sync") end | 46 | rb.playlist_sync = function () rb.playlist("sync") end |
47 | rb.playlist_remove_all_tracks = function() return rb.playlist("removealltracks") end | 47 | rb.playlist_remove_all_tracks = function() return rb.playlist("remove_all_tracks") end |
48 | rb.playlist_insert_track = function(filename, pos, bqueue, bsync) | 48 | rb.playlist_insert_track = function(filename, pos, bqueue, bsync) |
49 | return rb.playlist("inserttrack", filename, pos, bqueue, bsync) | 49 | return rb.playlist("insert_track", filename, pos, bqueue, bsync) |
50 | end | 50 | end |
51 | rb.playlist_insert_directory = function(dir, pos, bqueue, brecurse) | 51 | rb.playlist_insert_directory = function(dir, pos, bqueue, brecurse) |
52 | return rb.playlist("insertdirectory", dir, pos, bqueue, brecurse) | 52 | return rb.playlist("insert_directory", dir, pos, bqueue, brecurse) |
53 | end | 53 | end |
54 | rb.playlist_tracks = function(dir, filename) | 54 | rb.playlist_tracks = function(dir, filename) |
55 | local tracks = {} | 55 | local tracks = {} |
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index ed76122118..54c2bc0c03 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c | |||
@@ -197,9 +197,9 @@ RB_WRAP(playlist) | |||
197 | PLAYL_SHUFFLE, PLAYL_SYNC, PLAYL_REMOVEALLTRACKS, | 197 | PLAYL_SHUFFLE, PLAYL_SYNC, PLAYL_REMOVEALLTRACKS, |
198 | PLAYL_INSERTTRACK, PLAYL_INSERTDIRECTORY, PLAYL_ECOUNT}; | 198 | PLAYL_INSERTTRACK, PLAYL_INSERTDIRECTORY, PLAYL_ECOUNT}; |
199 | 199 | ||
200 | const char *playlist_option[] = {"amount", "add", "create", "start", "resumetrack", | 200 | const char *playlist_option[] = {"amount", "add", "create", "start", "resume_track", |
201 | "resume", "shuffle", "sync", "removealltracks", | 201 | "resume", "shuffle", "sync", "remove_all_tracks", |
202 | "inserttrack", "insertdirectory", NULL}; | 202 | "insert_track", "insert_directory", NULL}; |
203 | 203 | ||
204 | const char *filename, *dir; | 204 | const char *filename, *dir; |
205 | int result = 0; | 205 | int result = 0; |
@@ -210,7 +210,6 @@ RB_WRAP(playlist) | |||
210 | int option = luaL_checkoption (L, 1, NULL, playlist_option); | 210 | int option = luaL_checkoption (L, 1, NULL, playlist_option); |
211 | switch(option) | 211 | switch(option) |
212 | { | 212 | { |
213 | default: | ||
214 | case PLAYL_AMOUNT: | 213 | case PLAYL_AMOUNT: |
215 | result = rb->playlist_amount(); | 214 | result = rb->playlist_amount(); |
216 | break; | 215 | break; |
@@ -277,15 +276,14 @@ RB_WRAP(audio) | |||
277 | AUDIO_RESUME, AUDIO_NEXT, AUDIO_PREV, AUDIO_FFREWIND, | 276 | AUDIO_RESUME, AUDIO_NEXT, AUDIO_PREV, AUDIO_FFREWIND, |
278 | AUDIO_FLUSHANDRELOADTRACKS, AUDIO_GETPOS, AUDIO_ECOUNT}; | 277 | AUDIO_FLUSHANDRELOADTRACKS, AUDIO_GETPOS, AUDIO_ECOUNT}; |
279 | const char *audio_option[] = {"status", "play", "stop", "pause", | 278 | const char *audio_option[] = {"status", "play", "stop", "pause", |
280 | "resume", "next", "prev", "ffrewind", | 279 | "resume", "next", "prev", "ff_rewind", |
281 | "flushandreloadtracks", "getfilepos", NULL}; | 280 | "flush_and_reload_tracks", "get_file_pos", NULL}; |
282 | long elapsed, offset, newtime; | 281 | long elapsed, offset, newtime; |
283 | int status = rb->audio_status(); | 282 | int status = rb->audio_status(); |
284 | 283 | ||
285 | int option = luaL_checkoption (L, 1, NULL, audio_option); | 284 | int option = luaL_checkoption (L, 1, NULL, audio_option); |
286 | switch(option) | 285 | switch(option) |
287 | { | 286 | { |
288 | default: | ||
289 | case AUDIO_STATUS: | 287 | case AUDIO_STATUS: |
290 | break; | 288 | break; |
291 | case AUDIO_PLAY: | 289 | case AUDIO_PLAY: |
@@ -341,9 +339,9 @@ RB_WRAP(pcm) | |||
341 | PCM_PLAYSTOP, PCM_PLAYPAUSE, PCM_PLAYLOCK, PCM_PLAYUNLOCK, | 339 | PCM_PLAYSTOP, PCM_PLAYPAUSE, PCM_PLAYLOCK, PCM_PLAYUNLOCK, |
342 | PCM_CALCULATEPEAKS, PCM_SETFREQUENCY, PCM_GETBYTESWAITING, PCM_ECOUNT}; | 340 | PCM_CALCULATEPEAKS, PCM_SETFREQUENCY, PCM_GETBYTESWAITING, PCM_ECOUNT}; |
343 | 341 | ||
344 | const char *pcm_option[] = {"applysettings", "isplaying", "ispaused", | 342 | const char *pcm_option[] = {"apply_settings", "is_playing", "is_paused", |
345 | "playstop", "playpause", "playlock", "playunlock", | 343 | "play_stop", "play_pause", "play_lock", "play_unlock", |
346 | "calculatepeaks", "setfrequency", "getbyteswaiting", NULL}; | 344 | "calculate_peaks", "set_frequency", "get_bytes_waiting", NULL}; |
347 | bool b_result; | 345 | bool b_result; |
348 | int left, right; | 346 | int left, right; |
349 | size_t byteswait; | 347 | size_t byteswait; |
@@ -353,7 +351,6 @@ RB_WRAP(pcm) | |||
353 | int option = luaL_checkoption (L, 1, NULL, pcm_option); | 351 | int option = luaL_checkoption (L, 1, NULL, pcm_option); |
354 | switch(option) | 352 | switch(option) |
355 | { | 353 | { |
356 | default: | ||
357 | case PCM_APPLYSETTINGS: | 354 | case PCM_APPLYSETTINGS: |
358 | rb->pcm_apply_settings(); | 355 | rb->pcm_apply_settings(); |
359 | break; | 356 | break; |