From 674eaca5ef59625f90088da006eca4d10e2bea56 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Fri, 1 Apr 2005 13:41:03 +0000 Subject: Moved the mpeg_sound_xxx() functions to sound.c and renamed them to sound_xxx() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6240 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/radio.c | 20 ++++++++++---------- apps/recorder/recording.c | 41 +++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 30 deletions(-) (limited to 'apps/recorder') diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 9acca539ee..fae01a7590 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c @@ -220,8 +220,8 @@ bool radio_screen(void) global_settings.rec_prerecord_time); - mpeg_set_recording_gain(mpeg_sound_default(SOUND_LEFT_GAIN), - mpeg_sound_default(SOUND_RIGHT_GAIN), false); + mpeg_set_recording_gain(sound_default(SOUND_LEFT_GAIN), + sound_default(SOUND_RIGHT_GAIN), false); #endif curr_freq = global_settings.last_frequency * FREQ_STEP + MIN_FREQ; @@ -356,9 +356,9 @@ bool radio_screen(void) case BUTTON_UP: case BUTTON_UP | BUTTON_REPEAT: global_settings.volume++; - if(global_settings.volume > mpeg_sound_max(SOUND_VOLUME)) - global_settings.volume = mpeg_sound_max(SOUND_VOLUME); - mpeg_sound_set(SOUND_VOLUME, global_settings.volume); + if(global_settings.volume > sound_max(SOUND_VOLUME)) + global_settings.volume = sound_max(SOUND_VOLUME); + sound_set(SOUND_VOLUME, global_settings.volume); update_screen = true; settings_save(); break; @@ -366,9 +366,9 @@ bool radio_screen(void) case BUTTON_DOWN: case BUTTON_DOWN | BUTTON_REPEAT: global_settings.volume--; - if(global_settings.volume < mpeg_sound_min(SOUND_VOLUME)) - global_settings.volume = mpeg_sound_min(SOUND_VOLUME); - mpeg_sound_set(SOUND_VOLUME, global_settings.volume); + if(global_settings.volume < sound_min(SOUND_VOLUME)) + global_settings.volume = sound_min(SOUND_VOLUME); + sound_set(SOUND_VOLUME, global_settings.volume); update_screen = true; settings_save(); break; @@ -548,8 +548,8 @@ bool radio_screen(void) if(keep_playing) { /* Enable the Left and right A/D Converter */ - mpeg_set_recording_gain(mpeg_sound_default(SOUND_LEFT_GAIN), - mpeg_sound_default(SOUND_RIGHT_GAIN), false); + mpeg_set_recording_gain(sound_default(SOUND_LEFT_GAIN), + sound_default(SOUND_RIGHT_GAIN), false); mas_codec_writereg(6, 0x4000); radio_set_status(FMRADIO_POWERED); /* leave it powered */ } diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index d9b75d05f9..7aa6aba98c 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -49,6 +49,7 @@ #include "errno.h" #include "talk.h" #include "atoi.h" +#include "sound.h" #ifdef HAVE_RECORDING @@ -124,9 +125,9 @@ char *fmt_gain(int snd, int val, char *str, int len) int tmp, i, d, numdec; const char *unit; - tmp = mpeg_val2phys(snd, val); - numdec = mpeg_sound_numdecimals(snd); - unit = mpeg_sound_unit(snd); + tmp = sound_val2phys(snd, val); + numdec = sound_numdecimals(snd); + unit = sound_unit(snd); i = tmp / (10*numdec); d = abs(tmp % (10*numdec)); @@ -268,7 +269,7 @@ bool recording_screen(void) cursor = 0; mpeg_init_recording(); - mpeg_sound_set(SOUND_VOLUME, global_settings.volume); + sound_set(SOUND_VOLUME, global_settings.volume); /* Yes, we use the D/A for monitoring */ peak_meter_playback(true); @@ -395,16 +396,16 @@ bool recording_screen(void) { global_settings.rec_mic_gain++; if(global_settings.rec_mic_gain > - mpeg_sound_max(SOUND_MIC_GAIN)) + sound_max(SOUND_MIC_GAIN)) global_settings.rec_mic_gain = - mpeg_sound_max(SOUND_MIC_GAIN); + sound_max(SOUND_MIC_GAIN); } else { gain = MAX(global_settings.rec_left_gain, global_settings.rec_right_gain) + 1; - if(gain > mpeg_sound_max(SOUND_MIC_GAIN)) - gain = mpeg_sound_max(SOUND_MIC_GAIN); + if(gain > sound_max(SOUND_MIC_GAIN)) + gain = sound_max(SOUND_MIC_GAIN); global_settings.rec_left_gain = gain; global_settings.rec_right_gain = gain; } @@ -412,16 +413,16 @@ bool recording_screen(void) case 1: global_settings.rec_left_gain++; if(global_settings.rec_left_gain > - mpeg_sound_max(SOUND_LEFT_GAIN)) + sound_max(SOUND_LEFT_GAIN)) global_settings.rec_left_gain = - mpeg_sound_max(SOUND_LEFT_GAIN); + sound_max(SOUND_LEFT_GAIN); break; case 2: global_settings.rec_right_gain++; if(global_settings.rec_right_gain > - mpeg_sound_max(SOUND_RIGHT_GAIN)) + sound_max(SOUND_RIGHT_GAIN)) global_settings.rec_right_gain = - mpeg_sound_max(SOUND_RIGHT_GAIN); + sound_max(SOUND_RIGHT_GAIN); break; } set_gain(); @@ -437,16 +438,16 @@ bool recording_screen(void) { global_settings.rec_mic_gain--; if(global_settings.rec_mic_gain < - mpeg_sound_min(SOUND_MIC_GAIN)) + sound_min(SOUND_MIC_GAIN)) global_settings.rec_mic_gain = - mpeg_sound_min(SOUND_MIC_GAIN); + sound_min(SOUND_MIC_GAIN); } else { gain = MAX(global_settings.rec_left_gain, global_settings.rec_right_gain) - 1; - if(gain < mpeg_sound_min(SOUND_LEFT_GAIN)) - gain = mpeg_sound_min(SOUND_LEFT_GAIN); + if(gain < sound_min(SOUND_LEFT_GAIN)) + gain = sound_min(SOUND_LEFT_GAIN); global_settings.rec_left_gain = gain; global_settings.rec_right_gain = gain; } @@ -454,16 +455,16 @@ bool recording_screen(void) case 1: global_settings.rec_left_gain--; if(global_settings.rec_left_gain < - mpeg_sound_min(SOUND_LEFT_GAIN)) + sound_min(SOUND_LEFT_GAIN)) global_settings.rec_left_gain = - mpeg_sound_min(SOUND_LEFT_GAIN); + sound_min(SOUND_LEFT_GAIN); break; case 2: global_settings.rec_right_gain--; if(global_settings.rec_right_gain < - mpeg_sound_min(SOUND_MIC_GAIN)) + sound_min(SOUND_MIC_GAIN)) global_settings.rec_right_gain = - mpeg_sound_min(SOUND_MIC_GAIN); + sound_min(SOUND_MIC_GAIN); break; } set_gain(); -- cgit v1.2.3