summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2006-11-06 10:11:51 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2006-11-06 10:11:51 +0000
commit6a1161b634e43225ae12bf669ad3bbe1ea1edab0 (patch)
tree57a5b054cca637e51263077e8405bb83c62d53e2 /apps
parent2f444aac2910cebeed988ea22d442456a4729ea4 (diff)
downloadrockbox-6a1161b634e43225ae12bf669ad3bbe1ea1edab0.tar.gz
rockbox-6a1161b634e43225ae12bf669ad3bbe1ea1edab0.zip
dont allow the volume setting to wrap
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11445 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/list.c24
-rw-r--r--apps/gui/list.h11
-rw-r--r--apps/menu.c2
-rw-r--r--apps/playlist_catalog.c2
-rw-r--r--apps/playlist_viewer.c4
-rw-r--r--apps/plugin.h3
-rw-r--r--apps/plugins/random_folder_advance_config.c2
-rw-r--r--apps/plugins/text_editor.c2
-rw-r--r--apps/screens.c2
-rw-r--r--apps/settings.c11
-rw-r--r--apps/tree.c2
11 files changed, 46 insertions, 19 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 0653343604..1f23ca5e68 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -720,18 +720,32 @@ void gui_synclist_scroll_left(struct gui_synclist * lists)
720} 720}
721#endif /* HAVE_LCD_BITMAP */ 721#endif /* HAVE_LCD_BITMAP */
722 722
723unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) 723unsigned gui_synclist_do_button(struct gui_synclist * lists,
724 unsigned button,enum list_wrap wrap)
724{ 725{
725#ifdef HAVE_LCD_BITMAP 726#ifdef HAVE_LCD_BITMAP
726 static bool scrolling_left = false; 727 static bool scrolling_left = false;
727#endif 728#endif
728 729
729 gui_synclist_limit_scroll(lists, true); 730 switch (wrap)
731 {
732 case LIST_WRAP_ON:
733 gui_synclist_limit_scroll(lists, false);
734 break;
735 case LIST_WRAP_OFF:
736 gui_synclist_limit_scroll(lists, true);
737 break;
738 case LIST_WRAP_UNLESS_HELD:
739 if (button == ACTION_STD_PREVREPEAT ||
740 button == ACTION_STD_NEXTREPEAT)
741 gui_synclist_limit_scroll(lists, true);
742 else gui_synclist_limit_scroll(lists, false);
743 break;
744 };
745
730 switch(button) 746 switch(button)
731 { 747 {
732 case ACTION_STD_PREV: 748 case ACTION_STD_PREV:
733 gui_synclist_limit_scroll(lists, false);
734
735 case ACTION_STD_PREVREPEAT: 749 case ACTION_STD_PREVREPEAT:
736 gui_synclist_select_previous(lists); 750 gui_synclist_select_previous(lists);
737 gui_synclist_draw(lists); 751 gui_synclist_draw(lists);
@@ -739,8 +753,6 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
739 return ACTION_STD_PREV; 753 return ACTION_STD_PREV;
740 754
741 case ACTION_STD_NEXT: 755 case ACTION_STD_NEXT:
742 gui_synclist_limit_scroll(lists, false);
743
744 case ACTION_STD_NEXTREPEAT: 756 case ACTION_STD_NEXTREPEAT:
745 gui_synclist_select_next(lists); 757 gui_synclist_select_next(lists);
746 gui_synclist_draw(lists); 758 gui_synclist_draw(lists);
diff --git a/apps/gui/list.h b/apps/gui/list.h
index 914563a597..e61780ffe3 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -26,6 +26,12 @@
26 26
27#define SCROLLBAR_WIDTH 6 27#define SCROLLBAR_WIDTH 6
28 28
29enum list_wrap {
30 LIST_WRAP_ON = 0,
31 LIST_WRAP_OFF,
32 LIST_WRAP_UNLESS_HELD,
33};
34
29/* 35/*
30 * The gui_list is based on callback functions, if you want the list 36 * The gui_list is based on callback functions, if you want the list
31 * to display something you have to provide it a function that 37 * to display something you have to provide it a function that
@@ -312,10 +318,13 @@ void gui_synclist_scroll_left(struct gui_synclist * lists);
312 * returns the action taken if any, 0 else 318 * returns the action taken if any, 0 else
313 * - lists : the synchronized lists 319 * - lists : the synchronized lists
314 * - button : the keycode of a pressed button 320 * - button : the keycode of a pressed button
321 * - specifies weather to allow the list to wrap or not, values at top of page
315 * returned value : 322 * returned value :
316 * - ACTION_STD_NEXT when moving forward (next item or pgup) 323 * - ACTION_STD_NEXT when moving forward (next item or pgup)
317 * - ACTION_STD_PREV when moving backward (previous item or pgdown) 324 * - ACTION_STD_PREV when moving backward (previous item or pgdown)
318 */ 325 */
319extern unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button); 326extern unsigned gui_synclist_do_button(struct gui_synclist * lists,
327 unsigned button,
328 enum list_wrap);
320 329
321#endif /* _GUI_LIST_H_ */ 330#endif /* _GUI_LIST_H_ */
diff --git a/apps/menu.c b/apps/menu.c
index e0a439e22e..faed2cc88a 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -141,7 +141,7 @@ int menu_show(int m)
141 if( menus[m].callback != NULL ) 141 if( menus[m].callback != NULL )
142 key = menus[m].callback(key, m); 142 key = menus[m].callback(key, m);
143 /* If moved, "say" the entry under the cursor */ 143 /* If moved, "say" the entry under the cursor */
144 if(gui_synclist_do_button(&(menus[m].synclist), key)) 144 if(gui_synclist_do_button(&(menus[m].synclist), key,LIST_WRAP_UNLESS_HELD))
145 menu_talk_selected(m); 145 menu_talk_selected(m);
146 switch( key ) { 146 switch( key ) {
147 case ACTION_STD_OK: 147 case ACTION_STD_OK:
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c
index 87034aad3b..0b047b0fee 100644
--- a/apps/playlist_catalog.c
+++ b/apps/playlist_catalog.c
@@ -248,7 +248,7 @@ static int display_playlists(char* playlist, bool view)
248 int button = get_action(CONTEXT_LIST,HZ/2); 248 int button = get_action(CONTEXT_LIST,HZ/2);
249 char* sel_file; 249 char* sel_file;
250 250
251 gui_synclist_do_button(&playlist_lists, button); 251 gui_synclist_do_button(&playlist_lists, button,LIST_WRAP_UNLESS_HELD);
252 252
253 sel_file = playlists[gui_synclist_get_sel_pos(&playlist_lists)]; 253 sel_file = playlists[gui_synclist_get_sel_pos(&playlist_lists)];
254 254
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 7c73b2bad9..87bbaa4b11 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -664,7 +664,7 @@ bool playlist_viewer_ex(char* filename)
664 /* Timeout so we can determine if play status has changed */ 664 /* Timeout so we can determine if play status has changed */
665 button = get_action(CONTEXT_TREE,HZ/2); 665 button = get_action(CONTEXT_TREE,HZ/2);
666 int list_action; 666 int list_action;
667 if( (list_action=gui_synclist_do_button(&playlist_lists, button))!=0 ) 667 if( (list_action=gui_synclist_do_button(&playlist_lists, button,LIST_WRAP_UNLESS_HELD))!=0 )
668 { 668 {
669 viewer.selected_track=gui_synclist_get_sel_pos(&playlist_lists); 669 viewer.selected_track=gui_synclist_get_sel_pos(&playlist_lists);
670 if(playlist_buffer_needs_reload(&viewer.buffer, 670 if(playlist_buffer_needs_reload(&viewer.buffer,
@@ -847,7 +847,7 @@ bool search_playlist(void)
847 while (!exit) 847 while (!exit)
848 { 848 {
849 button = get_action(CONTEXT_LIST,TIMEOUT_BLOCK); 849 button = get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
850 if (gui_synclist_do_button(&playlist_lists, button)) 850 if (gui_synclist_do_button(&playlist_lists, button,LIST_WRAP_UNLESS_HELD))
851 continue; 851 continue;
852 switch (button) 852 switch (button)
853 { 853 {
diff --git a/apps/plugin.h b/apps/plugin.h
index a7ed88985d..54d2702017 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -275,7 +275,8 @@ struct plugin_api {
275 void (*gui_synclist_scroll_right)(struct gui_synclist * lists); 275 void (*gui_synclist_scroll_right)(struct gui_synclist * lists);
276 void (*gui_synclist_scroll_left)(struct gui_synclist * lists); 276 void (*gui_synclist_scroll_left)(struct gui_synclist * lists);
277#endif 277#endif
278 unsigned (*gui_synclist_do_button)(struct gui_synclist * lists, unsigned button); 278 unsigned (*gui_synclist_do_button)(struct gui_synclist * lists,
279 unsigned button,enum list_wrap wrap);
279 280
280 /* button */ 281 /* button */
281 long (*button_get)(bool block); 282 long (*button_get)(bool block);
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c
index 7d055c4172..3b9f842873 100644
--- a/apps/plugins/random_folder_advance_config.c
+++ b/apps/plugins/random_folder_advance_config.c
@@ -184,7 +184,7 @@ void edit_list(void)
184 { 184 {
185 rb->gui_synclist_draw(&lists); 185 rb->gui_synclist_draw(&lists);
186 button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); 186 button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
187 if (rb->gui_synclist_do_button(&lists,button)) 187 if (rb->gui_synclist_do_button(&lists,button,LIST_WRAP_UNLESS_HELD))
188 continue; 188 continue;
189 selection = rb->gui_synclist_get_sel_pos(&lists); 189 selection = rb->gui_synclist_get_sel_pos(&lists);
190 switch (button) 190 switch (button)
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c
index 9f5412810d..449a88aa0a 100644
--- a/apps/plugins/text_editor.c
+++ b/apps/plugins/text_editor.c
@@ -349,7 +349,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
349 rb->gui_synclist_draw(&lists); 349 rb->gui_synclist_draw(&lists);
350 cur_sel = rb->gui_synclist_get_sel_pos(&lists); 350 cur_sel = rb->gui_synclist_get_sel_pos(&lists);
351 button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); 351 button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
352 if (rb->gui_synclist_do_button(&lists,button)) 352 if (rb->gui_synclist_do_button(&lists,button,LIST_WRAP_UNLESS_HELD))
353 continue; 353 continue;
354#ifdef HAVE_ADJUSTABLE_CPU_FREQ 354#ifdef HAVE_ADJUSTABLE_CPU_FREQ
355 rb->cpu_boost(0); 355 rb->cpu_boost(0);
diff --git a/apps/screens.c b/apps/screens.c
index 50f1055f90..8b69fdfee2 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -1241,7 +1241,7 @@ bool browse_id3(void)
1241 gui_syncstatusbar_draw(&statusbars, false); 1241 gui_syncstatusbar_draw(&statusbars, false);
1242 key = get_action(CONTEXT_LIST,HZ/2); 1242 key = get_action(CONTEXT_LIST,HZ/2);
1243 if(key!=ACTION_NONE && key!=ACTION_UNKNOWN 1243 if(key!=ACTION_NONE && key!=ACTION_UNKNOWN
1244 && !gui_synclist_do_button(&id3_lists, key)) 1244 && !gui_synclist_do_button(&id3_lists, key,LIST_WRAP_UNLESS_HELD))
1245 { 1245 {
1246 action_signalscreenchange(); 1246 action_signalscreenchange();
1247 return(default_event_handler(key) == SYS_USB_CONNECTED); 1247 return(default_event_handler(key) == SYS_USB_CONNECTED);
diff --git a/apps/settings.c b/apps/settings.c
index da5a461d7d..a4320eda7b 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -1982,9 +1982,14 @@ bool do_set_setting(const unsigned char* string, void *variable,
1982 bool done = false; 1982 bool done = false;
1983 struct gui_synclist lists; 1983 struct gui_synclist lists;
1984 int oldvalue; 1984 int oldvalue;
1985 bool allow_wrap = true;
1985 1986
1986 if (cb_data->type == INT) 1987 if (cb_data->type == INT)
1987 oldvalue = *(int*)variable; 1988 {
1989 oldvalue = *(int*)variable;
1990 if (variable == &global_settings.volume)
1991 allow_wrap = false;
1992 }
1988 else oldvalue = *(bool*)variable; 1993 else oldvalue = *(bool*)variable;
1989 1994
1990 gui_synclist_init(&lists,value_setting_get_name_cb,(void*)cb_data,false,1); 1995 gui_synclist_init(&lists,value_setting_get_name_cb,(void*)cb_data,false,1);
@@ -2008,8 +2013,8 @@ bool do_set_setting(const unsigned char* string, void *variable,
2008 action = get_action(CONTEXT_LIST,TIMEOUT_BLOCK); 2013 action = get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
2009 if (action == ACTION_NONE) 2014 if (action == ACTION_NONE)
2010 continue; 2015 continue;
2011 2016 if (gui_synclist_do_button(&lists,action,
2012 if (gui_synclist_do_button(&lists,action)) 2017 allow_wrap?LIST_WRAP_UNLESS_HELD:LIST_WRAP_OFF))
2013 { 2018 {
2014 if (global_settings.talk_menu) 2019 if (global_settings.talk_menu)
2015 { 2020 {
diff --git a/apps/tree.c b/apps/tree.c
index 772e2351bb..653da791a8 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -674,7 +674,7 @@ static bool dirbrowse(void)
674 } 674 }
675#endif 675#endif
676 button = get_action(CONTEXT_TREE,HZ/5); 676 button = get_action(CONTEXT_TREE,HZ/5);
677 returned_button = gui_synclist_do_button(&tree_lists, button); 677 returned_button = gui_synclist_do_button(&tree_lists, button,LIST_WRAP_UNLESS_HELD);
678 if (returned_button) 678 if (returned_button)
679 need_update = true; 679 need_update = true;
680 if (returned_button == ACTION_STD_CANCEL) 680 if (returned_button == ACTION_STD_CANCEL)