summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/gwps.c9
-rw-r--r--apps/gui/statusbar.c14
-rw-r--r--apps/gui/statusbar.h2
-rw-r--r--apps/gui/viewport.c34
-rw-r--r--apps/lang/english.lang45
-rw-r--r--apps/menus/display_menu.c6
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h10
-rw-r--r--apps/recorder/recording.c8
-rw-r--r--apps/settings.c1
-rw-r--r--apps/settings.h8
-rw-r--r--apps/settings_list.c12
12 files changed, 128 insertions, 23 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 0b41f88cdc..64b8939ee9 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -937,7 +937,14 @@ static void statusbar_toggle_handler(void *data)
937 } 937 }
938 else 938 else
939 { 939 {
940 vp->y = STATUSBAR_HEIGHT; 940 bool bar_at_top = true;
941#ifdef HAVE_REMOTE_LCD
942 if (i == SCREEN_REMOTE)
943 bar_at_top = global_settings.remote_statusbar != STATUSBAR_BOTTOM;
944 else
945#endif
946 bar_at_top = global_settings.statusbar != STATUSBAR_BOTTOM;
947 vp->y = bar_at_top?STATUSBAR_HEIGHT:0;
941 vp->height = screens[i].lcdheight - STATUSBAR_HEIGHT; 948 vp->height = screens[i].lcdheight - STATUSBAR_HEIGHT;
942 } 949 }
943 } 950 }
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index ec804ab41f..dca4169603 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -263,10 +263,20 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
263 memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) 263 memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info)))
264 { 264 {
265 struct viewport vp; 265 struct viewport vp;
266 bool bar_at_top = true;
266 viewport_set_defaults(&vp, display->screen_type); 267 viewport_set_defaults(&vp, display->screen_type);
267 vp.height = STATUSBAR_HEIGHT; 268 vp.height = STATUSBAR_HEIGHT;
268 vp.x = STATUSBAR_X_POS; 269 vp.x = STATUSBAR_X_POS;
269 vp.y = STATUSBAR_Y_POS; 270#ifdef HAVE_REMOTE_LCD
271 if (display->screen_type == SCREEN_REMOTE)
272 bar_at_top = global_settings.remote_statusbar != STATUSBAR_BOTTOM;
273 else
274#endif
275 bar_at_top = global_settings.statusbar != STATUSBAR_BOTTOM;
276 if (bar_at_top)
277 vp.y = 0;
278 else
279 vp.y = display->lcdheight - STATUSBAR_HEIGHT;
270 display->set_viewport(&vp); 280 display->set_viewport(&vp);
271 display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 281 display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
272 display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); 282 display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT);
@@ -814,7 +824,7 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars,
814 } 824 }
815} 825}
816 826
817void gui_statusbar_changed(bool enabled) 827void gui_statusbar_changed(int enabled)
818{ 828{
819 (void)enabled; 829 (void)enabled;
820 send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL); 830 send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index f6203c22d9..db0ff9d780 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -98,6 +98,6 @@ struct gui_syncstatusbar
98 98
99extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars); 99extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars);
100extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw); 100extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw);
101void gui_statusbar_changed(bool enabled); 101void gui_statusbar_changed(int enabled);
102 102
103#endif /*_GUI_STATUSBAR_H_*/ 103#endif /*_GUI_STATUSBAR_H_*/
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 22d3eb3eb8..67f63e349b 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -49,30 +49,47 @@ int viewport_get_nb_lines(struct viewport *vp)
49 49
50static bool showing_bars(enum screen_type screen) 50static bool showing_bars(enum screen_type screen)
51{ 51{
52 bool ignore = statusbar_enabled & VP_SB_IGNORE_SETTING(screen);
52 if (statusbar_enabled & VP_SB_ONSCREEN(screen)) 53 if (statusbar_enabled & VP_SB_ONSCREEN(screen))
54 {
53#ifdef HAVE_LCD_BITMAP 55#ifdef HAVE_LCD_BITMAP
54 return global_settings.statusbar || 56#ifdef HAVE_REMOTE_LCD
55 (statusbar_enabled & VP_SB_IGNORE_SETTING(screen)); 57 if (screen == SCREEN_REMOTE)
58 return global_settings.remote_statusbar || ignore;
59#endif
60 return global_settings.statusbar || ignore;
56#else 61#else
57 return true; 62 return true;
58#endif 63#endif
64 }
59 return false; 65 return false;
60} 66}
61 67
62void viewport_set_defaults(struct viewport *vp, enum screen_type screen) 68void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
63{ 69{
70 bool bar_at_top = true;
64 vp->x = 0; 71 vp->x = 0;
65 vp->width = screens[screen].lcdwidth; 72 vp->width = screens[screen].lcdwidth;
66 73
67#ifdef HAVE_LCD_BITMAP 74#ifdef HAVE_LCD_BITMAP
68 vp->drawmode = DRMODE_SOLID; 75 vp->drawmode = DRMODE_SOLID;
69 vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ 76 vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */
70 77#ifdef HAVE_REMOTE_LCD
71 vp->y = showing_bars(screen)?STATUSBAR_HEIGHT:0; 78 if (screen == SCREEN_REMOTE)
79 bar_at_top = global_settings.remote_statusbar != STATUSBAR_BOTTOM;
80 else
81#endif
82 bar_at_top = global_settings.statusbar != STATUSBAR_BOTTOM;
83
84 vp->height = screens[screen].lcdheight;
85 if (bar_at_top && showing_bars(screen))
86 vp->y = STATUSBAR_HEIGHT;
87 else
88 vp->y = 0;
72#else 89#else
73 vp->y = 0; 90 vp->y = 0;
74#endif 91#endif
75 vp->height = screens[screen].lcdheight - vp->y; 92 vp->height = screens[screen].lcdheight - (showing_bars(screen)?STATUSBAR_HEIGHT:0);
76 93
77#ifdef HAVE_REMOTE_LCD 94#ifdef HAVE_REMOTE_LCD
78 /* We only need this test if there is a remote LCD */ 95 /* We only need this test if there is a remote LCD */
@@ -136,5 +153,12 @@ void viewportmanager_draw_statusbars(void* data)
136void viewportmanager_statusbar_changed(void* data) 153void viewportmanager_statusbar_changed(void* data)
137{ 154{
138 (void)data; 155 (void)data;
156 statusbar_enabled = 0;
157 if (global_settings.statusbar != STATUSBAR_OFF)
158 statusbar_enabled = VP_SB_ONSCREEN(SCREEN_MAIN);
159#ifdef HAVE_REMOTE_LCD
160 if (global_settings.remote_statusbar != STATUSBAR_OFF)
161 statusbar_enabled |= VP_SB_ONSCREEN(SCREEN_REMOTE);
162#endif
139 viewportmanager_set_statusbar(statusbar_enabled); 163 viewportmanager_set_statusbar(statusbar_enabled);
140} 164}
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index f75cdae3a4..7d1e242c6c 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -12559,3 +12559,48 @@
12559 touchscreen: "Reset Calibration" 12559 touchscreen: "Reset Calibration"
12560 </voice> 12560 </voice>
12561</phrase> 12561</phrase>
12562<phrase>
12563 id: LANG_STATUSBAR_TOP
12564 desc: in Settings -> General -> Display -> statusbar
12565 user: core
12566 <source>
12567 *: "Top"
12568 </source>
12569 <dest>
12570 *: "Top"
12571 </dest>
12572 <voice>
12573 *: "Top"
12574 </voice>
12575</phrase>
12576<phrase>
12577 id: LANG_STATUSBAR_BOTTOM
12578 desc: in Settings -> General -> Display -> statusbar
12579 user: core
12580 <source>
12581 *: "Bottom"
12582 </source>
12583 <dest>
12584 *: "Bottom"
12585 </dest>
12586 <voice>
12587 *: "Bottom"
12588 </voice>
12589</phrase>
12590<phrase>
12591 id: LANG_REMOTE_STATUSBAR
12592 desc: in Settings -> General -> Display -> statusbar
12593 user: core
12594 <source>
12595 *: none
12596 remote: "Remote Statusbar"
12597 </source>
12598 <dest>
12599 *: none
12600 remote: "Remote Statusbar"
12601 </dest>
12602 <voice>
12603 *: none
12604 remote: "Remote Statusbar"
12605 </voice>
12606</phrase>
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index aee9c1828d..05b5bd268d 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -321,6 +321,9 @@ static int statusbar_callback(int action,const struct menu_item_ex *this_item)
321} 321}
322MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL); 322MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL);
323MENUITEM_SETTING(statusbar, &global_settings.statusbar, statusbar_callback); 323MENUITEM_SETTING(statusbar, &global_settings.statusbar, statusbar_callback);
324#ifdef HAVE_REMOTE_LCD
325MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, statusbar_callback);
326#endif
324#if CONFIG_KEYPAD == RECORDER_PAD 327#if CONFIG_KEYPAD == RECORDER_PAD
325MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL); 328MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL);
326#endif 329#endif
@@ -328,6 +331,9 @@ MENUITEM_SETTING(volume_type, &global_settings.volume_type, NULL);
328MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL); 331MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL);
329MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, Icon_NOICON, 332MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, Icon_NOICON,
330 &scrollbar_item, &statusbar, 333 &scrollbar_item, &statusbar,
334#ifdef HAVE_REMOTE_LCD
335 &remote_statusbar,
336#endif
331#if CONFIG_KEYPAD == RECORDER_PAD 337#if CONFIG_KEYPAD == RECORDER_PAD
332 &buttonbar, 338 &buttonbar,
333#endif 339#endif
diff --git a/apps/plugin.c b/apps/plugin.c
index ff80776f7e..d6a5d067ce 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -468,6 +468,7 @@ static const struct plugin_api rockbox_api = {
468 playlist_remove_all_tracks, 468 playlist_remove_all_tracks,
469 playlist_create, 469 playlist_create,
470 playlist_insert_track, 470 playlist_insert_track,
471 playlist_insert_directory,
471 playlist_shuffle, 472 playlist_shuffle,
472 PREFIX(audio_play), 473 PREFIX(audio_play),
473 audio_stop, 474 audio_stop,
@@ -658,7 +659,6 @@ static const struct plugin_api rockbox_api = {
658 appsversion, 659 appsversion,
659 /* new stuff at the end, sort into place next time 660 /* new stuff at the end, sort into place next time
660 the API gets incompatible */ 661 the API gets incompatible */
661 playlist_insert_directory,
662}; 662};
663 663
664int plugin_load(const char* plugin, const void* parameter) 664int plugin_load(const char* plugin, const void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index db16800309..f3d4c23e8a 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -128,12 +128,12 @@ void* plugin_get_buffer(size_t *buffer_size);
128#define PLUGIN_MAGIC 0x526F634B /* RocK */ 128#define PLUGIN_MAGIC 0x526F634B /* RocK */
129 129
130/* increase this every time the api struct changes */ 130/* increase this every time the api struct changes */
131#define PLUGIN_API_VERSION 158 131#define PLUGIN_API_VERSION 159
132 132
133/* update this to latest version if a change to the api struct breaks 133/* update this to latest version if a change to the api struct breaks
134 backwards compatibility (and please take the opportunity to sort in any 134 backwards compatibility (and please take the opportunity to sort in any
135 new function which are "waiting" at the end of the function table) */ 135 new function which are "waiting" at the end of the function table) */
136#define PLUGIN_MIN_API_VERSION 157 136#define PLUGIN_MIN_API_VERSION 159
137 137
138/* plugin return codes */ 138/* plugin return codes */
139enum plugin_status { 139enum plugin_status {
@@ -595,6 +595,9 @@ struct plugin_api {
595 int (*playlist_create)(const char *dir, const char *file); 595 int (*playlist_create)(const char *dir, const char *file);
596 int (*playlist_insert_track)(struct playlist_info* playlist, 596 int (*playlist_insert_track)(struct playlist_info* playlist,
597 const char *filename, int position, bool queue, bool sync); 597 const char *filename, int position, bool queue, bool sync);
598 int (*playlist_insert_directory)(struct playlist_info* playlist,
599 const char *dirname, int position, bool queue,
600 bool recurse);
598 int (*playlist_shuffle)(int random_seed, int start_index); 601 int (*playlist_shuffle)(int random_seed, int start_index);
599 void (*audio_play)(long offset); 602 void (*audio_play)(long offset);
600 void (*audio_stop)(void); 603 void (*audio_stop)(void);
@@ -821,9 +824,6 @@ struct plugin_api {
821 const char *appsversion; 824 const char *appsversion;
822 /* new stuff at the end, sort into place next time 825 /* new stuff at the end, sort into place next time
823 the API gets incompatible */ 826 the API gets incompatible */
824 int (*playlist_insert_directory)(struct playlist_info* playlist,
825 const char *dirname, int position, bool queue,
826 bool recurse);
827}; 827};
828 828
829/* plugin header */ 829/* plugin header */
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 393bd356b8..d7ab9c795c 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -1112,14 +1112,12 @@ bool recording_screen(bool no_source)
1112 else 1112 else
1113 compact_view[i] = false; 1113 compact_view[i] = false;
1114 } 1114 }
1115 vp_list[i] = *v; /* get a copy now so it can be sized more easily */
1115 v->height = (font_get(v->font)->height)*(compact_view[i] ? 3 : 4); 1116 v->height = (font_get(v->font)->height)*(compact_view[i] ? 3 : 4);
1116 1117
1117 /* list section, rest of the screen */ 1118 /* list section, rest of the screen */
1118 v = &vp_list[i]; 1119 vp_list[i].y = vp_top[i].y + vp_top[i].height;
1119 viewport_set_defaults(v, i); 1120 vp_list[i].height -= vp_list[i].y;
1120 v->font = vp_top[i].font;
1121 v->y = vp_top[i].y + vp_top[i].height;
1122 v->height = screens[i].lcdheight - v->y; /* the rest */
1123 screens[i].set_viewport(&vp_top[i]); /* req for next calls */ 1121 screens[i].set_viewport(&vp_top[i]); /* req for next calls */
1124 1122
1125 screens[i].getstringsize("W", &w, &h); 1123 screens[i].getstringsize("W", &w, &h);
diff --git a/apps/settings.c b/apps/settings.c
index 4616a7f49d..e2f40a1f44 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -981,6 +981,7 @@ void settings_apply(bool read_disk)
981#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 981#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
982 enc_global_settings_apply(); 982 enc_global_settings_apply();
983#endif 983#endif
984 send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
984 list_init_viewports(NULL); 985 list_init_viewports(NULL);
985 send_event(GUI_EVENT_ACTIONUPDATE, (void*)true); 986 send_event(GUI_EVENT_ACTIONUPDATE, (void*)true);
986} 987}
diff --git a/apps/settings.h b/apps/settings.h
index e0ee4164bf..93a998ea1c 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -149,6 +149,9 @@ enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE, REPLAYGAIN_OF
149/* show path types */ 149/* show path types */
150enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL }; 150enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL };
151 151
152/* statusbar visilibility */
153enum { STATUSBAR_OFF = 0, STATUSBAR_TOP, STATUSBAR_BOTTOM };
154
152/* Alarm settings */ 155/* Alarm settings */
153#ifdef HAVE_RTC_ALARM 156#ifdef HAVE_RTC_ALARM
154enum { ALARM_START_WPS = 0, 157enum { ALARM_START_WPS = 0,
@@ -535,7 +538,10 @@ struct user_settings
535 int volume_type; /* how volume is displayed: 0=graphic, 1=percent */ 538 int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
536 int battery_display; /* how battery is displayed: 0=graphic, 1=percent */ 539 int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
537 bool show_icons; /* 0=hide 1=show */ 540 bool show_icons; /* 0=hide 1=show */
538 bool statusbar; /* 0=hide, 1=show */ 541 int statusbar; /* STATUSBAR_* enum values */
542#ifdef HAVE_REMOTE_LCD
543 int remote_statusbar;
544#endif
539 545
540#if CONFIG_KEYPAD == RECORDER_PAD 546#if CONFIG_KEYPAD == RECORDER_PAD
541 bool buttonbar; /* 0=hide, 1=show */ 547 bool buttonbar; /* 0=hide, 1=show */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 9e40cbd301..9cfd9aafc5 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -591,8 +591,16 @@ const struct settings_list settings[] = {
591 ID2P(LANG_INVERT_CURSOR_POINTER), 591 ID2P(LANG_INVERT_CURSOR_POINTER),
592 ID2P(LANG_INVERT_CURSOR_BAR)), 592 ID2P(LANG_INVERT_CURSOR_BAR)),
593 #endif 593 #endif
594 OFFON_SETTING(F_THEMESETTING|F_TEMPVAR, statusbar, 594 CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, statusbar,
595 LANG_STATUS_BAR, true,"statusbar", gui_statusbar_changed), 595 LANG_STATUS_BAR, STATUSBAR_TOP, "statusbar","off,top,bottom",
596 gui_statusbar_changed, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
597 ID2P(LANG_STATUSBAR_BOTTOM)),
598#ifdef HAVE_REMOTE_LCD
599 CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, remote_statusbar,
600 LANG_REMOTE_STATUSBAR, STATUSBAR_TOP, "remote statusbar","off,top,bottom",
601 gui_statusbar_changed, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
602 ID2P(LANG_STATUSBAR_BOTTOM)),
603#endif
596 OFFON_SETTING(0,scrollbar, LANG_SCROLL_BAR, true,"scrollbar", NULL), 604 OFFON_SETTING(0,scrollbar, LANG_SCROLL_BAR, true,"scrollbar", NULL),
597#if CONFIG_KEYPAD == RECORDER_PAD 605#if CONFIG_KEYPAD == RECORDER_PAD
598 OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL), 606 OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL),