From 22e7e940a759188080cf33d5afb699ada0b107fc Mon Sep 17 00:00:00 2001 From: Martin Scarratt Date: Wed, 27 Sep 2006 21:36:50 +0000 Subject: Oops, didnt mean to commit this git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11081 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/recording.c | 31 ++++++++++--------------------- apps/settings.c | 28 ---------------------------- apps/settings.h | 5 +---- apps/sound_menu.c | 6 +----- 4 files changed, 12 insertions(+), 58 deletions(-) (limited to 'apps') diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index fd9ea34be5..c51569ad31 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -491,8 +491,12 @@ void adjust_cursor(void) char *rec_create_filename(char *buffer) { - strncpy(buffer, global_settings.rec_path, MAX_PATH); - + if(global_settings.rec_directory) + getcwd(buffer, MAX_PATH); + else + strncpy(buffer, rec_base_directory, MAX_PATH); + + #ifdef CONFIG_RTC create_datetime_filename(buffer, buffer, "R", REC_FILE_ENDING(global_settings.rec_quality)); @@ -506,16 +510,7 @@ 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) { @@ -833,10 +828,6 @@ 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 @@ -1729,12 +1720,10 @@ 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, filename_offset[0] + - PM_HEIGHT + line[0]); + peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); for(i = 0; i < screen_update; i++){ - screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), - filename_offset[0] + PM_HEIGHT + - line[0], + 2, TRIG_HEIGHT); + screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h, + TRIG_WIDTH + 2, TRIG_HEIGHT); } } } diff --git a/apps/settings.c b/apps/settings.c index 87d0724b48..ee7fa36d39 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -74,7 +74,6 @@ #ifdef HAVE_LCD_COLOR #include "backdrop.h" #endif -#include "tree.h" #ifdef CONFIG_TUNER #include "radio.h" @@ -1014,11 +1013,6 @@ int settings_save( void ) 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()) { @@ -1415,11 +1409,6 @@ void settings_load(int which) strncpy((char *)global_settings.kbd_file, (char *)&config_block[i], 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 } } @@ -1780,11 +1769,6 @@ bool settings_save_config(void) 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); @@ -1878,9 +1862,6 @@ void settings_reset(void) { #endif #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; } @@ -2167,12 +2148,3 @@ void settings_apply_trigger(void) ); } #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 diff --git a/apps/settings.h b/apps/settings.h index 59de1642e7..3e0b8fcd11 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -242,9 +242,7 @@ struct user_settings 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 */ @@ -534,7 +532,6 @@ void set_file(char* filename, char* setting, int maxlen); 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; diff --git a/apps/sound_menu.c b/apps/sound_menu.c index da779d9a30..e80c2c0a3b 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c @@ -520,17 +520,13 @@ static bool recprerecord(void) static bool recdirectory(void) { - bool ret; static const struct opt_items names[] = { { rec_base_directory, -1 }, { STR(LANG_RECORD_CURRENT_DIR) } }; - ret = set_option(str(LANG_RECORD_DIRECTORY), + return set_option(str(LANG_RECORD_DIRECTORY), &global_settings.rec_directory, INT, names, 2, NULL ); - set_recpath(); - - return ret; } static bool reconstartup(void) -- cgit v1.2.3