diff options
author | Martin Scarratt <mmmm@rockbox.org> | 2006-09-27 21:28:47 +0000 |
---|---|---|
committer | Martin Scarratt <mmmm@rockbox.org> | 2006-09-27 21:28:47 +0000 |
commit | c06eadb572a7314fb42f59c33060c6b148fdef8a (patch) | |
tree | 2a8d10488700814a26f198724a21d5c26ff756ce /apps/recorder | |
parent | 84cbab18da4b986e8bd3427cc9d3a5e9296fd4a5 (diff) | |
download | rockbox-c06eadb572a7314fb42f59c33060c6b148fdef8a.tar.gz rockbox-c06eadb572a7314fb42f59c33060c6b148fdef8a.zip |
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
Diffstat (limited to 'apps/recorder')
-rw-r--r-- | apps/recorder/recording.c | 34 |
1 files changed, 23 insertions, 11 deletions
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) | |||
491 | 491 | ||
492 | char *rec_create_filename(char *buffer) | 492 | char *rec_create_filename(char *buffer) |
493 | { | 493 | { |
494 | if(global_settings.rec_directory) | 494 | strncpy(buffer, global_settings.rec_path, MAX_PATH); |
495 | getcwd(buffer, MAX_PATH); | 495 | |
496 | else | ||
497 | strncpy(buffer, rec_base_directory, MAX_PATH); | ||
498 | |||
499 | |||
500 | #ifdef CONFIG_RTC | 496 | #ifdef CONFIG_RTC |
501 | create_datetime_filename(buffer, buffer, "R", | 497 | create_datetime_filename(buffer, buffer, "R", |
502 | REC_FILE_ENDING(global_settings.rec_quality)); | 498 | REC_FILE_ENDING(global_settings.rec_quality)); |
@@ -510,7 +506,16 @@ char *rec_create_filename(char *buffer) | |||
510 | int rec_create_directory(void) | 506 | int rec_create_directory(void) |
511 | { | 507 | { |
512 | int rc; | 508 | int rc; |
513 | 509 | DIR* dir; | |
510 | |||
511 | dir = opendir(global_settings.rec_path); | ||
512 | if (dir == NULL) | ||
513 | { | ||
514 | strncpy(global_settings.rec_path, rec_base_directory, MAX_PATH); | ||
515 | global_settings.rec_directory = false; | ||
516 | } | ||
517 | else | ||
518 | closedir(dir); | ||
514 | /* Try to create the base directory if needed */ | 519 | /* Try to create the base directory if needed */ |
515 | if(global_settings.rec_directory == 0) | 520 | if(global_settings.rec_directory == 0) |
516 | { | 521 | { |
@@ -828,6 +833,10 @@ bool recording_screen(bool no_source) | |||
828 | 833 | ||
829 | global_settings.recscreen_on = true; | 834 | global_settings.recscreen_on = true; |
830 | cursor = 0; | 835 | cursor = 0; |
836 | |||
837 | if (strlen(global_settings.rec_path) == 0) | ||
838 | strncpy(global_settings.rec_path, rec_base_directory, MAX_PATH); | ||
839 | |||
831 | #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) | 840 | #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) |
832 | ata_set_led_enabled(false); | 841 | ata_set_led_enabled(false); |
833 | #endif | 842 | #endif |
@@ -1259,7 +1268,8 @@ bool recording_screen(bool no_source) | |||
1259 | global_settings.rec_editable, | 1268 | global_settings.rec_editable, |
1260 | global_settings.rec_prerecord_time); | 1269 | global_settings.rec_prerecord_time); |
1261 | 1270 | ||
1262 | rec_create_directory(); | 1271 | if(rec_create_directory() > 0) |
1272 | have_recorded = true; | ||
1263 | #ifdef HAVE_AGC | 1273 | #ifdef HAVE_AGC |
1264 | if (global_settings.rec_source == AUDIO_SRC_MIC) { | 1274 | if (global_settings.rec_source == AUDIO_SRC_MIC) { |
1265 | agc_preset = global_settings.rec_agc_preset_mic; | 1275 | agc_preset = global_settings.rec_agc_preset_mic; |
@@ -1719,10 +1729,12 @@ bool recording_screen(bool no_source) | |||
1719 | /* draw the trigger status */ | 1729 | /* draw the trigger status */ |
1720 | if (peak_meter_trigger_status() != TRIG_OFF) | 1730 | if (peak_meter_trigger_status() != TRIG_OFF) |
1721 | { | 1731 | { |
1722 | peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); | 1732 | peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, filename_offset[0] + |
1733 | PM_HEIGHT + line[0]); | ||
1723 | for(i = 0; i < screen_update; i++){ | 1734 | for(i = 0; i < screen_update; i++){ |
1724 | screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h, | 1735 | screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), |
1725 | TRIG_WIDTH + 2, TRIG_HEIGHT); | 1736 | filename_offset[0] + PM_HEIGHT + |
1737 | line[0], + 2, TRIG_HEIGHT); | ||
1726 | } | 1738 | } |
1727 | } | 1739 | } |
1728 | } | 1740 | } |