Index: apps/settings.c =================================================================== RCS file: /cvsroot/rockbox/apps/settings.c,v retrieving revision 1.418 diff -u -r1.418 settings.c --- apps/settings.c 18 Sep 2006 12:41:12 -0000 1.418 +++ apps/settings.c 27 Sep 2006 09:04:19 -0000 @@ -74,6 +74,7 @@ #ifdef HAVE_LCD_COLOR #include "backdrop.h" #endif +#include "tree.h" #ifdef CONFIG_TUNER #include "radio.h" @@ -1006,6 +1007,11 @@ MAX_FILENAME); i+= MAX_FILENAME; #endif +#ifdef HAVE_RECORDING + strncpy((char *)&config_block[i], (char *)global_settings.rec_path, + MAX_PATH); + i+= MAX_PATH; +#endif if(save_config_buffer()) { @@ -1396,6 +1402,11 @@ MAX_FILENAME); i+= MAX_FILENAME; #endif +#ifdef HAVE_RECORDING + strncpy((char *)global_settings.rec_path, (char *)&config_block[i], + MAX_PATH); + i+= MAX_PATH; +#endif } } @@ -1587,6 +1598,7 @@ #endif + /* check for scalar values, using the two tables */ pos = load_cfg_table(table[last_table], ta_size[last_table], name, value, last_pos); @@ -1755,6 +1767,11 @@ global_settings.kbd_file); #endif +#ifdef HAVE_RECORDING + if (global_settings.rec_path[0] != 0) + fdprintf(fd, "recording path: %s\r\n", global_settings.rec_path); +#endif + /* here's the action: write values to file, specified via table */ save_cfg_table(rtc_bits, sizeof(rtc_bits)/sizeof(rtc_bits[0]), fd); save_cfg_table(hd_bits, sizeof(hd_bits)/sizeof(hd_bits[0]), fd); @@ -1849,6 +1866,9 @@ #ifdef HAVE_LCD_BITMAP global_settings.kbd_file[0] = '\0'; #endif +#ifdef HAVE_RECORDING + global_settings.rec_path[0] = '\0'; +#endif global_settings.hold_lr_for_scroll_in_list = true; } @@ -2134,3 +2154,12 @@ ); } #endif +#ifdef HAVE_RECORDING +void set_recpath(void) +{ + if(global_settings.rec_directory) + getcwd(global_settings.rec_path, MAX_PATH); + else + strncpy(global_settings.rec_path, rec_base_directory, MAX_PATH); +} +#endif Index: apps/settings.h =================================================================== RCS file: /cvsroot/rockbox/apps/settings.h,v retrieving revision 1.240 diff -u -r1.240 settings.h --- apps/settings.h 18 Sep 2006 12:41:12 -0000 1.240 +++ apps/settings.h 27 Sep 2006 09:04:19 -0000 @@ -243,7 +243,9 @@ unsigned char font_file[MAX_FILENAME+1]; /* last font */ unsigned char wps_file[MAX_FILENAME+1]; /* last wps */ unsigned char lang_file[MAX_FILENAME+1]; /* last language */ - +#ifdef HAVE_RECORDING + unsigned char rec_path[MAX_PATH+1]; /* path for recorded files */ +#endif /* misc options */ int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */ @@ -527,6 +529,7 @@ unsigned int rec_timesplit_seconds(void); unsigned long rec_sizesplit_bytes(void); void settings_apply_trigger(void); +void set_recpath(void); /* global settings */ extern struct user_settings global_settings; Index: apps/sound_menu.c =================================================================== RCS file: /cvsroot/rockbox/apps/sound_menu.c,v retrieving revision 1.115 diff -u -r1.115 sound_menu.c --- apps/sound_menu.c 23 Sep 2006 15:23:12 -0000 1.115 +++ apps/sound_menu.c 27 Sep 2006 09:04:20 -0000 @@ -520,13 +520,17 @@ static bool recdirectory(void) { + bool ret; static const struct opt_items names[] = { { rec_base_directory, -1 }, { STR(LANG_RECORD_CURRENT_DIR) } }; - return set_option(str(LANG_RECORD_DIRECTORY), + ret = set_option(str(LANG_RECORD_DIRECTORY), &global_settings.rec_directory, INT, names, 2, NULL ); + set_recpath(); + + return ret; } static bool reconstartup(void) Index: apps/recorder/recording.c =================================================================== RCS file: /cvsroot/rockbox/apps/recorder/recording.c,v retrieving revision 1.139 diff -u -r1.139 recording.c --- apps/recorder/recording.c 20 Sep 2006 09:59:39 -0000 1.139 +++ apps/recorder/recording.c 27 Sep 2006 09:04:25 -0000 @@ -491,12 +491,8 @@ 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)); @@ -828,6 +824,10 @@ 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