diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-04-01 13:41:03 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-04-01 13:41:03 +0000 |
| commit | 674eaca5ef59625f90088da006eca4d10e2bea56 (patch) | |
| tree | b0f02cec358ce1c506fb6d2256e2db059c7b6b6a /apps | |
| parent | 88d5aab5a1098c5636584ddf06bd3012dc8c5b4c (diff) | |
| download | rockbox-674eaca5ef59625f90088da006eca4d10e2bea56.zip rockbox-674eaca5ef59625f90088da006eca4d10e2bea56.tar.gz rockbox-674eaca5ef59625f90088da006eca4d10e2bea56.tar.bz2 rockbox-674eaca5ef59625f90088da006eca4d10e2bea56.tar.xz | |
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
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/plugin.c | 5 | ||||
| -rw-r--r-- | apps/plugin.h | 5 | ||||
| -rw-r--r-- | apps/plugins/alpine_cdc.c | 28 | ||||
| -rw-r--r-- | apps/plugins/metronome.c | 2 | ||||
| -rw-r--r-- | apps/plugins/oscilloscope.c | 4 | ||||
| -rw-r--r-- | apps/plugins/splitedit.c | 6 | ||||
| -rw-r--r-- | apps/plugins/video.c | 2 | ||||
| -rw-r--r-- | apps/plugins/vu_meter.c | 2 | ||||
| -rw-r--r-- | apps/recorder/radio.c | 20 | ||||
| -rw-r--r-- | apps/recorder/recording.c | 41 | ||||
| -rw-r--r-- | apps/screens.c | 13 | ||||
| -rw-r--r-- | apps/settings.c | 57 | ||||
| -rw-r--r-- | apps/sound_menu.c | 23 | ||||
| -rw-r--r-- | apps/status.c | 3 | ||||
| -rw-r--r-- | apps/wps.c | 23 |
15 files changed, 121 insertions, 113 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 35f0370..2031f0d 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -44,6 +44,7 @@ #include "mp3data.h" #include "powermgmt.h" #include "system.h" +#include "sound.h" #if (CONFIG_HWCODEC == MASNONE) #include "pcm_playback.h" #endif @@ -188,7 +189,7 @@ static const struct plugin_api rockbox_api = { memcmp, /* sound */ - mpeg_sound_set, + sound_set, #ifndef SIMULATOR mp3_play_data, mp3_play_pause, @@ -214,7 +215,7 @@ static const struct plugin_api rockbox_api = { mpeg_get_file_pos, mpeg_get_last_header, #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) - mpeg_set_pitch, + sound_set_pitch, #endif #if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) diff --git a/apps/plugin.h b/apps/plugin.h index 0707393..45f0355 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -50,6 +50,7 @@ #ifdef HAVE_LCD_BITMAP #include "widgets.h" #endif +#include "sound.h" #ifdef PLUGIN #if defined(DEBUG) || defined(SIMULATOR) @@ -228,7 +229,7 @@ struct plugin_api { int (*memcmp)(const void *s1, const void *s2, size_t n); /* sound */ - void (*mpeg_sound_set)(int setting, int value); + void (*sound_set)(int setting, int value); #ifndef SIMULATOR void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, int* size)); void (*mp3_play_pause)(bool play); @@ -254,7 +255,7 @@ struct plugin_api { int (*mpeg_get_file_pos)(void); unsigned long (*mpeg_get_last_header)(void); #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) - void (*mpeg_set_pitch)(int pitch); + void (*sound_set_pitch)(int pitch); #endif /* MAS communication */ diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c index 742e0bc..d944810 100644 --- a/apps/plugins/alpine_cdc.c +++ b/apps/plugins/alpine_cdc.c @@ -1042,25 +1042,25 @@ void set_position(int seconds) /* set to everything flat and 0 dB volume */ void sound_neutral(void) { /* neutral sound settings */ - rb->mpeg_sound_set(SOUND_BASS, 0); - rb->mpeg_sound_set(SOUND_TREBLE, 0); - rb->mpeg_sound_set(SOUND_BALANCE, 0); - rb->mpeg_sound_set(SOUND_VOLUME, 92); /* 0 dB */ - rb->mpeg_sound_set(SOUND_LOUDNESS, 0); - rb->mpeg_sound_set(SOUND_SUPERBASS, 0); - rb->mpeg_sound_set(SOUND_AVC, 0); + rb->sound_set(SOUND_BASS, 0); + rb->sound_set(SOUND_TREBLE, 0); + rb->sound_set(SOUND_BALANCE, 0); + rb->sound_set(SOUND_VOLUME, 92); /* 0 dB */ + rb->sound_set(SOUND_LOUDNESS, 0); + rb->sound_set(SOUND_SUPERBASS, 0); + rb->sound_set(SOUND_AVC, 0); } /* return to user settings */ void sound_normal(void) { /* restore sound settings */ - rb->mpeg_sound_set(SOUND_BASS, rb->global_settings->bass); - rb->mpeg_sound_set(SOUND_TREBLE, rb->global_settings->treble); - rb->mpeg_sound_set(SOUND_BALANCE, rb->global_settings->balance); - rb->mpeg_sound_set(SOUND_VOLUME, rb->global_settings->volume); - rb->mpeg_sound_set(SOUND_LOUDNESS, rb->global_settings->loudness); - rb->mpeg_sound_set(SOUND_SUPERBASS, rb->global_settings->superbass); - rb->mpeg_sound_set(SOUND_AVC, rb->global_settings->avc); + rb->sound_set(SOUND_BASS, rb->global_settings->bass); + rb->sound_set(SOUND_TREBLE, rb->global_settings->treble); + rb->sound_set(SOUND_BALANCE, rb->global_settings->balance); + rb->sound_set(SOUND_VOLUME, rb->global_settings->volume); + rb->sound_set(SOUND_LOUDNESS, rb->global_settings->loudness); + rb->sound_set(SOUND_SUPERBASS, rb->global_settings->superbass); + rb->sound_set(SOUND_AVC, rb->global_settings->avc); } /* the thread running it all */ diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c index 98b516f..3793fd9 100644 --- a/apps/plugins/metronome.c +++ b/apps/plugins/metronome.c @@ -201,7 +201,7 @@ void change_volume(int delta){ if (vol > 100) vol = 100; else if (vol < 0) vol = 0; if (vol != rb->global_settings->volume) { - rb->mpeg_sound_set(SOUND_VOLUME, vol); + rb->sound_set(SOUND_VOLUME, vol); rb->global_settings->volume = vol; rb->snprintf(buffer, sizeof(buffer), "Vol: %d ", vol); #ifdef HAVE_LCD_BITMAP diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index caa09a0..868a205 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -242,7 +242,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) if (vol < 100) { vol++; - rb->mpeg_sound_set(SOUND_VOLUME, vol); + rb->sound_set(SOUND_VOLUME, vol); rb->global_settings->volume = vol; } break; @@ -253,7 +253,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) if (vol > 0) { vol--; - rb->mpeg_sound_set(SOUND_VOLUME, vol); + rb->sound_set(SOUND_VOLUME, vol); rb->global_settings->volume = vol; } break; diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c index d3145b4..c2cdc8d 100644 --- a/apps/plugins/splitedit.c +++ b/apps/plugins/splitedit.c @@ -1055,17 +1055,17 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split, #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if defined(SPLITEDIT_SPEED150) && defined(SPLITEDIT_SPEED100) && defined(SPLITEDIT_SPEED50) case SPLITEDIT_SPEED150: - rb->mpeg_set_pitch(1500); + rb->sound_set_pitch(1500); splitedit_invalidate_osci(); break; case SPLITEDIT_SPEED100: - rb->mpeg_set_pitch(1000); + rb->sound_set_pitch(1000); splitedit_invalidate_osci(); break; case SPLITEDIT_SPEED50: - rb->mpeg_set_pitch(500); + rb->sound_set_pitch(500); splitedit_invalidate_osci(); break; #endif diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 73968d3..0257ad2 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -278,7 +278,7 @@ void ChangeVolume(int delta) else if (vol < 0) vol = 0; if (vol != rb->global_settings->volume) { - rb->mpeg_sound_set(SOUND_VOLUME, vol); + rb->sound_set(SOUND_VOLUME, vol); rb->global_settings->volume = vol; rb->snprintf(gPrint, sizeof(gPrint), "Vol: %d", vol); rb->lcd_puts(0, 7, gPrint); diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 22fc521..afeaa83 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -139,7 +139,7 @@ void change_volume(int delta) { if (vol>100) vol = 100; else if (vol < 0) vol = 0; if (vol != rb->global_settings->volume) { - rb->mpeg_sound_set(SOUND_VOLUME, vol); + rb->sound_set(SOUND_VOLUME, vol); rb->global_settings->volume = vol; rb->snprintf(curr_vol, sizeof(curr_vol), "%d", vol); rb->lcd_putsxy(0,0, curr_vol); diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 9acca53..fae01a7 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 d9b75d0..7aa6aba 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(); diff --git a/apps/screens.c b/apps/screens.c index 0efb30a..f56c28a 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -44,6 +44,7 @@ #include "screens.h" #include "debug.h" #include "led.h" +#include "sound.h" #ifdef HAVE_MMC #include "ata_mmc.h" #endif @@ -437,7 +438,7 @@ int pitch_screen(void) pitch++; if ( pitch > 2000 ) pitch = 2000; - mpeg_set_pitch(pitch); + sound_set_pitch(pitch); break; case BUTTON_DOWN: @@ -447,7 +448,7 @@ int pitch_screen(void) pitch--; if ( pitch < 500 ) pitch = 500; - mpeg_set_pitch(pitch); + sound_set_pitch(pitch); break; case BUTTON_ON | BUTTON_PLAY: @@ -468,28 +469,28 @@ int pitch_screen(void) case BUTTON_ON | BUTTON_RIGHT: if ( pitch < 2000 ) { pitch += 20; - mpeg_set_pitch(pitch); + sound_set_pitch(pitch); } break; case BUTTON_RIGHT | BUTTON_REL: if ( pitch > 500 ) { pitch -= 20; - mpeg_set_pitch(pitch); + sound_set_pitch(pitch); } break; case BUTTON_ON | BUTTON_LEFT: if ( pitch > 500 ) { pitch -= 20; - mpeg_set_pitch(pitch); + sound_set_pitch(pitch); } break; case BUTTON_LEFT | BUTTON_REL: if ( pitch < 2000 ) { pitch += 20; - mpeg_set_pitch(pitch); + sound_set_pitch(pitch); } break; diff --git a/apps/settings.c b/apps/settings.c index 8ff9c7b..df03bdc 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -64,6 +64,7 @@ #include "keyboard.h" #include "version.h" #include "rtc.h" +#include "sound.h" #if CONFIG_HWCODEC == MAS3507D void dac_line_in(bool enable); #endif @@ -719,21 +720,21 @@ void settings_apply_pm_range(void) void sound_settings_apply(void) { - mpeg_sound_set(SOUND_BASS, global_settings.bass); - mpeg_sound_set(SOUND_TREBLE, global_settings.treble); - mpeg_sound_set(SOUND_BALANCE, global_settings.balance); - mpeg_sound_set(SOUND_VOLUME, global_settings.volume); - mpeg_sound_set(SOUND_CHANNELS, global_settings.channel_config); - mpeg_sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); + sound_set(SOUND_BASS, global_settings.bass); + sound_set(SOUND_TREBLE, global_settings.treble); + sound_set(SOUND_BALANCE, global_settings.balance); + sound_set(SOUND_VOLUME, global_settings.volume); + sound_set(SOUND_CHANNELS, global_settings.channel_config); + sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) - mpeg_sound_set(SOUND_LOUDNESS, global_settings.loudness); - mpeg_sound_set(SOUND_AVC, global_settings.avc); - mpeg_sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength); - mpeg_sound_set(SOUND_MDB_HARMONICS, global_settings.mdb_harmonics); - mpeg_sound_set(SOUND_MDB_CENTER, global_settings.mdb_center); - mpeg_sound_set(SOUND_MDB_SHAPE, global_settings.mdb_shape); - mpeg_sound_set(SOUND_MDB_ENABLE, global_settings.mdb_enable); - mpeg_sound_set(SOUND_SUPERBASS, global_settings.superbass); + sound_set(SOUND_LOUDNESS, global_settings.loudness); + sound_set(SOUND_AVC, global_settings.avc); + sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength); + sound_set(SOUND_MDB_HARMONICS, global_settings.mdb_harmonics); + sound_set(SOUND_MDB_CENTER, global_settings.mdb_center); + sound_set(SOUND_MDB_SHAPE, global_settings.mdb_shape); + sound_set(SOUND_MDB_ENABLE, global_settings.mdb_enable); + sound_set(SOUND_SUPERBASS, global_settings.superbass); #endif } @@ -1261,20 +1262,20 @@ void settings_reset(void) { default_table(hd_bits, sizeof(hd_bits)/sizeof(hd_bits[0])); /* do some special cases not covered by table */ - global_settings.volume = mpeg_sound_default(SOUND_VOLUME); - global_settings.balance = mpeg_sound_default(SOUND_BALANCE); - global_settings.bass = mpeg_sound_default(SOUND_BASS); - global_settings.treble = mpeg_sound_default(SOUND_TREBLE); - global_settings.loudness = mpeg_sound_default(SOUND_LOUDNESS); - global_settings.avc = mpeg_sound_default(SOUND_AVC); - global_settings.channel_config = mpeg_sound_default(SOUND_CHANNELS); - global_settings.stereo_width = mpeg_sound_default(SOUND_STEREO_WIDTH); - global_settings.mdb_strength = mpeg_sound_default(SOUND_MDB_STRENGTH); - global_settings.mdb_harmonics = mpeg_sound_default(SOUND_MDB_HARMONICS); - global_settings.mdb_center = mpeg_sound_default(SOUND_MDB_CENTER); - global_settings.mdb_shape = mpeg_sound_default(SOUND_MDB_SHAPE); - global_settings.mdb_enable = mpeg_sound_default(SOUND_MDB_ENABLE); - global_settings.superbass = mpeg_sound_default(SOUND_SUPERBASS); + global_settings.volume = sound_default(SOUND_VOLUME); + global_settings.balance = sound_default(SOUND_BALANCE); + global_settings.bass = sound_default(SOUND_BASS); + global_settings.treble = sound_default(SOUND_TREBLE); + global_settings.loudness = sound_default(SOUND_LOUDNESS); + global_settings.avc = sound_default(SOUND_AVC); + global_settings.channel_config = sound_default(SOUND_CHANNELS); + global_settings.stereo_width = sound_default(SOUND_STEREO_WIDTH); + global_settings.mdb_strength = sound_default(SOUND_MDB_STRENGTH); + global_settings.mdb_harmonics = sound_default(SOUND_MDB_HARMONICS); + global_settings.mdb_center = sound_default(SOUND_MDB_CENTER); + global_settings.mdb_shape = sound_default(SOUND_MDB_SHAPE); + global_settings.mdb_enable = sound_default(SOUND_MDB_ENABLE); + global_settings.superbass = sound_default(SOUND_SUPERBASS); global_settings.contrast = lcd_default_contrast(); global_settings.wps_file[0] = '\0'; global_settings.font_file[0] = '\0'; diff --git a/apps/sound_menu.c b/apps/sound_menu.c index f08ee35..560163c 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c @@ -34,6 +34,7 @@ #include "sprintf.h" #include "talk.h" #include "misc.h" +#include "sound.h" static const char* const fmt[] = { @@ -59,11 +60,11 @@ bool set_sound(const char* string, int steps; int button; - unit = mpeg_sound_unit(setting); - numdec = mpeg_sound_numdecimals(setting); - steps = mpeg_sound_steps(setting); - min = mpeg_sound_min(setting); - max = mpeg_sound_max(setting); + unit = sound_unit(setting); + numdec = sound_numdecimals(setting); + steps = sound_steps(setting); + min = sound_min(setting); + max = sound_max(setting); if (*unit == 'd') /* crude reconstruction */ talkunit = UNIT_DB; else if (*unit == '%') @@ -82,7 +83,7 @@ bool set_sound(const char* string, while (!done) { if (changed) { - val = mpeg_val2phys(setting, *variable); + val = sound_val2phys(setting, *variable); if(numdec) { integer = val / (10 * numdec); @@ -136,7 +137,7 @@ bool set_sound(const char* string, break; } if (changed) - mpeg_sound_set(setting, *variable); + sound_set(setting, *variable); } lcd_stop_scroll(); return false; @@ -196,7 +197,7 @@ static bool mdb_shape(void) static void set_mdb_enable(bool value) { - mpeg_sound_set(SOUND_MDB_ENABLE, (int)value); + sound_set(SOUND_MDB_ENABLE, (int)value); } static bool mdb_enable(void) @@ -210,7 +211,7 @@ static bool mdb_enable(void) static void set_superbass(bool value) { - mpeg_sound_set(SOUND_SUPERBASS, (int)value); + sound_set(SOUND_SUPERBASS, (int)value); } static bool superbass(void) @@ -224,7 +225,7 @@ static bool superbass(void) static void set_avc(int val) { - mpeg_sound_set(SOUND_AVC, val); + sound_set(SOUND_AVC, val); } static bool avc(void) @@ -379,7 +380,7 @@ static bool reconstartup(void) static void set_chanconf(int val) { - mpeg_sound_set(SOUND_CHANNELS, val); + sound_set(SOUND_CHANNELS, val); } static bool chanconf(void) diff --git a/apps/status.c b/apps/status.c index 562cd50..d4736f3 100644 --- a/apps/status.c +++ b/apps/status.c @@ -36,6 +36,7 @@ #endif #include "powermgmt.h" #include "led.h" +#include "sound.h" static enum playmode ff_mode; @@ -146,7 +147,7 @@ void status_draw(bool force_redraw) (void)force_redraw; /* players always "redraw" */ #endif - info.volume = mpeg_val2phys(SOUND_VOLUME, global_settings.volume); + info.volume = sound_val2phys(SOUND_VOLUME, global_settings.volume); info.inserted = charger_inserted(); info.battlevel = battery_level(); info.battery_safe = battery_level_safe(); @@ -49,6 +49,7 @@ #include "lang.h" #include "bookmark.h" #include "misc.h" +#include "sound.h" #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ /* 3% of 30min file == 54s step size */ @@ -172,17 +173,17 @@ static char current_track_path[MAX_PATH+1]; */ static bool setvol(void) { - if (global_settings.volume < mpeg_sound_min(SOUND_VOLUME)) - global_settings.volume = mpeg_sound_min(SOUND_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_min(SOUND_VOLUME)) + global_settings.volume = sound_min(SOUND_VOLUME); + if (global_settings.volume > sound_max(SOUND_VOLUME)) + global_settings.volume = sound_max(SOUND_VOLUME); + sound_set(SOUND_VOLUME, global_settings.volume); status_draw(false); wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC); settings_save(); #ifdef HAVE_LCD_CHARCELLS splash(0, false, "Vol: %d %% ", - mpeg_val2phys(SOUND_VOLUME, global_settings.volume)); + sound_val2phys(SOUND_VOLUME, global_settings.volume)); return true; #endif return false; @@ -388,7 +389,7 @@ static void fade(bool fade_in) int current_volume = 20; /* zero out the sound */ - mpeg_sound_set(SOUND_VOLUME, current_volume); + sound_set(SOUND_VOLUME, current_volume); sleep(HZ/10); /* let mpeg thread run */ mpeg_resume(); @@ -396,9 +397,9 @@ static void fade(bool fade_in) while (current_volume < global_settings.volume) { current_volume += 2; sleep(1); - mpeg_sound_set(SOUND_VOLUME, current_volume); + sound_set(SOUND_VOLUME, current_volume); } - mpeg_sound_set(SOUND_VOLUME, global_settings.volume); + sound_set(SOUND_VOLUME, global_settings.volume); } else { /* fade out */ @@ -407,13 +408,13 @@ static void fade(bool fade_in) while (current_volume > 20) { current_volume -= 2; sleep(1); - mpeg_sound_set(SOUND_VOLUME, current_volume); + sound_set(SOUND_VOLUME, current_volume); } mpeg_pause(); sleep(HZ/5); /* let mpeg thread run */ /* reset volume to what it was before the fade */ - mpeg_sound_set(SOUND_VOLUME, global_settings.volume); + sound_set(SOUND_VOLUME, global_settings.volume); } } |