summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/radio.c20
-rw-r--r--apps/recorder/recording.c41
2 files changed, 31 insertions, 30 deletions
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();