summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Scarratt <mmmm@rockbox.org>2006-09-27 21:36:50 +0000
committerMartin Scarratt <mmmm@rockbox.org>2006-09-27 21:36:50 +0000
commit22e7e940a759188080cf33d5afb699ada0b107fc (patch)
tree15902e51017a2af5f0c504cf778194bb92fde1dc
parentc06eadb572a7314fb42f59c33060c6b148fdef8a (diff)
downloadrockbox-22e7e940a759188080cf33d5afb699ada0b107fc.zip
rockbox-22e7e940a759188080cf33d5afb699ada0b107fc.tar.gz
rockbox-22e7e940a759188080cf33d5afb699ada0b107fc.tar.bz2
rockbox-22e7e940a759188080cf33d5afb699ada0b107fc.tar.xz
Oops, didnt mean to commit this
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11081 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/recorder/recording.c31
-rw-r--r--apps/settings.c28
-rw-r--r--apps/settings.h5
-rw-r--r--apps/sound_menu.c6
4 files changed, 12 insertions, 58 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index fd9ea34..c51569a 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 87d0724..ee7fa36 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())
{
@@ -1416,11 +1410,6 @@ void settings_load(int which)
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);
@@ -1879,9 +1863,6 @@ void settings_reset(void) {
#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 59de164..3e0b8fc 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 da779d9..e80c2c0 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)