diff options
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 35f03703ba..2031f0d450 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "mp3data.h" | 44 | #include "mp3data.h" |
45 | #include "powermgmt.h" | 45 | #include "powermgmt.h" |
46 | #include "system.h" | 46 | #include "system.h" |
47 | #include "sound.h" | ||
47 | #if (CONFIG_HWCODEC == MASNONE) | 48 | #if (CONFIG_HWCODEC == MASNONE) |
48 | #include "pcm_playback.h" | 49 | #include "pcm_playback.h" |
49 | #endif | 50 | #endif |
@@ -188,7 +189,7 @@ static const struct plugin_api rockbox_api = { | |||
188 | memcmp, | 189 | memcmp, |
189 | 190 | ||
190 | /* sound */ | 191 | /* sound */ |
191 | mpeg_sound_set, | 192 | sound_set, |
192 | #ifndef SIMULATOR | 193 | #ifndef SIMULATOR |
193 | mp3_play_data, | 194 | mp3_play_data, |
194 | mp3_play_pause, | 195 | mp3_play_pause, |
@@ -214,7 +215,7 @@ static const struct plugin_api rockbox_api = { | |||
214 | mpeg_get_file_pos, | 215 | mpeg_get_file_pos, |
215 | mpeg_get_last_header, | 216 | mpeg_get_last_header, |
216 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 217 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) |
217 | mpeg_set_pitch, | 218 | sound_set_pitch, |
218 | #endif | 219 | #endif |
219 | 220 | ||
220 | #if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) | 221 | #if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) |
diff --git a/apps/plugin.h b/apps/plugin.h index 0707393b59..45f03555ec 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #ifdef HAVE_LCD_BITMAP | 50 | #ifdef HAVE_LCD_BITMAP |
51 | #include "widgets.h" | 51 | #include "widgets.h" |
52 | #endif | 52 | #endif |
53 | #include "sound.h" | ||
53 | 54 | ||
54 | #ifdef PLUGIN | 55 | #ifdef PLUGIN |
55 | #if defined(DEBUG) || defined(SIMULATOR) | 56 | #if defined(DEBUG) || defined(SIMULATOR) |
@@ -228,7 +229,7 @@ struct plugin_api { | |||
228 | int (*memcmp)(const void *s1, const void *s2, size_t n); | 229 | int (*memcmp)(const void *s1, const void *s2, size_t n); |
229 | 230 | ||
230 | /* sound */ | 231 | /* sound */ |
231 | void (*mpeg_sound_set)(int setting, int value); | 232 | void (*sound_set)(int setting, int value); |
232 | #ifndef SIMULATOR | 233 | #ifndef SIMULATOR |
233 | void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, int* size)); | 234 | void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, int* size)); |
234 | void (*mp3_play_pause)(bool play); | 235 | void (*mp3_play_pause)(bool play); |
@@ -254,7 +255,7 @@ struct plugin_api { | |||
254 | int (*mpeg_get_file_pos)(void); | 255 | int (*mpeg_get_file_pos)(void); |
255 | unsigned long (*mpeg_get_last_header)(void); | 256 | unsigned long (*mpeg_get_last_header)(void); |
256 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 257 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) |
257 | void (*mpeg_set_pitch)(int pitch); | 258 | void (*sound_set_pitch)(int pitch); |
258 | #endif | 259 | #endif |
259 | 260 | ||
260 | /* MAS communication */ | 261 | /* MAS communication */ |
diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c index 742e0bc6f5..d944810b31 100644 --- a/apps/plugins/alpine_cdc.c +++ b/apps/plugins/alpine_cdc.c | |||
@@ -1042,25 +1042,25 @@ void set_position(int seconds) | |||
1042 | /* set to everything flat and 0 dB volume */ | 1042 | /* set to everything flat and 0 dB volume */ |
1043 | void sound_neutral(void) | 1043 | void sound_neutral(void) |
1044 | { /* neutral sound settings */ | 1044 | { /* neutral sound settings */ |
1045 | rb->mpeg_sound_set(SOUND_BASS, 0); | 1045 | rb->sound_set(SOUND_BASS, 0); |
1046 | rb->mpeg_sound_set(SOUND_TREBLE, 0); | 1046 | rb->sound_set(SOUND_TREBLE, 0); |
1047 | rb->mpeg_sound_set(SOUND_BALANCE, 0); | 1047 | rb->sound_set(SOUND_BALANCE, 0); |
1048 | rb->mpeg_sound_set(SOUND_VOLUME, 92); /* 0 dB */ | 1048 | rb->sound_set(SOUND_VOLUME, 92); /* 0 dB */ |
1049 | rb->mpeg_sound_set(SOUND_LOUDNESS, 0); | 1049 | rb->sound_set(SOUND_LOUDNESS, 0); |
1050 | rb->mpeg_sound_set(SOUND_SUPERBASS, 0); | 1050 | rb->sound_set(SOUND_SUPERBASS, 0); |
1051 | rb->mpeg_sound_set(SOUND_AVC, 0); | 1051 | rb->sound_set(SOUND_AVC, 0); |
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | /* return to user settings */ | 1054 | /* return to user settings */ |
1055 | void sound_normal(void) | 1055 | void sound_normal(void) |
1056 | { /* restore sound settings */ | 1056 | { /* restore sound settings */ |
1057 | rb->mpeg_sound_set(SOUND_BASS, rb->global_settings->bass); | 1057 | rb->sound_set(SOUND_BASS, rb->global_settings->bass); |
1058 | rb->mpeg_sound_set(SOUND_TREBLE, rb->global_settings->treble); | 1058 | rb->sound_set(SOUND_TREBLE, rb->global_settings->treble); |
1059 | rb->mpeg_sound_set(SOUND_BALANCE, rb->global_settings->balance); | 1059 | rb->sound_set(SOUND_BALANCE, rb->global_settings->balance); |
1060 | rb->mpeg_sound_set(SOUND_VOLUME, rb->global_settings->volume); | 1060 | rb->sound_set(SOUND_VOLUME, rb->global_settings->volume); |
1061 | rb->mpeg_sound_set(SOUND_LOUDNESS, rb->global_settings->loudness); | 1061 | rb->sound_set(SOUND_LOUDNESS, rb->global_settings->loudness); |
1062 | rb->mpeg_sound_set(SOUND_SUPERBASS, rb->global_settings->superbass); | 1062 | rb->sound_set(SOUND_SUPERBASS, rb->global_settings->superbass); |
1063 | rb->mpeg_sound_set(SOUND_AVC, rb->global_settings->avc); | 1063 | rb->sound_set(SOUND_AVC, rb->global_settings->avc); |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | /* the thread running it all */ | 1066 | /* the thread running it all */ |
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c index 98b516f9e8..3793fd9690 100644 --- a/apps/plugins/metronome.c +++ b/apps/plugins/metronome.c | |||
@@ -201,7 +201,7 @@ void change_volume(int delta){ | |||
201 | if (vol > 100) vol = 100; | 201 | if (vol > 100) vol = 100; |
202 | else if (vol < 0) vol = 0; | 202 | else if (vol < 0) vol = 0; |
203 | if (vol != rb->global_settings->volume) { | 203 | if (vol != rb->global_settings->volume) { |
204 | rb->mpeg_sound_set(SOUND_VOLUME, vol); | 204 | rb->sound_set(SOUND_VOLUME, vol); |
205 | rb->global_settings->volume = vol; | 205 | rb->global_settings->volume = vol; |
206 | rb->snprintf(buffer, sizeof(buffer), "Vol: %d ", vol); | 206 | rb->snprintf(buffer, sizeof(buffer), "Vol: %d ", vol); |
207 | #ifdef HAVE_LCD_BITMAP | 207 | #ifdef HAVE_LCD_BITMAP |
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index caa09a0ed4..868a20547c 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) | |||
242 | if (vol < 100) | 242 | if (vol < 100) |
243 | { | 243 | { |
244 | vol++; | 244 | vol++; |
245 | rb->mpeg_sound_set(SOUND_VOLUME, vol); | 245 | rb->sound_set(SOUND_VOLUME, vol); |
246 | rb->global_settings->volume = vol; | 246 | rb->global_settings->volume = vol; |
247 | } | 247 | } |
248 | break; | 248 | break; |
@@ -253,7 +253,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
253 | if (vol > 0) | 253 | if (vol > 0) |
254 | { | 254 | { |
255 | vol--; | 255 | vol--; |
256 | rb->mpeg_sound_set(SOUND_VOLUME, vol); | 256 | rb->sound_set(SOUND_VOLUME, vol); |
257 | rb->global_settings->volume = vol; | 257 | rb->global_settings->volume = vol; |
258 | } | 258 | } |
259 | break; | 259 | break; |
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c index d3145b438a..c2cdc8de6e 100644 --- a/apps/plugins/splitedit.c +++ b/apps/plugins/splitedit.c | |||
@@ -1055,17 +1055,17 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split, | |||
1055 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 1055 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) |
1056 | #if defined(SPLITEDIT_SPEED150) && defined(SPLITEDIT_SPEED100) && defined(SPLITEDIT_SPEED50) | 1056 | #if defined(SPLITEDIT_SPEED150) && defined(SPLITEDIT_SPEED100) && defined(SPLITEDIT_SPEED50) |
1057 | case SPLITEDIT_SPEED150: | 1057 | case SPLITEDIT_SPEED150: |
1058 | rb->mpeg_set_pitch(1500); | 1058 | rb->sound_set_pitch(1500); |
1059 | splitedit_invalidate_osci(); | 1059 | splitedit_invalidate_osci(); |
1060 | break; | 1060 | break; |
1061 | 1061 | ||
1062 | case SPLITEDIT_SPEED100: | 1062 | case SPLITEDIT_SPEED100: |
1063 | rb->mpeg_set_pitch(1000); | 1063 | rb->sound_set_pitch(1000); |
1064 | splitedit_invalidate_osci(); | 1064 | splitedit_invalidate_osci(); |
1065 | break; | 1065 | break; |
1066 | 1066 | ||
1067 | case SPLITEDIT_SPEED50: | 1067 | case SPLITEDIT_SPEED50: |
1068 | rb->mpeg_set_pitch(500); | 1068 | rb->sound_set_pitch(500); |
1069 | splitedit_invalidate_osci(); | 1069 | splitedit_invalidate_osci(); |
1070 | break; | 1070 | break; |
1071 | #endif | 1071 | #endif |
diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 73968d33b3..0257ad26b7 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c | |||
@@ -278,7 +278,7 @@ void ChangeVolume(int delta) | |||
278 | else if (vol < 0) vol = 0; | 278 | else if (vol < 0) vol = 0; |
279 | if (vol != rb->global_settings->volume) | 279 | if (vol != rb->global_settings->volume) |
280 | { | 280 | { |
281 | rb->mpeg_sound_set(SOUND_VOLUME, vol); | 281 | rb->sound_set(SOUND_VOLUME, vol); |
282 | rb->global_settings->volume = vol; | 282 | rb->global_settings->volume = vol; |
283 | rb->snprintf(gPrint, sizeof(gPrint), "Vol: %d", vol); | 283 | rb->snprintf(gPrint, sizeof(gPrint), "Vol: %d", vol); |
284 | rb->lcd_puts(0, 7, gPrint); | 284 | rb->lcd_puts(0, 7, gPrint); |
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 22fc5217d2..afeaa83d90 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c | |||
@@ -139,7 +139,7 @@ void change_volume(int delta) { | |||
139 | if (vol>100) vol = 100; | 139 | if (vol>100) vol = 100; |
140 | else if (vol < 0) vol = 0; | 140 | else if (vol < 0) vol = 0; |
141 | if (vol != rb->global_settings->volume) { | 141 | if (vol != rb->global_settings->volume) { |
142 | rb->mpeg_sound_set(SOUND_VOLUME, vol); | 142 | rb->sound_set(SOUND_VOLUME, vol); |
143 | rb->global_settings->volume = vol; | 143 | rb->global_settings->volume = vol; |
144 | rb->snprintf(curr_vol, sizeof(curr_vol), "%d", vol); | 144 | rb->snprintf(curr_vol, sizeof(curr_vol), "%d", vol); |
145 | rb->lcd_putsxy(0,0, curr_vol); | 145 | rb->lcd_putsxy(0,0, curr_vol); |
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) | |||
220 | global_settings.rec_prerecord_time); | 220 | global_settings.rec_prerecord_time); |
221 | 221 | ||
222 | 222 | ||
223 | mpeg_set_recording_gain(mpeg_sound_default(SOUND_LEFT_GAIN), | 223 | mpeg_set_recording_gain(sound_default(SOUND_LEFT_GAIN), |
224 | mpeg_sound_default(SOUND_RIGHT_GAIN), false); | 224 | sound_default(SOUND_RIGHT_GAIN), false); |
225 | #endif | 225 | #endif |
226 | 226 | ||
227 | curr_freq = global_settings.last_frequency * FREQ_STEP + MIN_FREQ; | 227 | curr_freq = global_settings.last_frequency * FREQ_STEP + MIN_FREQ; |
@@ -356,9 +356,9 @@ bool radio_screen(void) | |||
356 | case BUTTON_UP: | 356 | case BUTTON_UP: |
357 | case BUTTON_UP | BUTTON_REPEAT: | 357 | case BUTTON_UP | BUTTON_REPEAT: |
358 | global_settings.volume++; | 358 | global_settings.volume++; |
359 | if(global_settings.volume > mpeg_sound_max(SOUND_VOLUME)) | 359 | if(global_settings.volume > sound_max(SOUND_VOLUME)) |
360 | global_settings.volume = mpeg_sound_max(SOUND_VOLUME); | 360 | global_settings.volume = sound_max(SOUND_VOLUME); |
361 | mpeg_sound_set(SOUND_VOLUME, global_settings.volume); | 361 | sound_set(SOUND_VOLUME, global_settings.volume); |
362 | update_screen = true; | 362 | update_screen = true; |
363 | settings_save(); | 363 | settings_save(); |
364 | break; | 364 | break; |
@@ -366,9 +366,9 @@ bool radio_screen(void) | |||
366 | case BUTTON_DOWN: | 366 | case BUTTON_DOWN: |
367 | case BUTTON_DOWN | BUTTON_REPEAT: | 367 | case BUTTON_DOWN | BUTTON_REPEAT: |
368 | global_settings.volume--; | 368 | global_settings.volume--; |
369 | if(global_settings.volume < mpeg_sound_min(SOUND_VOLUME)) | 369 | if(global_settings.volume < sound_min(SOUND_VOLUME)) |
370 | global_settings.volume = mpeg_sound_min(SOUND_VOLUME); | 370 | global_settings.volume = sound_min(SOUND_VOLUME); |
371 | mpeg_sound_set(SOUND_VOLUME, global_settings.volume); | 371 | sound_set(SOUND_VOLUME, global_settings.volume); |
372 | update_screen = true; | 372 | update_screen = true; |
373 | settings_save(); | 373 | settings_save(); |
374 | break; | 374 | break; |
@@ -548,8 +548,8 @@ bool radio_screen(void) | |||
548 | if(keep_playing) | 548 | if(keep_playing) |
549 | { | 549 | { |
550 | /* Enable the Left and right A/D Converter */ | 550 | /* Enable the Left and right A/D Converter */ |
551 | mpeg_set_recording_gain(mpeg_sound_default(SOUND_LEFT_GAIN), | 551 | mpeg_set_recording_gain(sound_default(SOUND_LEFT_GAIN), |
552 | mpeg_sound_default(SOUND_RIGHT_GAIN), false); | 552 | sound_default(SOUND_RIGHT_GAIN), false); |
553 | mas_codec_writereg(6, 0x4000); | 553 | mas_codec_writereg(6, 0x4000); |
554 | radio_set_status(FMRADIO_POWERED); /* leave it powered */ | 554 | radio_set_status(FMRADIO_POWERED); /* leave it powered */ |
555 | } | 555 | } |
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 @@ | |||
49 | #include "errno.h" | 49 | #include "errno.h" |
50 | #include "talk.h" | 50 | #include "talk.h" |
51 | #include "atoi.h" | 51 | #include "atoi.h" |
52 | #include "sound.h" | ||
52 | 53 | ||
53 | #ifdef HAVE_RECORDING | 54 | #ifdef HAVE_RECORDING |
54 | 55 | ||
@@ -124,9 +125,9 @@ char *fmt_gain(int snd, int val, char *str, int len) | |||
124 | int tmp, i, d, numdec; | 125 | int tmp, i, d, numdec; |
125 | const char *unit; | 126 | const char *unit; |
126 | 127 | ||
127 | tmp = mpeg_val2phys(snd, val); | 128 | tmp = sound_val2phys(snd, val); |
128 | numdec = mpeg_sound_numdecimals(snd); | 129 | numdec = sound_numdecimals(snd); |
129 | unit = mpeg_sound_unit(snd); | 130 | unit = sound_unit(snd); |
130 | 131 | ||
131 | i = tmp / (10*numdec); | 132 | i = tmp / (10*numdec); |
132 | d = abs(tmp % (10*numdec)); | 133 | d = abs(tmp % (10*numdec)); |
@@ -268,7 +269,7 @@ bool recording_screen(void) | |||
268 | cursor = 0; | 269 | cursor = 0; |
269 | mpeg_init_recording(); | 270 | mpeg_init_recording(); |
270 | 271 | ||
271 | mpeg_sound_set(SOUND_VOLUME, global_settings.volume); | 272 | sound_set(SOUND_VOLUME, global_settings.volume); |
272 | 273 | ||
273 | /* Yes, we use the D/A for monitoring */ | 274 | /* Yes, we use the D/A for monitoring */ |
274 | peak_meter_playback(true); | 275 | peak_meter_playback(true); |
@@ -395,16 +396,16 @@ bool recording_screen(void) | |||
395 | { | 396 | { |
396 | global_settings.rec_mic_gain++; | 397 | global_settings.rec_mic_gain++; |
397 | if(global_settings.rec_mic_gain > | 398 | if(global_settings.rec_mic_gain > |
398 | mpeg_sound_max(SOUND_MIC_GAIN)) | 399 | sound_max(SOUND_MIC_GAIN)) |
399 | global_settings.rec_mic_gain = | 400 | global_settings.rec_mic_gain = |
400 | mpeg_sound_max(SOUND_MIC_GAIN); | 401 | sound_max(SOUND_MIC_GAIN); |
401 | } | 402 | } |
402 | else | 403 | else |
403 | { | 404 | { |
404 | gain = MAX(global_settings.rec_left_gain, | 405 | gain = MAX(global_settings.rec_left_gain, |
405 | global_settings.rec_right_gain) + 1; | 406 | global_settings.rec_right_gain) + 1; |
406 | if(gain > mpeg_sound_max(SOUND_MIC_GAIN)) | 407 | if(gain > sound_max(SOUND_MIC_GAIN)) |
407 | gain = mpeg_sound_max(SOUND_MIC_GAIN); | 408 | gain = sound_max(SOUND_MIC_GAIN); |
408 | global_settings.rec_left_gain = gain; | 409 | global_settings.rec_left_gain = gain; |
409 | global_settings.rec_right_gain = gain; | 410 | global_settings.rec_right_gain = gain; |
410 | } | 411 | } |
@@ -412,16 +413,16 @@ bool recording_screen(void) | |||
412 | case 1: | 413 | case 1: |
413 | global_settings.rec_left_gain++; | 414 | global_settings.rec_left_gain++; |
414 | if(global_settings.rec_left_gain > | 415 | if(global_settings.rec_left_gain > |
415 | mpeg_sound_max(SOUND_LEFT_GAIN)) | 416 | sound_max(SOUND_LEFT_GAIN)) |
416 | global_settings.rec_left_gain = | 417 | global_settings.rec_left_gain = |
417 | mpeg_sound_max(SOUND_LEFT_GAIN); | 418 | sound_max(SOUND_LEFT_GAIN); |
418 | break; | 419 | break; |
419 | case 2: | 420 | case 2: |
420 | global_settings.rec_right_gain++; | 421 | global_settings.rec_right_gain++; |
421 | if(global_settings.rec_right_gain > | 422 | if(global_settings.rec_right_gain > |
422 | mpeg_sound_max(SOUND_RIGHT_GAIN)) | 423 | sound_max(SOUND_RIGHT_GAIN)) |
423 | global_settings.rec_right_gain = | 424 | global_settings.rec_right_gain = |
424 | mpeg_sound_max(SOUND_RIGHT_GAIN); | 425 | sound_max(SOUND_RIGHT_GAIN); |
425 | break; | 426 | break; |
426 | } | 427 | } |
427 | set_gain(); | 428 | set_gain(); |
@@ -437,16 +438,16 @@ bool recording_screen(void) | |||
437 | { | 438 | { |
438 | global_settings.rec_mic_gain--; | 439 | global_settings.rec_mic_gain--; |
439 | if(global_settings.rec_mic_gain < | 440 | if(global_settings.rec_mic_gain < |
440 | mpeg_sound_min(SOUND_MIC_GAIN)) | 441 | sound_min(SOUND_MIC_GAIN)) |
441 | global_settings.rec_mic_gain = | 442 | global_settings.rec_mic_gain = |
442 | mpeg_sound_min(SOUND_MIC_GAIN); | 443 | sound_min(SOUND_MIC_GAIN); |
443 | } | 444 | } |
444 | else | 445 | else |
445 | { | 446 | { |
446 | gain = MAX(global_settings.rec_left_gain, | 447 | gain = MAX(global_settings.rec_left_gain, |
447 | global_settings.rec_right_gain) - 1; | 448 | global_settings.rec_right_gain) - 1; |
448 | if(gain < mpeg_sound_min(SOUND_LEFT_GAIN)) | 449 | if(gain < sound_min(SOUND_LEFT_GAIN)) |
449 | gain = mpeg_sound_min(SOUND_LEFT_GAIN); | 450 | gain = sound_min(SOUND_LEFT_GAIN); |
450 | global_settings.rec_left_gain = gain; | 451 | global_settings.rec_left_gain = gain; |
451 | global_settings.rec_right_gain = gain; | 452 | global_settings.rec_right_gain = gain; |
452 | } | 453 | } |
@@ -454,16 +455,16 @@ bool recording_screen(void) | |||
454 | case 1: | 455 | case 1: |
455 | global_settings.rec_left_gain--; | 456 | global_settings.rec_left_gain--; |
456 | if(global_settings.rec_left_gain < | 457 | if(global_settings.rec_left_gain < |
457 | mpeg_sound_min(SOUND_LEFT_GAIN)) | 458 | sound_min(SOUND_LEFT_GAIN)) |
458 | global_settings.rec_left_gain = | 459 | global_settings.rec_left_gain = |
459 | mpeg_sound_min(SOUND_LEFT_GAIN); | 460 | sound_min(SOUND_LEFT_GAIN); |
460 | break; | 461 | break; |
461 | case 2: | 462 | case 2: |
462 | global_settings.rec_right_gain--; | 463 | global_settings.rec_right_gain--; |
463 | if(global_settings.rec_right_gain < | 464 | if(global_settings.rec_right_gain < |
464 | mpeg_sound_min(SOUND_MIC_GAIN)) | 465 | sound_min(SOUND_MIC_GAIN)) |
465 | global_settings.rec_right_gain = | 466 | global_settings.rec_right_gain = |
466 | mpeg_sound_min(SOUND_MIC_GAIN); | 467 | sound_min(SOUND_MIC_GAIN); |
467 | break; | 468 | break; |
468 | } | 469 | } |
469 | set_gain(); | 470 | set_gain(); |
diff --git a/apps/screens.c b/apps/screens.c index 0efb30a806..f56c28a165 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "screens.h" | 44 | #include "screens.h" |
45 | #include "debug.h" | 45 | #include "debug.h" |
46 | #include "led.h" | 46 | #include "led.h" |
47 | #include "sound.h" | ||
47 | #ifdef HAVE_MMC | 48 | #ifdef HAVE_MMC |
48 | #include "ata_mmc.h" | 49 | #include "ata_mmc.h" |
49 | #endif | 50 | #endif |
@@ -437,7 +438,7 @@ int pitch_screen(void) | |||
437 | pitch++; | 438 | pitch++; |
438 | if ( pitch > 2000 ) | 439 | if ( pitch > 2000 ) |
439 | pitch = 2000; | 440 | pitch = 2000; |
440 | mpeg_set_pitch(pitch); | 441 | sound_set_pitch(pitch); |
441 | break; | 442 | break; |
442 | 443 | ||
443 | case BUTTON_DOWN: | 444 | case BUTTON_DOWN: |
@@ -447,7 +448,7 @@ int pitch_screen(void) | |||
447 | pitch--; | 448 | pitch--; |
448 | if ( pitch < 500 ) | 449 | if ( pitch < 500 ) |
449 | pitch = 500; | 450 | pitch = 500; |
450 | mpeg_set_pitch(pitch); | 451 | sound_set_pitch(pitch); |
451 | break; | 452 | break; |
452 | 453 | ||
453 | case BUTTON_ON | BUTTON_PLAY: | 454 | case BUTTON_ON | BUTTON_PLAY: |
@@ -468,28 +469,28 @@ int pitch_screen(void) | |||
468 | case BUTTON_ON | BUTTON_RIGHT: | 469 | case BUTTON_ON | BUTTON_RIGHT: |
469 | if ( pitch < 2000 ) { | 470 | if ( pitch < 2000 ) { |
470 | pitch += 20; | 471 | pitch += 20; |
471 | mpeg_set_pitch(pitch); | 472 | sound_set_pitch(pitch); |
472 | } | 473 | } |
473 | break; | 474 | break; |
474 | 475 | ||
475 | case BUTTON_RIGHT | BUTTON_REL: | 476 | case BUTTON_RIGHT | BUTTON_REL: |
476 | if ( pitch > 500 ) { | 477 | if ( pitch > 500 ) { |
477 | pitch -= 20; | 478 | pitch -= 20; |
478 | mpeg_set_pitch(pitch); | 479 | sound_set_pitch(pitch); |
479 | } | 480 | } |
480 | break; | 481 | break; |
481 | 482 | ||
482 | case BUTTON_ON | BUTTON_LEFT: | 483 | case BUTTON_ON | BUTTON_LEFT: |
483 | if ( pitch > 500 ) { | 484 | if ( pitch > 500 ) { |
484 | pitch -= 20; | 485 | pitch -= 20; |
485 | mpeg_set_pitch(pitch); | 486 | sound_set_pitch(pitch); |
486 | } | 487 | } |
487 | break; | 488 | break; |
488 | 489 | ||
489 | case BUTTON_LEFT | BUTTON_REL: | 490 | case BUTTON_LEFT | BUTTON_REL: |
490 | if ( pitch < 2000 ) { | 491 | if ( pitch < 2000 ) { |
491 | pitch += 20; | 492 | pitch += 20; |
492 | mpeg_set_pitch(pitch); | 493 | sound_set_pitch(pitch); |
493 | } | 494 | } |
494 | break; | 495 | break; |
495 | 496 | ||
diff --git a/apps/settings.c b/apps/settings.c index 8ff9c7b0b0..df03bdcfcf 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -64,6 +64,7 @@ | |||
64 | #include "keyboard.h" | 64 | #include "keyboard.h" |
65 | #include "version.h" | 65 | #include "version.h" |
66 | #include "rtc.h" | 66 | #include "rtc.h" |
67 | #include "sound.h" | ||
67 | #if CONFIG_HWCODEC == MAS3507D | 68 | #if CONFIG_HWCODEC == MAS3507D |
68 | void dac_line_in(bool enable); | 69 | void dac_line_in(bool enable); |
69 | #endif | 70 | #endif |
@@ -719,21 +720,21 @@ void settings_apply_pm_range(void) | |||
719 | 720 | ||
720 | void sound_settings_apply(void) | 721 | void sound_settings_apply(void) |
721 | { | 722 | { |
722 | mpeg_sound_set(SOUND_BASS, global_settings.bass); | 723 | sound_set(SOUND_BASS, global_settings.bass); |
723 | mpeg_sound_set(SOUND_TREBLE, global_settings.treble); | 724 | sound_set(SOUND_TREBLE, global_settings.treble); |
724 | mpeg_sound_set(SOUND_BALANCE, global_settings.balance); | 725 | sound_set(SOUND_BALANCE, global_settings.balance); |
725 | mpeg_sound_set(SOUND_VOLUME, global_settings.volume); | 726 | sound_set(SOUND_VOLUME, global_settings.volume); |
726 | mpeg_sound_set(SOUND_CHANNELS, global_settings.channel_config); | 727 | sound_set(SOUND_CHANNELS, global_settings.channel_config); |
727 | mpeg_sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); | 728 | sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); |
728 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 729 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) |
729 | mpeg_sound_set(SOUND_LOUDNESS, global_settings.loudness); | 730 | sound_set(SOUND_LOUDNESS, global_settings.loudness); |
730 | mpeg_sound_set(SOUND_AVC, global_settings.avc); | 731 | sound_set(SOUND_AVC, global_settings.avc); |
731 | mpeg_sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength); | 732 | sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength); |
732 | mpeg_sound_set(SOUND_MDB_HARMONICS, global_settings.mdb_harmonics); | 733 | sound_set(SOUND_MDB_HARMONICS, global_settings.mdb_harmonics); |
733 | mpeg_sound_set(SOUND_MDB_CENTER, global_settings.mdb_center); | 734 | sound_set(SOUND_MDB_CENTER, global_settings.mdb_center); |
734 | mpeg_sound_set(SOUND_MDB_SHAPE, global_settings.mdb_shape); | 735 | sound_set(SOUND_MDB_SHAPE, global_settings.mdb_shape); |
735 | mpeg_sound_set(SOUND_MDB_ENABLE, global_settings.mdb_enable); | 736 | sound_set(SOUND_MDB_ENABLE, global_settings.mdb_enable); |
736 | mpeg_sound_set(SOUND_SUPERBASS, global_settings.superbass); | 737 | sound_set(SOUND_SUPERBASS, global_settings.superbass); |
737 | #endif | 738 | #endif |
738 | } | 739 | } |
739 | 740 | ||
@@ -1261,20 +1262,20 @@ void settings_reset(void) { | |||
1261 | default_table(hd_bits, sizeof(hd_bits)/sizeof(hd_bits[0])); | 1262 | default_table(hd_bits, sizeof(hd_bits)/sizeof(hd_bits[0])); |
1262 | 1263 | ||
1263 | /* do some special cases not covered by table */ | 1264 | /* do some special cases not covered by table */ |
1264 | global_settings.volume = mpeg_sound_default(SOUND_VOLUME); | 1265 | global_settings.volume = sound_default(SOUND_VOLUME); |
1265 | global_settings.balance = mpeg_sound_default(SOUND_BALANCE); | 1266 | global_settings.balance = sound_default(SOUND_BALANCE); |
1266 | global_settings.bass = mpeg_sound_default(SOUND_BASS); | 1267 | global_settings.bass = sound_default(SOUND_BASS); |
1267 | global_settings.treble = mpeg_sound_default(SOUND_TREBLE); | 1268 | global_settings.treble = sound_default(SOUND_TREBLE); |
1268 | global_settings.loudness = mpeg_sound_default(SOUND_LOUDNESS); | 1269 | global_settings.loudness = sound_default(SOUND_LOUDNESS); |
1269 | global_settings.avc = mpeg_sound_default(SOUND_AVC); | 1270 | global_settings.avc = sound_default(SOUND_AVC); |
1270 | global_settings.channel_config = mpeg_sound_default(SOUND_CHANNELS); | 1271 | global_settings.channel_config = sound_default(SOUND_CHANNELS); |
1271 | global_settings.stereo_width = mpeg_sound_default(SOUND_STEREO_WIDTH); | 1272 | global_settings.stereo_width = sound_default(SOUND_STEREO_WIDTH); |
1272 | global_settings.mdb_strength = mpeg_sound_default(SOUND_MDB_STRENGTH); | 1273 | global_settings.mdb_strength = sound_default(SOUND_MDB_STRENGTH); |
1273 | global_settings.mdb_harmonics = mpeg_sound_default(SOUND_MDB_HARMONICS); | 1274 | global_settings.mdb_harmonics = sound_default(SOUND_MDB_HARMONICS); |
1274 | global_settings.mdb_center = mpeg_sound_default(SOUND_MDB_CENTER); | 1275 | global_settings.mdb_center = sound_default(SOUND_MDB_CENTER); |
1275 | global_settings.mdb_shape = mpeg_sound_default(SOUND_MDB_SHAPE); | 1276 | global_settings.mdb_shape = sound_default(SOUND_MDB_SHAPE); |
1276 | global_settings.mdb_enable = mpeg_sound_default(SOUND_MDB_ENABLE); | 1277 | global_settings.mdb_enable = sound_default(SOUND_MDB_ENABLE); |
1277 | global_settings.superbass = mpeg_sound_default(SOUND_SUPERBASS); | 1278 | global_settings.superbass = sound_default(SOUND_SUPERBASS); |
1278 | global_settings.contrast = lcd_default_contrast(); | 1279 | global_settings.contrast = lcd_default_contrast(); |
1279 | global_settings.wps_file[0] = '\0'; | 1280 | global_settings.wps_file[0] = '\0'; |
1280 | global_settings.font_file[0] = '\0'; | 1281 | global_settings.font_file[0] = '\0'; |
diff --git a/apps/sound_menu.c b/apps/sound_menu.c index f08ee35525..560163c7c1 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "sprintf.h" | 34 | #include "sprintf.h" |
35 | #include "talk.h" | 35 | #include "talk.h" |
36 | #include "misc.h" | 36 | #include "misc.h" |
37 | #include "sound.h" | ||
37 | 38 | ||
38 | static const char* const fmt[] = | 39 | static const char* const fmt[] = |
39 | { | 40 | { |
@@ -59,11 +60,11 @@ bool set_sound(const char* string, | |||
59 | int steps; | 60 | int steps; |
60 | int button; | 61 | int button; |
61 | 62 | ||
62 | unit = mpeg_sound_unit(setting); | 63 | unit = sound_unit(setting); |
63 | numdec = mpeg_sound_numdecimals(setting); | 64 | numdec = sound_numdecimals(setting); |
64 | steps = mpeg_sound_steps(setting); | 65 | steps = sound_steps(setting); |
65 | min = mpeg_sound_min(setting); | 66 | min = sound_min(setting); |
66 | max = mpeg_sound_max(setting); | 67 | max = sound_max(setting); |
67 | if (*unit == 'd') /* crude reconstruction */ | 68 | if (*unit == 'd') /* crude reconstruction */ |
68 | talkunit = UNIT_DB; | 69 | talkunit = UNIT_DB; |
69 | else if (*unit == '%') | 70 | else if (*unit == '%') |
@@ -82,7 +83,7 @@ bool set_sound(const char* string, | |||
82 | 83 | ||
83 | while (!done) { | 84 | while (!done) { |
84 | if (changed) { | 85 | if (changed) { |
85 | val = mpeg_val2phys(setting, *variable); | 86 | val = sound_val2phys(setting, *variable); |
86 | if(numdec) | 87 | if(numdec) |
87 | { | 88 | { |
88 | integer = val / (10 * numdec); | 89 | integer = val / (10 * numdec); |
@@ -136,7 +137,7 @@ bool set_sound(const char* string, | |||
136 | break; | 137 | break; |
137 | } | 138 | } |
138 | if (changed) | 139 | if (changed) |
139 | mpeg_sound_set(setting, *variable); | 140 | sound_set(setting, *variable); |
140 | } | 141 | } |
141 | lcd_stop_scroll(); | 142 | lcd_stop_scroll(); |
142 | return false; | 143 | return false; |
@@ -196,7 +197,7 @@ static bool mdb_shape(void) | |||
196 | 197 | ||
197 | static void set_mdb_enable(bool value) | 198 | static void set_mdb_enable(bool value) |
198 | { | 199 | { |
199 | mpeg_sound_set(SOUND_MDB_ENABLE, (int)value); | 200 | sound_set(SOUND_MDB_ENABLE, (int)value); |
200 | } | 201 | } |
201 | 202 | ||
202 | static bool mdb_enable(void) | 203 | static bool mdb_enable(void) |
@@ -210,7 +211,7 @@ static bool mdb_enable(void) | |||
210 | 211 | ||
211 | static void set_superbass(bool value) | 212 | static void set_superbass(bool value) |
212 | { | 213 | { |
213 | mpeg_sound_set(SOUND_SUPERBASS, (int)value); | 214 | sound_set(SOUND_SUPERBASS, (int)value); |
214 | } | 215 | } |
215 | 216 | ||
216 | static bool superbass(void) | 217 | static bool superbass(void) |
@@ -224,7 +225,7 @@ static bool superbass(void) | |||
224 | 225 | ||
225 | static void set_avc(int val) | 226 | static void set_avc(int val) |
226 | { | 227 | { |
227 | mpeg_sound_set(SOUND_AVC, val); | 228 | sound_set(SOUND_AVC, val); |
228 | } | 229 | } |
229 | 230 | ||
230 | static bool avc(void) | 231 | static bool avc(void) |
@@ -379,7 +380,7 @@ static bool reconstartup(void) | |||
379 | 380 | ||
380 | static void set_chanconf(int val) | 381 | static void set_chanconf(int val) |
381 | { | 382 | { |
382 | mpeg_sound_set(SOUND_CHANNELS, val); | 383 | sound_set(SOUND_CHANNELS, val); |
383 | } | 384 | } |
384 | 385 | ||
385 | static bool chanconf(void) | 386 | static bool chanconf(void) |
diff --git a/apps/status.c b/apps/status.c index 562cd50964..d4736f3773 100644 --- a/apps/status.c +++ b/apps/status.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #endif | 36 | #endif |
37 | #include "powermgmt.h" | 37 | #include "powermgmt.h" |
38 | #include "led.h" | 38 | #include "led.h" |
39 | #include "sound.h" | ||
39 | 40 | ||
40 | static enum playmode ff_mode; | 41 | static enum playmode ff_mode; |
41 | 42 | ||
@@ -146,7 +147,7 @@ void status_draw(bool force_redraw) | |||
146 | (void)force_redraw; /* players always "redraw" */ | 147 | (void)force_redraw; /* players always "redraw" */ |
147 | #endif | 148 | #endif |
148 | 149 | ||
149 | info.volume = mpeg_val2phys(SOUND_VOLUME, global_settings.volume); | 150 | info.volume = sound_val2phys(SOUND_VOLUME, global_settings.volume); |
150 | info.inserted = charger_inserted(); | 151 | info.inserted = charger_inserted(); |
151 | info.battlevel = battery_level(); | 152 | info.battlevel = battery_level(); |
152 | info.battery_safe = battery_level_safe(); | 153 | info.battery_safe = battery_level_safe(); |
diff --git a/apps/wps.c b/apps/wps.c index 91969df00e..d5f921c350 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include "lang.h" | 49 | #include "lang.h" |
50 | #include "bookmark.h" | 50 | #include "bookmark.h" |
51 | #include "misc.h" | 51 | #include "misc.h" |
52 | #include "sound.h" | ||
52 | 53 | ||
53 | #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ | 54 | #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ |
54 | /* 3% of 30min file == 54s step size */ | 55 | /* 3% of 30min file == 54s step size */ |
@@ -172,17 +173,17 @@ static char current_track_path[MAX_PATH+1]; | |||
172 | */ | 173 | */ |
173 | static bool setvol(void) | 174 | static bool setvol(void) |
174 | { | 175 | { |
175 | if (global_settings.volume < mpeg_sound_min(SOUND_VOLUME)) | 176 | if (global_settings.volume < sound_min(SOUND_VOLUME)) |
176 | global_settings.volume = mpeg_sound_min(SOUND_VOLUME); | 177 | global_settings.volume = sound_min(SOUND_VOLUME); |
177 | if (global_settings.volume > mpeg_sound_max(SOUND_VOLUME)) | 178 | if (global_settings.volume > sound_max(SOUND_VOLUME)) |
178 | global_settings.volume = mpeg_sound_max(SOUND_VOLUME); | 179 | global_settings.volume = sound_max(SOUND_VOLUME); |
179 | mpeg_sound_set(SOUND_VOLUME, global_settings.volume); | 180 | sound_set(SOUND_VOLUME, global_settings.volume); |
180 | status_draw(false); | 181 | status_draw(false); |
181 | wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC); | 182 | wps_refresh(id3, nid3, 0, WPS_REFRESH_NON_STATIC); |
182 | settings_save(); | 183 | settings_save(); |
183 | #ifdef HAVE_LCD_CHARCELLS | 184 | #ifdef HAVE_LCD_CHARCELLS |
184 | splash(0, false, "Vol: %d %% ", | 185 | splash(0, false, "Vol: %d %% ", |
185 | mpeg_val2phys(SOUND_VOLUME, global_settings.volume)); | 186 | sound_val2phys(SOUND_VOLUME, global_settings.volume)); |
186 | return true; | 187 | return true; |
187 | #endif | 188 | #endif |
188 | return false; | 189 | return false; |
@@ -388,7 +389,7 @@ static void fade(bool fade_in) | |||
388 | int current_volume = 20; | 389 | int current_volume = 20; |
389 | 390 | ||
390 | /* zero out the sound */ | 391 | /* zero out the sound */ |
391 | mpeg_sound_set(SOUND_VOLUME, current_volume); | 392 | sound_set(SOUND_VOLUME, current_volume); |
392 | 393 | ||
393 | sleep(HZ/10); /* let mpeg thread run */ | 394 | sleep(HZ/10); /* let mpeg thread run */ |
394 | mpeg_resume(); | 395 | mpeg_resume(); |
@@ -396,9 +397,9 @@ static void fade(bool fade_in) | |||
396 | while (current_volume < global_settings.volume) { | 397 | while (current_volume < global_settings.volume) { |
397 | current_volume += 2; | 398 | current_volume += 2; |
398 | sleep(1); | 399 | sleep(1); |
399 | mpeg_sound_set(SOUND_VOLUME, current_volume); | 400 | sound_set(SOUND_VOLUME, current_volume); |
400 | } | 401 | } |
401 | mpeg_sound_set(SOUND_VOLUME, global_settings.volume); | 402 | sound_set(SOUND_VOLUME, global_settings.volume); |
402 | } | 403 | } |
403 | else { | 404 | else { |
404 | /* fade out */ | 405 | /* fade out */ |
@@ -407,13 +408,13 @@ static void fade(bool fade_in) | |||
407 | while (current_volume > 20) { | 408 | while (current_volume > 20) { |
408 | current_volume -= 2; | 409 | current_volume -= 2; |
409 | sleep(1); | 410 | sleep(1); |
410 | mpeg_sound_set(SOUND_VOLUME, current_volume); | 411 | sound_set(SOUND_VOLUME, current_volume); |
411 | } | 412 | } |
412 | mpeg_pause(); | 413 | mpeg_pause(); |
413 | sleep(HZ/5); /* let mpeg thread run */ | 414 | sleep(HZ/5); /* let mpeg thread run */ |
414 | 415 | ||
415 | /* reset volume to what it was before the fade */ | 416 | /* reset volume to what it was before the fade */ |
416 | mpeg_sound_set(SOUND_VOLUME, global_settings.volume); | 417 | sound_set(SOUND_VOLUME, global_settings.volume); |
417 | } | 418 | } |
418 | } | 419 | } |
419 | 420 | ||