From 1fcd31d3ff0e8f2acf2351252b836239cc78a670 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Fri, 14 Feb 2003 02:48:12 +0000 Subject: Fixed the 3-hour time display bug, plus some cosmetic changes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3253 a1c6a512-1295-4272-9138-f99709370657 --- apps/lang/english.lang | 10 ++++++++++ apps/recorder/recording.c | 31 ++++++++----------------------- 2 files changed, 18 insertions(+), 23 deletions(-) (limited to 'apps') diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 7ab205f9f7..c1541cf947 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -1366,3 +1366,13 @@ id: LANG_ID3_NO_INFO desc: ID3 info is missing eng: "" new: + +id: LANG_RECORDING_TIME +desc: Display of recorded time +eng: "Time:" +new: + +id: LANG_RECORDING_SIZE +desc: Display of recorded file size +eng: "Size:" +new: diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index e301cd322e..0e78b2c66b 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -125,16 +125,6 @@ void adjust_cursor(void) } } -unsigned int frame_times[] = -{ - 2612, /* 44.1kHz */ - 2400, /* 48kHz */ - 3600, /* 32kHz */ - 2612, /* 22.05kHz */ - 2400, /* 24kHz */ - 3200 /* 16kHz */ -}; - static char *create_filename(void) { static char fname[32]; @@ -165,7 +155,6 @@ bool recording_screen(void) unsigned long seconds; unsigned long last_seconds = 0; int hours, minutes; - unsigned long val; cursor = 0; mpeg_init_recording(); @@ -349,9 +338,7 @@ bool recording_screen(void) { timeout = current_tick + HZ/10; - seconds = mpeg_num_recorded_frames(); - seconds *= frame_times[global_settings.rec_frequency]; - seconds /= 100000; + seconds = mpeg_recorded_time() / HZ; update_countdown--; if(update_countdown == 0 || seconds > last_seconds) @@ -361,19 +348,17 @@ bool recording_screen(void) lcd_clear_display(); - /* DEBUG: Read the current frame */ - mas_readmem(MAS_BANK_D0, 0xfd0, &val, 1); - - snprintf(buf, 32, "%05x:%05x:%05x", - mpeg_num_recorded_frames(), val, record_start_frame); - lcd_puts(0, 0, buf); - hours = seconds / 3600; minutes = (seconds - (hours * 3600)) / 60; - snprintf(buf, 32, "%02d:%02d:%02d %s", - hours, minutes, seconds%60, + snprintf(buf, 32, "%s %02d:%02d:%02d", + str(LANG_RECORDING_TIME), + hours, minutes, seconds%60); + lcd_puts(0, 0, buf); + + snprintf(buf, 32, "%s %s", str(LANG_RECORDING_SIZE), num2max5(mpeg_num_recorded_bytes(), buf2)); lcd_puts(0, 1, buf); + peak_meter_draw(0, 8 + h*2, LCD_WIDTH, h); /* Show mic gain if input source is Mic */ -- cgit v1.2.3