From c06eadb572a7314fb42f59c33060c6b148fdef8a Mon Sep 17 00:00:00 2001 From: Martin Scarratt Date: Wed, 27 Sep 2006 21:28:47 +0000 Subject: If a directory is created in the recording screen, the dir browser needs refreshing git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11080 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/recording.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'apps/recorder/recording.c') diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index e98730b582..fd9ea34be5 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -491,12 +491,8 @@ void adjust_cursor(void) char *rec_create_filename(char *buffer) { - if(global_settings.rec_directory) - getcwd(buffer, MAX_PATH); - else - strncpy(buffer, rec_base_directory, MAX_PATH); - - + strncpy(buffer, global_settings.rec_path, MAX_PATH); + #ifdef CONFIG_RTC create_datetime_filename(buffer, buffer, "R", REC_FILE_ENDING(global_settings.rec_quality)); @@ -510,7 +506,16 @@ char *rec_create_filename(char *buffer) int rec_create_directory(void) { int rc; - + DIR* dir; + + dir = opendir(global_settings.rec_path); + if (dir == NULL) + { + strncpy(global_settings.rec_path, rec_base_directory, MAX_PATH); + global_settings.rec_directory = false; + } + else + closedir(dir); /* Try to create the base directory if needed */ if(global_settings.rec_directory == 0) { @@ -828,6 +833,10 @@ bool recording_screen(bool no_source) global_settings.recscreen_on = true; cursor = 0; + + if (strlen(global_settings.rec_path) == 0) + strncpy(global_settings.rec_path, rec_base_directory, MAX_PATH); + #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) ata_set_led_enabled(false); #endif @@ -1259,7 +1268,8 @@ bool recording_screen(bool no_source) global_settings.rec_editable, global_settings.rec_prerecord_time); - rec_create_directory(); + if(rec_create_directory() > 0) + have_recorded = true; #ifdef HAVE_AGC if (global_settings.rec_source == AUDIO_SRC_MIC) { agc_preset = global_settings.rec_agc_preset_mic; @@ -1719,10 +1729,12 @@ bool recording_screen(bool no_source) /* draw the trigger status */ if (peak_meter_trigger_status() != TRIG_OFF) { - peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); + peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, filename_offset[0] + + PM_HEIGHT + line[0]); for(i = 0; i < screen_update; i++){ - screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h, - TRIG_WIDTH + 2, TRIG_HEIGHT); + screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), + filename_offset[0] + PM_HEIGHT + + line[0], + 2, TRIG_HEIGHT); } } } -- cgit v1.2.3