Created
April 15, 2016 13:50
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c | |
index 167dd85..8cce05f 100644 | |
--- a/firmware/drivers/audio/as3514.c | |
+++ b/firmware/drivers/audio/as3514.c | |
@@ -134,9 +134,9 @@ void audiohw_preinit(void) | |
as3514_write(AS3514_HPH_OUT_L, 0x0); | |
as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on); | |
- as3514_write(AS3514_AUDIOSET2, AUDIOSET2_SUM_off | AUDIOSET2_AGC_off | AUDIOSET2_HPH_QUALITY_LOW_POWER); | |
+ as3514_write(AS3514_AUDIOSET2, AUDIOSET2_SUM_off | AUDIOSET2_AGC_off | AUDIOSET2_HPH_QUALITY_HIGH); | |
/* common ground on, delay playback unmuting when inserting headphones */ | |
- as3514_write(AS3514_AUDIOSET3, AUDIOSET3_HPCM_on | AUDIOSET3_HP_LONGSTART); | |
+ as3514_write(AS3514_AUDIOSET3, AUDIOSET3_HPCM_on | AUDIOSET3_HP_LONGSTART | AUDIOSET3_HP_BIAS_150); | |
as3514_write(AS3543_DAC_IF, AS3543_DAC_INT_PLL); | |
#ifdef SAMSUNG_YPR0 | |
@@ -305,11 +305,11 @@ void audiohw_set_volume(int vol_l, int vol_r) | |
if (!(as3514_regs[AS3514_AUDIOSET1] & (AUDIOSET1_ADC_on | AUDIOSET1_LIN1_on))) { | |
if (!hph_l || !hph_r) { /*if volume higher, disable the mixer to slightly improve noise*/ | |
as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on | AUDIOSET1_DAC_GAIN_on); | |
- as3514_write(AS3514_AUDIOSET2, AUDIOSET2_AGC_off | AUDIOSET2_HPH_QUALITY_LOW_POWER); | |
+ as3514_write(AS3514_AUDIOSET2, AUDIOSET2_AGC_off | AUDIOSET2_HPH_QUALITY_HIGH); | |
as3514_write_masked(AS3514_HPH_OUT_R, HPH_OUT_R_HP_OUT_SUM, HPH_OUT_R_HP_OUT_MASK); | |
} else { | |
as3514_write(AS3514_AUDIOSET1, AUDIOSET1_DAC_on); | |
- as3514_write(AS3514_AUDIOSET2, AUDIOSET2_SUM_off | AUDIOSET2_AGC_off | AUDIOSET2_HPH_QUALITY_LOW_POWER); | |
+ as3514_write(AS3514_AUDIOSET2, AUDIOSET2_SUM_off | AUDIOSET2_AGC_off | AUDIOSET2_HPH_QUALITY_HIGH); | |
as3514_write_masked(AS3514_HPH_OUT_R, HPH_OUT_R_HP_OUT_DAC, HPH_OUT_R_HP_OUT_MASK); | |
} | |
} | |
-- | |
2.8.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/action.c b/apps/action.c | |
index eae00f5..48bf255 100644 | |
--- a/apps/action.c | |
+++ b/apps/action.c | |
@@ -154,6 +154,38 @@ static inline int get_next_context(const struct button_mapping *items, int i) | |
items[i].action_code; | |
} | |
+static bool backlight_on_action(int action) | |
+{ | |
+ /* no backlight on volume change, pause/play, stop or track skip */ | |
+ return (action != ACTION_WPS_VOLUP) | |
+ && (action != ACTION_WPS_VOLDOWN) | |
+ && (action != ACTION_WPS_PLAY) | |
+ && (action != ACTION_WPS_STOP) | |
+ && (action != ACTION_WPS_SKIPNEXT) | |
+ && (action != ACTION_WPS_SKIPPREV); | |
+} | |
+ | |
+static bool backlight_on_keypress_oracle(int btn) | |
+{ | |
+ /* check whether the button would fire an action */ | |
+ /* If yes, check whether that action should turn on the backlight */ | |
+ /* Keep this function fast! It's called from the button ticktask */ | |
+ /* or the scrollwheel interrupt handler! */ | |
+ | |
+ const struct button_mapping *items = NULL; | |
+ int i = 0; | |
+ | |
+ if (!global_settings.backlight_on_volume_change) | |
+ { | |
+ items = get_context_mapping(CONTEXT_WPS); | |
+ /* also check action for button release */ | |
+ return backlight_on_action(do_button_check(items, btn, BUTTON_NONE, &i)) | |
+ && backlight_on_action(do_button_check(items, btn | BUTTON_REL, btn, &i)); | |
+ } | |
+ else | |
+ return true; | |
+} | |
+ | |
#if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ) | |
/* Timeout for gui boost in seconds. */ | |
@@ -213,6 +245,16 @@ static int get_action_worker(int context, int timeout, | |
send_event(GUI_EVENT_ACTIONUPDATE, NULL); | |
+ /* In CONTEXT_WPS or CONTEXT_FM we may want to keep the backlight off */ | |
+ /* on certain actions. */ | |
+ /* Thus, a callback function is used to check if it should turn on. */ | |
+ /* See also button.c */ | |
+ if ( (context & ~ALLOW_SOFTLOCK) == CONTEXT_WPS | |
+ || (context & ~ALLOW_SOFTLOCK) == CONTEXT_FM ) | |
+ set_backlight_on_keypress_oracle(backlight_on_keypress_oracle); | |
+ else | |
+ set_backlight_on_keypress_oracle(NULL); | |
+ | |
if (timeout == TIMEOUT_NOBLOCK) | |
button = button_get(false); | |
else if (timeout == TIMEOUT_BLOCK) | |
diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang | |
index 24feaab..a189854 100644 | |
--- a/apps/lang/deutsch.lang | |
+++ b/apps/lang/deutsch.lang | |
@@ -2596,6 +2596,20 @@ | |
</voice> | |
</phrase> | |
<phrase> | |
+ id: LANG_BACKLIGHT_ON_VOLUME_CHANGE | |
+ desc: Backlight on volume change and on pause/play | |
+ user: core | |
+ <source> | |
+ *: "Backlight On Volume Change" | |
+ </source> | |
+ <dest> | |
+ *: "Beleuchtung bei Änderung der Lautstärke" | |
+ </dest> | |
+ <voice> | |
+ *: "Beleuchtung bei Änderung der Lautstärke" | |
+ </voice> | |
+</phrase> | |
+<phrase> | |
id: LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF | |
desc: In display settings, time to switch LCD chip into power saving state | |
user: core | |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang | |
index 8d2b579..5042a16 100644 | |
--- a/apps/lang/english.lang | |
+++ b/apps/lang/english.lang | |
@@ -2679,6 +2679,20 @@ | |
</voice> | |
</phrase> | |
<phrase> | |
+ id: LANG_BACKLIGHT_ON_VOLUME_CHANGE | |
+ desc: Backlight on volume change and on pause/play | |
+ user: core | |
+ <source> | |
+ *: "Backlight on Volume Change" | |
+ </source> | |
+ <dest> | |
+ *: "Backlight on Volume Change" | |
+ </dest> | |
+ <voice> | |
+ *: "Backlight on Volume Change" | |
+ </voice> | |
+</phrase> | |
+<phrase> | |
id: LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF | |
desc: In display settings, time to switch LCD chip into power saving state | |
user: core | |
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c | |
index 948dced..24443ac 100644 | |
--- a/apps/menus/display_menu.c | |
+++ b/apps/menus/display_menu.c | |
@@ -104,6 +104,9 @@ MENUITEM_SETTING(backlight_fade_out, &global_settings.backlight_fade_out, NULL); | |
MENUITEM_SETTING(bl_filter_first_keypress, | |
&global_settings.bl_filter_first_keypress, | |
filterfirstkeypress_callback); | |
+MENUITEM_SETTING(backlight_on_volume_change, | |
+ &global_settings.backlight_on_volume_change, | |
+ NULL); | |
#ifdef HAVE_LCD_SLEEP_SETTING | |
MENUITEM_SETTING(lcd_sleep_after_backlight_off, | |
&global_settings.lcd_sleep_after_backlight_off, NULL); | |
@@ -141,6 +144,7 @@ MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), | |
,&backlight_fade_in, &backlight_fade_out | |
#endif | |
,&bl_filter_first_keypress | |
+ ,&backlight_on_volume_change | |
# ifdef HAVE_LCD_SLEEP_SETTING | |
,&lcd_sleep_after_backlight_off | |
# endif | |
diff --git a/apps/settings.h b/apps/settings.h | |
index e7388b4..f296fd7 100644 | |
--- a/apps/settings.h | |
+++ b/apps/settings.h | |
@@ -667,6 +667,8 @@ struct user_settings | |
then according to timeout_values[] */ | |
bool caption_backlight; /* turn on backlight at end and start of track */ | |
bool bl_filter_first_keypress; /* filter first keypress when dark? */ | |
+ bool backlight_on_volume_change; /* turn on the backlight on volume change | |
+ and on pause/play? */ | |
#if CONFIG_CHARGING | |
int backlight_timeout_plugged; | |
#endif | |
diff --git a/apps/settings_list.c b/apps/settings_list.c | |
index 62f2326..016d593 100644 | |
--- a/apps/settings_list.c | |
+++ b/apps/settings_list.c | |
@@ -1062,6 +1062,9 @@ const struct settings_list settings[] = { | |
OFFON_SETTING(0, bl_filter_first_keypress, | |
LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false, | |
"backlight filters first keypress", NULL), | |
+ OFFON_SETTING(0, backlight_on_volume_change, | |
+ LANG_BACKLIGHT_ON_VOLUME_CHANGE, true, | |
+ "backlight on volume change", NULL), | |
#ifdef HAVE_REMOTE_LCD | |
OFFON_SETTING(0, remote_bl_filter_first_keypress, | |
LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false, | |
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c | |
index d47a486..5d62f06 100644 | |
--- a/firmware/drivers/button.c | |
+++ b/firmware/drivers/button.c | |
@@ -41,6 +41,7 @@ | |
#ifdef HAVE_REMOTE_LCD | |
#include "lcd-remote.h" | |
#endif | |
+#include "debug.h" | |
struct event_queue button_queue SHAREDBSS_ATTR; | |
@@ -52,6 +53,7 @@ static bool flipped; /* buttons can be flipped to match the LCD flip */ | |
#endif | |
#ifdef HAVE_BACKLIGHT | |
static bool filter_first_keypress; | |
+static backlight_on_keypress_oracle_func backlight_on_keypress_oracle = NULL; | |
#ifdef HAVE_REMOTE_LCD | |
static bool remote_filter_first_keypress; | |
#endif | |
@@ -138,6 +140,41 @@ static bool button_try_post(int button, int data) | |
return ret; | |
} | |
+#ifdef HAVE_BACKLIGHT | |
+void backlight_on_by_button(int btn) | |
+{ | |
+ bool bl_on; | |
+ if (backlight_on_keypress_oracle != NULL) | |
+ { | |
+ bl_on = (*backlight_on_keypress_oracle)(btn); | |
+ DEBUGF("BL oracle (%d) returned: %d\n", btn, bl_on); | |
+ /* We just pressed a button - if the screen is on, | |
+ restart the timer to keep it on */ | |
+ if (!bl_on && is_backlight_on(false)) { | |
+ DEBUGF("timer: BL is on - restarting timeout\n"); | |
+ bl_on = true; | |
+ } else { | |
+ DEBUGF("timer: BL is off\n"); | |
+ } | |
+ } | |
+ else | |
+ { | |
+ bl_on = true; | |
+ DEBUGF("BL callback is NULL -> bl ON\n"); | |
+ } | |
+ if (bl_on) | |
+ { | |
+ backlight_on(); | |
+#ifdef HAVE_REMOTE_LCD | |
+ remote_backlight_on(); | |
+#endif | |
+#ifdef HAVE_BUTTON_LIGHT | |
+ buttonlight_on(); | |
+#endif | |
+ } | |
+} | |
+#endif /* ifdef HAVE_BACKLIGHT */ | |
+ | |
static void button_tick(void) | |
{ | |
static int count = 0; | |
@@ -329,10 +366,13 @@ static void button_tick(void) | |
skip_remote_release = true; | |
} | |
else | |
-#endif | |
- if (!filter_first_keypress || is_backlight_on(false) | |
+#endif /* HAVE_REMOTE_LCD */ | |
+ if (!filter_first_keypress | |
+ || is_backlight_on(false) | |
+ || ((backlight_on_keypress_oracle != NULL) | |
+ && !(*backlight_on_keypress_oracle)(btn)) | |
#if BUTTON_REMOTE | |
- || (btn & BUTTON_REMOTE) | |
+ || (btn & BUTTON_REMOTE) | |
#endif | |
) | |
button_try_post(btn, data); | |
@@ -348,12 +388,7 @@ static void button_tick(void) | |
remote_backlight_on(); | |
else | |
#endif | |
- { | |
- backlight_on(); | |
-#ifdef HAVE_BUTTON_LIGHT | |
- buttonlight_on(); | |
-#endif | |
- } | |
+ backlight_on_by_button(btn); | |
reset_poweroff_timer(); | |
} | |
@@ -468,6 +503,7 @@ void button_init(void) | |
#endif | |
#ifdef HAVE_BACKLIGHT | |
filter_first_keypress = false; | |
+ set_backlight_on_keypress_oracle(NULL); | |
#ifdef HAVE_REMOTE_LCD | |
remote_filter_first_keypress = false; | |
#endif | |
@@ -581,6 +617,12 @@ void set_backlight_filter_keypress(bool value) | |
{ | |
filter_first_keypress = value; | |
} | |
+ | |
+void set_backlight_on_keypress_oracle(backlight_on_keypress_oracle_func new_value) | |
+{ | |
+ backlight_on_keypress_oracle = new_value; | |
+} | |
+ | |
#ifdef HAVE_REMOTE_LCD | |
void set_remote_backlight_filter_keypress(bool value) | |
{ | |
diff --git a/firmware/export/button.h b/firmware/export/button.h | |
index 7109c00..f54b5f4 100644 | |
--- a/firmware/export/button.h | |
+++ b/firmware/export/button.h | |
@@ -64,6 +64,23 @@ void button_set_flip(bool flip); /* turn 180 degrees */ | |
#endif | |
#ifdef HAVE_BACKLIGHT | |
void set_backlight_filter_keypress(bool value); | |
+ | |
+/* Callback function to tell whether the backlight should be turned on | |
+ * when a key is pressed. Called just after a key press. | |
+ * | |
+ * @param btn The button that was pressed | |
+ * | |
+ * Returns true iff the backlight should be turned on on key press. | |
+ */ | |
+typedef bool (*backlight_on_keypress_oracle_func)(int btn); | |
+ | |
+/* Sets the new 'oracle' to tell whether the backlight should be turned | |
+ * on when a key is pressed. Passing NULL as parameter will turn on the BL | |
+ * on every key press. | |
+ */ | |
+void set_backlight_on_keypress_oracle(backlight_on_keypress_oracle_func func); | |
+void backlight_on_by_button(int btn); | |
+ | |
#ifdef HAVE_REMOTE_LCD | |
void set_remote_backlight_filter_keypress(bool value); | |
#endif | |
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c | |
index 319b3e3..cc881ab 100644 | |
--- a/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c | |
+++ b/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c | |
@@ -169,7 +169,7 @@ static void scrollwheel(unsigned int wheel_value) | |
(wheel_delta << 24) | wheel_velocity*360/WHEELCLICKS_PER_ROTATION); | |
/* message posted - reset delta and poke backlight on*/ | |
wheel_delta = 1; | |
- backlight_on(); | |
+ backlight_on_by_button(btn); | |
buttonlight_on(); | |
} | |
else | |
diff --git a/firmware/target/arm/ipod/button-1g-3g.c b/firmware/target/arm/ipod/button-1g-3g.c | |
index 67aa7eb..424c322 100644 | |
--- a/firmware/target/arm/ipod/button-1g-3g.c | |
+++ b/firmware/target/arm/ipod/button-1g-3g.c | |
@@ -95,13 +95,6 @@ static void handle_scroll_wheel(int new_scroll) | |
count = 0; | |
} | |
- /* poke backlight every 1/4s of activity */ | |
- if (TIME_AFTER(current_tick, nextbacklight_hw_on)) { | |
- backlight_on(); | |
- reset_poweroff_timer(); | |
- nextbacklight_hw_on = current_tick + HZ/4; | |
- } | |
- | |
/* has wheel travelled far enough? */ | |
if (++count < WHEEL_BASE_SENSITIVITY) { | |
return; | |
@@ -126,6 +119,13 @@ static void handle_scroll_wheel(int new_scroll) | |
/* have a keycode */ | |
+ /* poke backlight every 1/4s of activity */ | |
+ if (TIME_AFTER(current_tick, nextbacklight_hw_on)) { | |
+ backlight_on_by_button(wheel_keycode); | |
+ reset_poweroff_timer(); | |
+ nextbacklight_hw_on = current_tick + HZ/4; | |
+ } | |
+ | |
usec = USEC_TIMER; | |
v = usec - last_wheel_usec; | |
diff --git a/firmware/target/arm/ipod/button-clickwheel.c b/firmware/target/arm/ipod/button-clickwheel.c | |
index 5f138aa..d832321 100644 | |
--- a/firmware/target/arm/ipod/button-clickwheel.c | |
+++ b/firmware/target/arm/ipod/button-clickwheel.c | |
@@ -132,8 +132,7 @@ static inline int ipod_4g_button_read(void) | |
new_wheel_value = (status >> 16) & 0x7f; | |
whl = new_wheel_value; | |
- /* switch on backlight (again), reset power-off timer */ | |
- backlight_on(); | |
+ /* reset power-off timer */ | |
reset_poweroff_timer(); | |
/* Check whether the scrollwheel was untouched by accident or by will. */ | |
@@ -176,6 +175,9 @@ static inline int ipod_4g_button_read(void) | |
if (wheel_keycode != BUTTON_NONE) | |
{ | |
+ /* switch on backlight (again) */ | |
+ backlight_on_by_button(wheel_keycode); | |
+ | |
long v = (usec - last_wheel_usec) & 0x7fffffff; | |
/* undo signedness */ | |
diff --git a/firmware/target/arm/ipod/button-mini1g.c b/firmware/target/arm/ipod/button-mini1g.c | |
index a508958..51b6ab6 100644 | |
--- a/firmware/target/arm/ipod/button-mini1g.c | |
+++ b/firmware/target/arm/ipod/button-mini1g.c | |
@@ -91,13 +91,6 @@ static void handle_scroll_wheel(int new_scroll) | |
return; | |
} | |
- /* poke backlight every 1/4s of activity */ | |
- if (TIME_AFTER(current_tick, nextbacklight_hw_on)) { | |
- backlight_on(); | |
- reset_poweroff_timer(); | |
- nextbacklight_hw_on = current_tick + HZ/4; | |
- } | |
- | |
if (++count < WHEEL_BASE_SENSITIVITY) | |
return; | |
@@ -118,6 +111,13 @@ static void handle_scroll_wheel(int new_scroll) | |
/* have a keycode */ | |
+ /* poke backlight every 1/4s of activity */ | |
+ if (TIME_AFTER(current_tick, nextbacklight_hw_on)) { | |
+ backlight_on_by_button(wheel_keycode); | |
+ reset_poweroff_timer(); | |
+ nextbacklight_hw_on = current_tick + HZ/4; | |
+ } | |
+ | |
usec = USEC_TIMER; | |
v = usec - last_wheel_usec; | |
diff --git a/firmware/target/arm/sandisk/sansa-e200/button-e200.c b/firmware/target/arm/sandisk/sansa-e200/button-e200.c | |
index 0df71f4..be706c4 100644 | |
--- a/firmware/target/arm/sandisk/sansa-e200/button-e200.c | |
+++ b/firmware/target/arm/sandisk/sansa-e200/button-e200.c | |
@@ -171,7 +171,7 @@ void clickwheel_int(void) | |
/* Poke backlight to turn it on or maintain it no more often | |
* than every 1/4 second */ | |
nextbacklight_hw_on = current_tick + HZ/4; | |
- backlight_on(); | |
+ backlight_on_by_button(keycode); | |
#ifdef HAVE_BUTTON_LIGHT | |
buttonlight_on(); | |
#endif | |
-- | |
2.8.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/bookmark.c b/apps/bookmark.c | |
index 567f98a..7dd68ae 100644 | |
--- a/apps/bookmark.c | |
+++ b/apps/bookmark.c | |
@@ -271,6 +271,19 @@ static bool write_bookmark(bool create_bookmark_file, const char *bookmark) | |
return ret; | |
} | |
+/* Get the name of the playlist and the name of the track from a bookmark. */ | |
+/* Returns true iff both were extracted. */ | |
+static bool get_playlist_and_track(const char *bookmark, char **pl_start, | |
+ char **pl_end, char **track) | |
+{ | |
+ *pl_start = strchr(bookmark,'/'); | |
+ if (!(*pl_start)) | |
+ return false; | |
+ *pl_end = strrchr(bookmark,';'); | |
+ *track = *pl_end + 1; | |
+ return true; | |
+} | |
+ | |
/* ----------------------------------------------------------------------- */ | |
/* This function adds a bookmark to a file. */ | |
/* Returns true on successful bookmark add. */ | |
@@ -281,11 +294,13 @@ static bool add_bookmark(const char* bookmark_file_name, const char* bookmark, | |
int temp_bookmark_file = 0; | |
int bookmark_file = 0; | |
int bookmark_count = 0; | |
- char* playlist = NULL; | |
- char* cp; | |
- char* tmp; | |
- int len = 0; | |
- bool unique = false; | |
+ char *pl_start, *bm_pl_start; | |
+ char *pl_end, *bm_pl_end; | |
+ int pl_len = 0, bm_pl_len; | |
+ char *track, *bm_track; | |
+ bool comp_playlist = false; | |
+ bool comp_track = false; | |
+ bool equal; | |
/* Opening up a temp bookmark file */ | |
snprintf(global_temp_buffer, sizeof(global_temp_buffer), | |
@@ -295,12 +310,16 @@ static bool add_bookmark(const char* bookmark_file_name, const char* bookmark, | |
if (temp_bookmark_file < 0) | |
return false; /* can't open the temp file */ | |
- if (most_recent && (global_settings.usemrb == BOOKMARK_UNIQUE_ONLY)) | |
+ if (most_recent && ((global_settings.usemrb == BOOKMARK_ONE_PER_PLAYLIST) | |
+ || (global_settings.usemrb == BOOKMARK_ONE_PER_TRACK))) | |
{ | |
- playlist = strchr(bookmark,'/'); | |
- cp = strrchr(bookmark,';'); | |
- len = cp - playlist; | |
- unique = true; | |
+ if (get_playlist_and_track(bookmark, &pl_start, &pl_end, &track)) | |
+ { | |
+ comp_playlist = true; | |
+ pl_len = pl_end - pl_start; | |
+ if (global_settings.usemrb == BOOKMARK_ONE_PER_TRACK) | |
+ comp_track = true; | |
+ } | |
} | |
/* Writing the new bookmark to the begining of the temp file */ | |
@@ -319,11 +338,23 @@ static bool add_bookmark(const char* bookmark_file_name, const char* bookmark, | |
/* This keeps it from getting too large */ | |
if (most_recent && (bookmark_count >= MAX_BOOKMARKS)) | |
break; | |
- | |
- cp = strchr(global_read_buffer,'/'); | |
- tmp = strrchr(global_read_buffer,';'); | |
- if (parse_bookmark(global_read_buffer, false) && | |
- (!unique || len != tmp -cp || strncmp(playlist,cp,len))) | |
+ | |
+ if (!parse_bookmark(global_read_buffer, false)) | |
+ break; | |
+ | |
+ equal = false; | |
+ if (comp_playlist) | |
+ { | |
+ if (get_playlist_and_track(global_read_buffer, &bm_pl_start, | |
+ &bm_pl_end, &bm_track)) | |
+ { | |
+ bm_pl_len = bm_pl_end - bm_pl_start; | |
+ equal = (pl_len == bm_pl_len) && !strncmp(pl_start, bm_pl_start, pl_len); | |
+ if (equal && comp_track) | |
+ equal = !strcmp(track, bm_track); | |
+ } | |
+ } | |
+ if (!equal) | |
{ | |
bookmark_count++; | |
write(temp_bookmark_file, global_read_buffer, | |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang | |
index 8d2b579..986857d 100644 | |
--- a/apps/lang/english.lang | |
+++ b/apps/lang/english.lang | |
@@ -4740,14 +4740,11 @@ | |
desc: Save only on bookmark for each playlist in recent bookmarks | |
user: core | |
<source> | |
- *: "Unique only" | |
+ *: "deprecated" | |
</source> | |
<dest> | |
- *: "Unique only" | |
+ *: "deprecated" | |
</dest> | |
- <voice> | |
- *: "Unique only" | |
- </voice> | |
</phrase> | |
<phrase> | |
id: LANG_LANGUAGE | |
@@ -12660,6 +12657,34 @@ | |
</voice> | |
</phrase> | |
<phrase> | |
+ id: LANG_BOOKMARK_SETTINGS_ONE_PER_PLAYLIST | |
+ desc: Save only one bookmark for a playlist in recent bookmarks | |
+ user: core | |
+ <source> | |
+ *: "One per playlist" | |
+ </source> | |
+ <dest> | |
+ *: "One per playlist" | |
+ </dest> | |
+ <voice> | |
+ *: "One per playlist" | |
+ </voice> | |
+</phrase> | |
+<phrase> | |
+ id: LANG_BOOKMARK_SETTINGS_ONE_PER_TRACK | |
+ desc: Save only one bookmark for a combination (playlist,track) in recent bookmarks | |
+ user: core | |
+ <source> | |
+ *: "One per track" | |
+ </source> | |
+ <dest> | |
+ *: "One per track" | |
+ </dest> | |
+ <voice> | |
+ *: "One per track" | |
+ </voice> | |
+</phrase> | |
+<phrase> | |
id: LANG_SET_AS_START_DIR | |
desc: used in the onplay menu to set a starting browser dir | |
user: core | |
diff --git a/apps/settings.h b/apps/settings.h | |
index e7388b4..8299b48 100644 | |
--- a/apps/settings.h | |
+++ b/apps/settings.h | |
@@ -45,14 +45,16 @@ struct opt_items { | |
#define MAX_FILENAME 32 | |
#define MAX_PATHNAME 80 | |
- | |
+/* The values are assigned to the enums so that they correspond to */ | |
+/* setting values in settings_list.c */ | |
enum { | |
BOOKMARK_NO = 0, | |
BOOKMARK_YES, | |
BOOKMARK_ASK, | |
- BOOKMARK_UNIQUE_ONLY = 2, | |
+ BOOKMARK_ONE_PER_PLAYLIST = 2, | |
BOOKMARK_RECENT_ONLY_YES, | |
BOOKMARK_RECENT_ONLY_ASK, | |
+ BOOKMARK_ONE_PER_TRACK = 3, | |
}; | |
enum | |
@@ -560,7 +562,8 @@ struct user_settings | |
int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */ | |
int autocreatebookmark; /* auto create option: 0=off, 1=ask, 2=on */ | |
bool autoupdatebookmark;/* auto update option */ | |
- int usemrb; /* use MRB list: 0=No, 1=Yes, 2=One per playlist */ | |
+ int usemrb; /* use MRB list: 0=No, 1=Yes, 2=One per playlist, | |
+ 3=One per playlist and track */ | |
#ifdef HAVE_DIRCACHE | |
bool dircache; /* enable directory cache */ | |
diff --git a/apps/settings_list.c b/apps/settings_list.c | |
index 62f2326..515e18c 100644 | |
--- a/apps/settings_list.c | |
+++ b/apps/settings_list.c | |
@@ -1229,9 +1229,10 @@ const struct settings_list settings[] = { | |
ID2P(LANG_ASK)), | |
CHOICE_SETTING(0, usemrb, LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS, | |
BOOKMARK_NO, "use most-recent-bookmarks", | |
- "off,on,unique only", NULL, 3, ID2P(LANG_SET_BOOL_NO), | |
+ "off,on,unique only,one per track", NULL, 4, ID2P(LANG_SET_BOOL_NO), | |
ID2P(LANG_SET_BOOL_YES), | |
- ID2P(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)), | |
+ ID2P(LANG_BOOKMARK_SETTINGS_ONE_PER_PLAYLIST), | |
+ ID2P(LANG_BOOKMARK_SETTINGS_ONE_PER_TRACK)), | |
#ifdef HAVE_LCD_BITMAP | |
/* peak meter */ | |
STRINGCHOICE_SETTING(0, peak_meter_clip_hold, LANG_PM_CLIP_HOLD, 16, | |
diff --git a/manual/appendix/config_file_options.tex b/manual/appendix/config_file_options.tex | |
index b22a29d..4162b9a 100644 | |
--- a/manual/appendix/config_file_options.tex | |
+++ b/manual/appendix/config_file_options.tex | |
@@ -126,7 +126,7 @@ | |
autoload bookmarks | |
& off, on & N/A\\ | |
use most-recent-bookmarks | |
- & off, on & N/A\\ | |
+ & off, on, unique only, one per track & N/A\\ | |
pause on headphone unplug & off, pause, pause and resume & N/A\\ | |
rewind duration on pause & 0 to 15 & s\\ | |
disable autoresume if phones not present & off, on & N/A\\ | |
diff --git a/manual/configure_rockbox/bookmarking.tex b/manual/configure_rockbox/bookmarking.tex | |
index 68dad4b..8147715 100644 | |
--- a/manual/configure_rockbox/bookmarking.tex | |
+++ b/manual/configure_rockbox/bookmarking.tex | |
@@ -81,10 +81,15 @@ | |
\item[Yes] | |
Keep a list of recently used bookmarks. Each new bookmark is added | |
to the list of recent bookmarks. | |
- \item[Unique Only] | |
+ \item[One per playlist] | |
Add each new bookmark to the list of recently used bookmarks, but | |
only keep one bookmark from the current directory or playlist; any | |
- previous entries are removed. | |
+ previous entries for the playlist are removed. | |
+ \item[One per track] | |
+ Add each new bookmark to the list of recently used bookmarks, but | |
+ only keep one bookmark from the current directory or playlist and | |
+ the current track; any previous entries for the track within the | |
+ playlist are removed. | |
\end{description} | |
\end{description} | |
-- | |
2.8.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/keymaps/keymap-clip.c b/apps/keymaps/keymap-clip.c | |
index 78cefbe..2766cc5 100644 | |
--- a/apps/keymaps/keymap-clip.c | |
+++ b/apps/keymaps/keymap-clip.c | |
@@ -134,8 +134,8 @@ static const struct button_mapping button_context_list[] = { | |
}; /* button_context_list */ | |
static const struct button_mapping button_context_tree[] = { | |
- { ACTION_TREE_WPS, BUTTON_HOME|BUTTON_SELECT, BUTTON_HOME }, | |
- { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | |
+ { ACTION_TREE_WPS, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | |
+ { ACTION_TREE_STOP, BUTTON_HOME|BUTTON_SELECT, BUTTON_HOME }, | |
#ifdef HAVE_HOTKEY | |
// { ACTION_TREE_HOTKEY, BUTTON_NONE, BUTTON_NONE }, | |
#endif | |
-- | |
2.8.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/keymaps/keymap-clip.c b/apps/keymaps/keymap-clip.c | |
index 78cefbe..ab9c14d 100644 | |
--- a/apps/keymaps/keymap-clip.c | |
+++ b/apps/keymaps/keymap-clip.c | |
@@ -40,7 +40,7 @@ static const struct button_mapping button_context_standard[] = { | |
{ ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | |
{ ACTION_STD_MENU, BUTTON_HOME|BUTTON_REL, BUTTON_HOME }, | |
- { ACTION_STD_QUICKSCREEN, BUTTON_HOME|BUTTON_REPEAT, BUTTON_HOME }, | |
+ { ACTION_STD_QUICKSCREEN, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | |
{ ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | |
{ ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, | |
@@ -55,7 +55,7 @@ static const struct button_mapping button_context_standard[] = { | |
static const struct button_mapping button_context_wps[] = { | |
{ ACTION_WPS_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP }, | |
- { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | |
+ { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, | |
{ ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | |
{ ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | |
@@ -77,7 +77,7 @@ static const struct button_mapping button_context_wps[] = { | |
{ ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | |
{ ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | |
- { ACTION_WPS_QUICKSCREEN, BUTTON_HOME|BUTTON_REPEAT, BUTTON_HOME }, | |
+ { ACTION_WPS_QUICKSCREEN, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | |
{ ACTION_WPS_MENU, BUTTON_HOME|BUTTON_REL, BUTTON_HOME }, | |
{ ACTION_WPS_PITCHSCREEN, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | |
@@ -90,7 +90,7 @@ static const struct button_mapping button_context_wps[] = { | |
#endif | |
#ifndef HAS_BUTTON_HOLD /* Clip+ */ | |
- { ACTION_STD_KEYLOCK, BUTTON_HOME|BUTTON_SELECT, BUTTON_NONE }, | |
+ { ACTION_STD_KEYLOCK, BUTTON_HOME|BUTTON_REPEAT, BUTTON_HOME }, | |
#endif /* HAS_BUTTON_HOLD */ | |
LAST_ITEM_IN_LIST | |
@@ -134,8 +134,8 @@ static const struct button_mapping button_context_list[] = { | |
}; /* button_context_list */ | |
static const struct button_mapping button_context_tree[] = { | |
- { ACTION_TREE_WPS, BUTTON_HOME|BUTTON_SELECT, BUTTON_HOME }, | |
- { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | |
+ { ACTION_TREE_WPS, BUTTON_HOME|BUTTON_REPEAT, BUTTON_HOME }, | |
+ { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, | |
#ifdef HAVE_HOTKEY | |
// { ACTION_TREE_HOTKEY, BUTTON_NONE, BUTTON_NONE }, | |
#endif | |
@@ -165,12 +165,6 @@ static const struct button_mapping button_context_listtree_scroll_with_combo[] | |
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | |
}; /* button_context_listtree_scroll_with_combo */ | |
-static const struct button_mapping button_context_mainmenu[] = { | |
- { ACTION_TREE_WPS, BUTTON_HOME|BUTTON_REL, BUTTON_HOME }, | |
- | |
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_TREE), | |
-}; /* button_context_mainmenu */ | |
- | |
static const struct button_mapping button_context_yesno[] = { | |
{ ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, | |
@@ -409,12 +403,11 @@ const struct button_mapping* get_context_mapping(int context) | |
case CONTEXT_LIST: | |
return button_context_list; | |
case CONTEXT_TREE: | |
+ case CONTEXT_MAINMENU: | |
if (global_settings.hold_lr_for_scroll_in_list) | |
return button_context_listtree_scroll_without_combo; | |
else | |
return button_context_listtree_scroll_with_combo; | |
- case CONTEXT_MAINMENU: | |
- return button_context_mainmenu; | |
case CONTEXT_CUSTOM|CONTEXT_TREE: | |
return button_context_tree; | |
-- | |
2.8.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/lang/english.lang b/apps/lang/english.lang | |
index 8d2b579..542b9b4 100644 | |
--- a/apps/lang/english.lang | |
+++ b/apps/lang/english.lang | |
@@ -883,6 +883,20 @@ | |
</voice> | |
</phrase> | |
<phrase> | |
+ id: LANG_CHANNEL_REVERSE_STEREO | |
+ desc: in sound_settings | |
+ user: core | |
+ <source> | |
+ *: "Reverse Stereo" | |
+ </source> | |
+ <dest> | |
+ *: "Reverse Stereo" | |
+ </dest> | |
+ <voice> | |
+ *: "Reverse Stereo" | |
+ </voice> | |
+</phrase> | |
+<phrase> | |
id: LANG_STEREO_WIDTH | |
desc: in sound_settings | |
user: core | |
diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c | |
index 073af31..41ea1d4 100644 | |
--- a/apps/plugins/wavplay.c | |
+++ b/apps/plugins/wavplay.c | |
@@ -3277,6 +3277,13 @@ void pcm_channel_config(int channel_config, int stereo_width) | |
val_rr = 0xc0001; | |
break; | |
+ case SOUND_CHAN_REV_STEREO: | |
+ val_ll = 0; | |
+ val_lr = 0x80001; | |
+ val_rl = 0x80001; | |
+ val_rr = 0; | |
+ break; | |
+ | |
case SOUND_CHAN_CUSTOM: | |
{ | |
/* fixed point variables (matching MAS internal format) | |
diff --git a/apps/settings_list.c b/apps/settings_list.c | |
index 62f2326..1198387 100644 | |
--- a/apps/settings_list.c | |
+++ b/apps/settings_list.c | |
@@ -808,11 +808,12 @@ const struct settings_list settings[] = { | |
CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION, | |
0,"channels", | |
- "stereo,mono,custom,mono left,mono right,karaoke", | |
- sound_set_channels, 6, | |
+ "stereo,mono,custom,mono left,mono right,karaoke,reverse", | |
+ sound_set_channels, 7, | |
ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO), | |
ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT), | |
- ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)), | |
+ ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE), | |
+ ID2P(LANG_CHANNEL_REVERSE_STEREO)), | |
SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH, | |
"stereo_width", SOUND_STEREO_WIDTH), | |
#ifdef AUDIOHW_HAVE_DEPTH_3D | |
diff --git a/firmware/drivers/audio/mas35xx.c b/firmware/drivers/audio/mas35xx.c | |
index 65c582c..c08e4e4 100644 | |
--- a/firmware/drivers/audio/mas35xx.c | |
+++ b/firmware/drivers/audio/mas35xx.c | |
@@ -99,6 +99,13 @@ static void set_channel_config(void) | |
val_rl = 0x40000; | |
val_rr = 0xc0000; | |
break; | |
+ | |
+ case SOUND_CHAN_REV_STEREO: | |
+ val_ll = 0; | |
+ val_lr = 0x80000; | |
+ val_rl = 0x80000; | |
+ val_rr = 0; | |
+ break; | |
} | |
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | |
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h | |
index d7bc3dd..34feb4d 100644 | |
--- a/firmware/export/audiohw.h | |
+++ b/firmware/export/audiohw.h | |
@@ -523,6 +523,7 @@ enum AUDIOHW_CHANNEL_CONFIG | |
SOUND_CHAN_MONO_LEFT, | |
SOUND_CHAN_MONO_RIGHT, | |
SOUND_CHAN_KARAOKE, | |
+ SOUND_CHAN_REV_STEREO, | |
SOUND_CHAN_NUM_MODES, | |
}; | |
diff --git a/lib/rbcodec/dsp/channel_mode.c b/lib/rbcodec/dsp/channel_mode.c | |
index aa92cec..bb6e261 100644 | |
--- a/lib/rbcodec/dsp/channel_mode.c | |
+++ b/lib/rbcodec/dsp/channel_mode.c | |
@@ -43,6 +43,8 @@ void channel_mode_proc_custom(struct dsp_proc_entry *this, | |
struct dsp_buffer **buf_p); | |
void channel_mode_proc_karaoke(struct dsp_proc_entry *this, | |
struct dsp_buffer **buf_p); | |
+static void channel_mode_proc_reverse_stereo(struct dsp_proc_entry *this, | |
+ struct dsp_buffer **buf_p); | |
static struct channel_mode_data | |
{ | |
@@ -149,6 +151,23 @@ void channel_mode_proc_mono_right(struct dsp_proc_entry *this, | |
(void)this; | |
} | |
+static void channel_mode_proc_reverse_stereo(struct dsp_proc_entry *this, | |
+ struct dsp_buffer **buf_p) | |
+{ | |
+ struct dsp_buffer *buf = *buf_p; | |
+ int32_t *sl = buf->p32[0]; | |
+ int32_t *sr = buf->p32[1]; | |
+ int count = buf->remcount; | |
+ | |
+ while (count-- > 0) { | |
+ int32_t tmp = *sl; | |
+ *sl++ = *sr; | |
+ *sr++ = tmp; | |
+ } | |
+ | |
+ (void)this; | |
+} | |
+ | |
void channel_mode_set_config(int value) | |
{ | |
if (value < 0 || value >= SOUND_CHAN_NUM_MODES) | |
@@ -194,6 +213,7 @@ static void update_process_fn(struct dsp_proc_entry *this) | |
[SOUND_CHAN_MONO_LEFT] = channel_mode_proc_mono_left, | |
[SOUND_CHAN_MONO_RIGHT] = channel_mode_proc_mono_right, | |
[SOUND_CHAN_KARAOKE] = channel_mode_proc_karaoke, | |
+ [SOUND_CHAN_REV_STEREO] = channel_mode_proc_reverse_stereo, | |
}; | |
this->process = fns[((struct channel_mode_data *)this->data)->mode]; | |
-- | |
2.8.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tools/configure b/tools/configure | |
index efad8a7..3bb9a3f 100755 | |
--- a/tools/configure | |
+++ b/tools/configure | |
@@ -135,7 +135,7 @@ app_set_lcd_size () { | |
findarmgcc() { | |
prefixtools arm-elf-eabi- | |
- gccchoice="4.4.4" | |
+ gccchoice="4.4.7" | |
} | |
# scan the $PATH for the given command | |
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh | |
index 34ecfce..5b65b4a 100755 | |
--- a/tools/rockboxdev.sh | |
+++ b/tools/rockboxdev.sh | |
@@ -211,7 +211,7 @@ build() { | |
./configure --prefix=$prefix $configure_params | |
;; | |
*) | |
- CFLAGS=-U_FORTIFY_SOURCE ../$toolname-$version/configure --target=$target --prefix=$prefix --enable-languages=c --disable-libssp --disable-docs $configure_params | |
+ CFLAGS="-std=gnu89 -U_FORTIFY_SOURCE" ../$toolname-$version/configure --target=$target --prefix=$prefix --enable-languages=c --disable-libssp --disable-docs $configure_params | |
;; | |
esac | |
@@ -389,7 +389,7 @@ do | |
;; | |
esac | |
build "binutils" "arm-elf-eabi" "2.20.1" "binutils-2.20.1-ld-thumb-interwork-long-call.diff binutils-2.20.1-texinfo-fix.diff" "$binopts --disable-werror" | |
- build "gcc" "arm-elf-eabi" "4.4.4" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.4.2_1.diff" "$gccopts MAKEINFO=missing" "gmp mpfr" | |
+ build "gcc" "arm-elf-eabi" "4.4.7" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.4.2_1.diff" "$gccopts MAKEINFO=missing" "gmp mpfr" | |
;; | |
[Rr]) | |
build_ctng "ypr0" "alsalib.tar.gz" "arm" "linux-gnueabi" | |
-- | |
2.8.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment