summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-11-11 23:20:19 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-11-12 15:59:09 +0000
commit388adff3cc4ab8584c2c99f9bc5ad7e309281d5e (patch)
tree8b05c374e6ace0ebf7c51641eff56e941de27df4 /apps
parent1a68856f52f1b6dc89863758404e54c744fcf53a (diff)
downloadrockbox-388adff3cc4ab8584c2c99f9bc5ad7e309281d5e.tar.gz
rockbox-388adff3cc4ab8584c2c99f9bc5ad7e309281d5e.zip
pcm: Further cleanup of unused bits of the PCM ACPI:
* pcm_get_bytes_remaining() * pcm_calculate_peaks() * pcm_get_peak_buffer() Nothing in-tree uses these at all (except for the lua plugin wrapper) Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c3
-rw-r--r--apps/plugin.h7
-rw-r--r--apps/plugins/lua/include_lua/pcm.lua2
-rw-r--r--apps/plugins/lua/rocklib.c15
4 files changed, 4 insertions, 23 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 584fbf1ab3..ee58c870e1 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -602,9 +602,6 @@ static const struct plugin_api rockbox_api = {
602 pcm_play_stop, 602 pcm_play_stop,
603 pcm_set_frequency, 603 pcm_set_frequency,
604 pcm_is_playing, 604 pcm_is_playing,
605 pcm_get_bytes_waiting,
606 pcm_calculate_peaks,
607 pcm_get_peak_buffer,
608 pcm_play_lock, 605 pcm_play_lock,
609 pcm_play_unlock, 606 pcm_play_unlock,
610 beep_play, 607 beep_play,
diff --git a/apps/plugin.h b/apps/plugin.h
index 226a084f35..98be645134 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -155,12 +155,12 @@ int plugin_open(char *plugin, char *parameter);
155#define PLUGIN_MAGIC 0x526F634B /* RocK */ 155#define PLUGIN_MAGIC 0x526F634B /* RocK */
156 156
157/* increase this every time the api struct changes */ 157/* increase this every time the api struct changes */
158#define PLUGIN_API_VERSION 243 158#define PLUGIN_API_VERSION 244
159 159
160/* update this to latest version if a change to the api struct breaks 160/* update this to latest version if a change to the api struct breaks
161 backwards compatibility (and please take the opportunity to sort in any 161 backwards compatibility (and please take the opportunity to sort in any
162 new function which are "waiting" at the end of the function table) */ 162 new function which are "waiting" at the end of the function table) */
163#define PLUGIN_MIN_API_VERSION 243 163#define PLUGIN_MIN_API_VERSION 244
164 164
165/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ 165/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */
166 166
@@ -677,9 +677,6 @@ struct plugin_api {
677 void (*pcm_play_stop)(void); 677 void (*pcm_play_stop)(void);
678 void (*pcm_set_frequency)(unsigned int frequency); 678 void (*pcm_set_frequency)(unsigned int frequency);
679 bool (*pcm_is_playing)(void); 679 bool (*pcm_is_playing)(void);
680 size_t (*pcm_get_bytes_waiting)(void);
681 void (*pcm_calculate_peaks)(int *left, int *right);
682 const void* (*pcm_get_peak_buffer)(int *count);
683 void (*pcm_play_lock)(void); 680 void (*pcm_play_lock)(void);
684 void (*pcm_play_unlock)(void); 681 void (*pcm_play_unlock)(void);
685 void (*beep_play)(unsigned int frequency, unsigned int duration, 682 void (*beep_play)(unsigned int frequency, unsigned int duration,
diff --git a/apps/plugins/lua/include_lua/pcm.lua b/apps/plugins/lua/include_lua/pcm.lua
index 46cc5b0720..299f7730e9 100644
--- a/apps/plugins/lua/include_lua/pcm.lua
+++ b/apps/plugins/lua/include_lua/pcm.lua
@@ -30,5 +30,3 @@ rb.pcm_play_stop = function() rb.pcm("play_stop") end
30rb.pcm_play_lock = function() rb.pcm("play_lock") end 30rb.pcm_play_lock = function() rb.pcm("play_lock") end
31rb.pcm_play_unlock = function() rb.pcm("play_unlock") end 31rb.pcm_play_unlock = function() rb.pcm("play_unlock") end
32rb.pcm_is_playing = function() return rb.pcm("is_playing") end 32rb.pcm_is_playing = function() return rb.pcm("is_playing") end
33rb.pcm_calculate_peaks = function() return rb.pcm("calculate_peaks") end
34rb.pcm_get_bytes_waiting = function() return rb.pcm("get_bytes_waiting") end
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 6219bb2e5a..81b6f4ce2a 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -521,14 +521,12 @@ RB_WRAP(pcm)
521{ 521{
522 enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING, 522 enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING,
523 PCM_PLAYSTOP, PCM_PLAYLOCK, PCM_PLAYUNLOCK, 523 PCM_PLAYSTOP, PCM_PLAYLOCK, PCM_PLAYUNLOCK,
524 PCM_CALCULATEPEAKS, PCM_SETFREQUENCY, PCM_GETBYTESWAITING, PCM_ECOUNT}; 524 PCM_SETFREQUENCY, PCM_ECOUNT};
525 525
526 const char *pcm_option[] = {"apply_settings", "is_playing", 526 const char *pcm_option[] = {"apply_settings", "is_playing",
527 "play_stop", "play_lock", "play_unlock", 527 "play_stop", "play_lock", "play_unlock",
528 "calculate_peaks", "set_frequency", "get_bytes_waiting", NULL}; 528 "set_frequency", NULL};
529 bool b_result; 529 bool b_result;
530 int left, right;
531 size_t byteswait;
532 530
533 lua_pushnil(L); /*push nil so options w/o return have something to return */ 531 lua_pushnil(L); /*push nil so options w/o return have something to return */
534 532
@@ -551,18 +549,9 @@ RB_WRAP(pcm)
551 case PCM_PLAYUNLOCK: 549 case PCM_PLAYUNLOCK:
552 rb->pcm_play_unlock(); 550 rb->pcm_play_unlock();
553 break; 551 break;
554 case PCM_CALCULATEPEAKS:
555 rb->pcm_calculate_peaks(&left, &right);
556 lua_pushinteger(L, left);
557 lua_pushinteger(L, right);
558 return 2;
559 case PCM_SETFREQUENCY: 552 case PCM_SETFREQUENCY:
560 rb->pcm_set_frequency((unsigned int) luaL_checkint(L, 2)); 553 rb->pcm_set_frequency((unsigned int) luaL_checkint(L, 2));
561 break; 554 break;
562 case PCM_GETBYTESWAITING:
563 byteswait = rb->pcm_get_bytes_waiting();
564 lua_pushinteger(L, byteswait);
565 break;
566 } 555 }
567 556
568 yield(); 557 yield();