1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Solomon Peachy 2020-11-11 23:20:19 -05:00
parent 1a68856f52
commit 388adff3cc
29 changed files with 5 additions and 231 deletions

View file

@ -602,9 +602,6 @@ static const struct plugin_api rockbox_api = {
pcm_play_stop,
pcm_set_frequency,
pcm_is_playing,
pcm_get_bytes_waiting,
pcm_calculate_peaks,
pcm_get_peak_buffer,
pcm_play_lock,
pcm_play_unlock,
beep_play,

View file

@ -155,12 +155,12 @@ int plugin_open(char *plugin, char *parameter);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
#define PLUGIN_API_VERSION 243
#define PLUGIN_API_VERSION 244
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */
#define PLUGIN_MIN_API_VERSION 243
#define PLUGIN_MIN_API_VERSION 244
/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */
@ -677,9 +677,6 @@ struct plugin_api {
void (*pcm_play_stop)(void);
void (*pcm_set_frequency)(unsigned int frequency);
bool (*pcm_is_playing)(void);
size_t (*pcm_get_bytes_waiting)(void);
void (*pcm_calculate_peaks)(int *left, int *right);
const void* (*pcm_get_peak_buffer)(int *count);
void (*pcm_play_lock)(void);
void (*pcm_play_unlock)(void);
void (*beep_play)(unsigned int frequency, unsigned int duration,

View file

@ -30,5 +30,3 @@ rb.pcm_play_stop = function() rb.pcm("play_stop") end
rb.pcm_play_lock = function() rb.pcm("play_lock") end
rb.pcm_play_unlock = function() rb.pcm("play_unlock") end
rb.pcm_is_playing = function() return rb.pcm("is_playing") end
rb.pcm_calculate_peaks = function() return rb.pcm("calculate_peaks") end
rb.pcm_get_bytes_waiting = function() return rb.pcm("get_bytes_waiting") end

View file

@ -521,14 +521,12 @@ RB_WRAP(pcm)
{
enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING,
PCM_PLAYSTOP, PCM_PLAYLOCK, PCM_PLAYUNLOCK,
PCM_CALCULATEPEAKS, PCM_SETFREQUENCY, PCM_GETBYTESWAITING, PCM_ECOUNT};
PCM_SETFREQUENCY, PCM_ECOUNT};
const char *pcm_option[] = {"apply_settings", "is_playing",
"play_stop", "play_lock", "play_unlock",
"calculate_peaks", "set_frequency", "get_bytes_waiting", NULL};
"set_frequency", NULL};
bool b_result;
int left, right;
size_t byteswait;
lua_pushnil(L); /*push nil so options w/o return have something to return */
@ -551,18 +549,9 @@ RB_WRAP(pcm)
case PCM_PLAYUNLOCK:
rb->pcm_play_unlock();
break;
case PCM_CALCULATEPEAKS:
rb->pcm_calculate_peaks(&left, &right);
lua_pushinteger(L, left);
lua_pushinteger(L, right);
return 2;
case PCM_SETFREQUENCY:
rb->pcm_set_frequency((unsigned int) luaL_checkint(L, 2));
break;
case PCM_GETBYTESWAITING:
byteswait = rb->pcm_get_bytes_waiting();
lua_pushinteger(L, byteswait);
break;
}
yield();