From eb1dd38960214cb5581b9d39ef4fe73e2a050090 Mon Sep 17 00:00:00 2001 From: Dan Everton Date: Tue, 15 Aug 2006 09:38:13 +0000 Subject: Add support for displaying the the current path or the full path (or neither) in the file browser. Check General Settings -> File View -> Show Path for the options. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10578 a1c6a512-1295-4272-9138-f99709370657 --- apps/lang/english.lang | 42 ++++++++++++++++++++++++++++++++++++++++++ apps/settings.c | 2 ++ apps/settings.h | 5 +++++ apps/settings_menu.c | 14 ++++++++++++++ apps/tree.c | 5 +++++ firmware/drivers/wm8758.c | 10 +++++----- firmware/export/wm8758.h | 10 +++++----- 7 files changed, 78 insertions(+), 10 deletions(-) diff --git a/apps/lang/english.lang b/apps/lang/english.lang index b11b996570..984aa1be95 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -9618,3 +9618,45 @@ *: "Wide" + + id: LANG_SHOW_PATH + desc: in settings_menu + user: + + *: "Show Path" + + + *: "Show Path" + + + *: "Show Path" + + + + id: LANG_SHOW_PATH_CURRENT + desc: in show path menu + user: + + *: "Current Directory Only" + + + *: "Current Directory Only" + + + *: "Current Directory Only" + + + + id: LANG_SHOW_PATH_FULL + desc: in show path menu + user: + + *: "Full Path" + + + *: "Full Path" + + + *: "Full Path" + + diff --git a/apps/settings.c b/apps/settings.c index 1f8f15be1e..412fc4bfed 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -613,6 +613,8 @@ static const struct bit_entry hd_bits[] = {5|SIGNED, S_O(eq_hw_band4_gain), 12, "eq hardware band 4 gain", NULL }, #endif + {2, S_O(show_path_in_browser), 0, "show path in browser", "off,current directory,full path" }, + /* If values are just added to the end, no need to bump the version. */ /* new stuff to be added at the end */ diff --git a/apps/settings.h b/apps/settings.h index 2d2c125721..439a43809a 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -564,6 +564,8 @@ struct user_settings int eq_hw_band4_cutoff; int eq_hw_band4_gain; #endif + + int show_path_in_browser; /* 0=off, 1=current directory, 2=full path */ }; enum optiontype { INT, BOOL }; @@ -660,4 +662,7 @@ enum { RECURSE_OFF, RECURSE_ON, RECURSE_ASK }; /* replaygain types */ enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE }; +/* show path types */ +enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL }; + #endif /* __SETTINGS_H__ */ diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 6a11e723b1..48e8c1dda5 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -98,6 +98,19 @@ static bool show_icons(void) return set_bool( (char *)str(LANG_SHOW_ICONS), &global_settings.show_icons ); } +static bool show_path(void) +{ + static const struct opt_items names[3] = { + { STR(LANG_OFF) }, + { STR(LANG_SHOW_PATH_CURRENT) }, + { STR(LANG_SHOW_PATH_FULL) }, + }; + + return set_option(str(LANG_SHOW_PATH), + &global_settings.show_path_in_browser, + INT, names, 3, NULL); +} + /** * Menu to set the option to scroll paginated */ @@ -1737,6 +1750,7 @@ static bool fileview_settings_menu(void) { ID2P(LANG_FILTER), dir_filter }, { ID2P(LANG_FOLLOW), browse_current }, { ID2P(LANG_SHOW_ICONS), show_icons }, + { ID2P(LANG_SHOW_PATH), show_path }, { ID2P(LANG_TAGCACHE), tagcache_settings_menu}, }; diff --git a/apps/tree.c b/apps/tree.c index 484ed672cd..72e62caf2b 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -347,6 +347,11 @@ static int update_dir(void) gui_syncsplash(HZ, true, str(LANG_SHOWDIR_BUFFER_FULL)); } } + if (global_settings.show_path_in_browser == SHOW_PATH_FULL) { + gui_synclist_set_title(&tree_lists, tc.currdir); + } else if (global_settings.show_path_in_browser == SHOW_PATH_CURRENT) { + gui_synclist_set_title(&tree_lists, strrchr(tc.currdir, '/')); + } gui_synclist_set_nb_items(&tree_lists, tc.filesindir); gui_synclist_set_icon_callback(&tree_lists, global_settings.show_icons?&tree_get_fileicon:NULL); diff --git a/firmware/drivers/wm8758.c b/firmware/drivers/wm8758.c index 9d2a300e70..33960af9b4 100644 --- a/firmware/drivers/wm8758.c +++ b/firmware/drivers/wm8758.c @@ -286,14 +286,14 @@ void wmcodec_set_equalizer_band(int band, int freq, int bw, int gain) eq |= 12 - gain; if (band == 0) { - wm8758_write(EQ0, eq | 0x100); /* Always apply EQ to the DAC path */ + wm8758_write(EQ1, eq | 0x100); /* Always apply EQ to the DAC path */ } else if (band == 1) { - wm8758_write(EQ1, eq); - } else if (band == 2) { wm8758_write(EQ2, eq); - } else if (band == 3) { + } else if (band == 2) { wm8758_write(EQ3, eq); - } else if (band == 4) { + } else if (band == 3) { wm8758_write(EQ4, eq); + } else if (band == 4) { + wm8758_write(EQ5, eq); } } diff --git a/firmware/export/wm8758.h b/firmware/export/wm8758.h index 5630a93b1b..e0b66b614f 100644 --- a/firmware/export/wm8758.h +++ b/firmware/export/wm8758.h @@ -62,11 +62,11 @@ extern void wmcodec_set_equalizer_band(int band, int freq, int bw, int gain); #define PLLK2 0x26 #define PLLK3 0x27 -#define EQ0 0x12 -#define EQ1 0x13 -#define EQ2 0x14 -#define EQ3 0x15 -#define EQ4 0x16 +#define EQ1 0x12 +#define EQ2 0x13 +#define EQ3 0x14 +#define EQ4 0x15 +#define EQ5 0x16 /* Register settings for the supported samplerates: */ #define WM8758_8000HZ 0x4d -- cgit v1.2.3