Total Members Voted: 20
New:- width/height of spacebar now toggable (between about 7 ("canvas" is about 6 pixels, so the actual minimum information bar can be set to ONE pixel, almost too small) pixels and 17 pixels, check it out)
- New Warning tresholds introduced, you can choose between treshold in MB and Percent.
- New RAW Counter treshold, you can set it so that the RAW counter blinks when for example under 10. Previous setting was hardcoded to 1. Also changed: No "Warning" String anymore, just blinking between warning color and OSD color.- Raw Counter now enabled by default
- new get statements available in ubasic: get_disk_size & get_free_disk_space - returns values in KB. you can build scripts now which stop when specific disk limit exceeded, for example.Divide by 1024 to have an "easier" calculation. This is my first fiddling around with ubasic, please test thoroughly.
as always: ugly code, i am relying on your advisories, tips & tricks to clean my code.
oh and another small question to the people who code for chdk but dont have write access to official trunk: how do you handle your code at home? have a local svn, but its always such a pain in the A$$ to make a diff vs. official trunk and merge when there is a new revision... any hints?
Cool. The little line if pixels is filled. Thanks. But .... umm ... the space icons (bar and SD card icon) are still getting color from the OSD Text color. Changing "Remaining Space Icon Color" has no effect on them.Did you change anything else from build 95 to 98 that I should look for to test?
I don't get what you mean by "between about 7". I see your code and it looks like the user can select from 10 different widths. But I'll try it in my camera tonite.
- added new color: file space icon BACKGROUND (easier reading with a dark transparent background).- filespace icons & text now actually USE the defined colors.- allbest made clock disappear when shutter half-press, i made it appear again- added new clock submenu (will add DST or timezone later, in this menu)- switch between 12/24h format of clock
Index: lang/english.lng===================================================================--- lang/english.lng (revision 330)+++ lang/english.lng (working copy)@@ -405,4 +405,7 @@ 307 " MB Treshold" 308 "Warning Unit" 309 " Warning treshold"-+310 "Clock Settings->"+311 "Clock Settings"+312 "Clock format"+313 "Remaining Space Background Color"Index: lang/german.lng===================================================================--- lang/german.lng (revision 330)+++ lang/german.lng (working copy)@@ -428,3 +428,7 @@ 307 " MB Untergrenze" 308 " Einheit der Warnung" 309 " Untergrenze Warnung"+310 "UhrzeitEinstellungen->"+311 "UhrzeitEinstellungen"+312 "Uhrzeit Format"+313 "Speicherplatz Hintergrund"Index: include/conf.h===================================================================--- include/conf.h (revision 330)+++ include/conf.h (working copy)@@ -35,6 +35,7 @@ int space_bar_width; int space_icon_show; int show_clock;+ int clock_format; int space_perc_show; int space_mb_show; int space_perc_warn;Index: core/gui_lang.c===================================================================--- core/gui_lang.c (revision 330)+++ core/gui_lang.c (working copy)@@ -390,6 +390,10 @@ "307 \" MB treshold\"\n" "308 \"Warning Unit\"\n" "309 \" Warning treshold\"\n"+"310 \"Clock Settings->\"\n"+"311 \"Clock Settings\"\n"+"312 \"Clock format\"\n"+"313 \"Remaining Space Background Color\"\n" ; //-------------------------------------------------------------------Index: core/conf.c===================================================================--- core/conf.c (revision 330)+++ core/conf.c (working copy)@@ -254,7 +254,7 @@ CONF_INFO(129, conf.histo_show_ev_grid, CONF_DEF_VALUE, i:0, NULL), CONF_INFO(130, conf.osd_color_warn, CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_RED), NULL),- CONF_INFO(131, conf.space_color, CONF_DEF_VALUE, cl:COLOR_WHITE, NULL),+ CONF_INFO(131, conf.space_color, CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL), CONF_INFO(132, conf.space_icon_show, CONF_DEF_VALUE, i:1, NULL), CONF_INFO(133, conf.space_icon_pos, CONF_DEF_PTR, ptr:&def_space_icon_pos, NULL), CONF_INFO(134, conf.space_perc_show, CONF_DEF_VALUE, i:0, NULL),@@ -279,6 +279,7 @@ CONF_INFO(151, conf.space_mb_warn, CONF_DEF_VALUE, i:20, NULL), CONF_INFO(152, conf.space_warn_type, CONF_DEF_VALUE, i:0, NULL), CONF_INFO(153, conf.remaining_raw_treshold, CONF_DEF_VALUE, i:0, NULL),+ CONF_INFO(154, conf.clock_format, CONF_DEF_VALUE, i:0, NULL), }; #define CONF_NUM (sizeof(conf_info)/sizeof(conf_info[0]))Index: core/gui_osd.c===================================================================--- core/gui_osd.c (revision 330)+++ core/gui_osd.c (working copy)@@ -802,11 +802,42 @@ ttm = localtime(&t); if (conf.show_clock == 1) {- sprintf(osd_buf, "%2u:%02u", ttm->tm_hour, ttm->tm_min);- draw_string(conf.clock_pos.x, conf.clock_pos.y, osd_buf, conf.osd_color);+ if (conf.clock_format == 0)+ {+ sprintf(osd_buf, "%2u:%02u", ttm->tm_hour, ttm->tm_min);+ draw_string(conf.clock_pos.x, conf.clock_pos.y, osd_buf, conf.osd_color);+ }+ else+ {+ sprintf(osd_buf, "%2u:%02u AM", ttm->tm_hour, ttm->tm_min);+ if ((ttm->tm_hour)==12)+ {+ sprintf(osd_buf, "%2u:%02u PM", ttm->tm_hour, ttm->tm_min);+ }+ if ((ttm->tm_hour)==00)+ {+ sprintf(osd_buf, "%2u:%02u AM", 12,ttm->tm_min);+ }+ if ((ttm->tm_hour)>12)+ {+ sprintf(osd_buf, "%2u:%02u PM", ttm->tm_hour-12, ttm->tm_min);+ }+ + if (conf.clock_pos.x<3*FONT_WIDTH)+ {+ draw_string(conf.clock_pos.x, conf.clock_pos.y, osd_buf, conf.osd_color);+ }+ else+ {+ draw_string(conf.clock_pos.x-3*FONT_WIDTH, conf.clock_pos.y, osd_buf, conf.osd_color);+ }+ }+ } else if (conf.show_clock == 2) {+ if (conf.clock_format == 0)+ { sprintf(osd_buf, "%2u:%02u:%02u", ttm->tm_hour, ttm->tm_min,ttm->tm_sec); if (conf.clock_pos.x<3*FONT_WIDTH) {@@ -816,8 +847,33 @@ { draw_string(conf.clock_pos.x-3*FONT_WIDTH, conf.clock_pos.y, osd_buf, conf.osd_color); }+ }+ else+ {+ sprintf(osd_buf, "%2u:%02u:%02u AM", ttm->tm_hour, ttm->tm_min,ttm->tm_sec);+ if ((ttm->tm_hour)==12)+ {+ sprintf(osd_buf, "%2u:%02u:%02u PM", ttm->tm_hour, ttm->tm_min,ttm->tm_sec);+ }+ if ((ttm->tm_hour)==00)+ {+ sprintf(osd_buf, "%2u:%02u:%02u AM", 12,ttm->tm_min,ttm->tm_sec);+ }+ if ((ttm->tm_hour)>12)+ {+ sprintf(osd_buf, "%2u:%02u:%02u PM", ttm->tm_hour-12, ttm->tm_min,ttm->tm_sec);+ }+ + if (conf.clock_pos.x<6*FONT_WIDTH)+ {+ draw_string(conf.clock_pos.x, conf.clock_pos.y, osd_buf, conf.osd_color);+ }+ else+ {+ draw_string(conf.clock_pos.x-6*FONT_WIDTH, conf.clock_pos.y, osd_buf, conf.osd_color);+ } } }-+} //-------------------------------------------------------------------Index: core/gui_lang.h===================================================================--- core/gui_lang.h (revision 330)+++ core/gui_lang.h (working copy)@@ -400,9 +400,14 @@ #define LANG_MENU_SPACE_WARN_MB 307 #define LANG_MENU_SPACE_WARN_TYPE 308 #define LANG_MENU_OSD_RAW_TRESHOLD 309+#define LANG_MENU_CLOCK_SETTINGS 310+#define LANG_MENU_CLOCK_SETTINGS_TITLE 311+#define LANG_MENU_OSD_CLOCK_FORMAT 312+#define LANG_MENU_VIS_SPACE_ICON_BKG 313 + //--------------------------------------------------------------------#define GUI_LANG_ITEMS 309+#define GUI_LANG_ITEMS 313 //------------------------------------------------------------------- extern void gui_lang_init();Index: core/gui_space.c===================================================================--- core/gui_space.c (revision 330)+++ core/gui_space.c (working copy)@@ -19,17 +19,17 @@ static void gui_space_draw_spacebar_horizontal () { coord x;- color cl = conf.space_color&0xFF;+ color cl = conf.space_color; int perc = get_space_perc(),height = 2; float size = 0; if (conf.space_warn_type == 0){- cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);+ cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 1){- cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;+ cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 2){- cl = conf.space_color&0xFF;+ cl = conf.space_color; } // space icon / bar height = conf.space_bar_width+1;@@ -72,17 +72,17 @@ static void gui_space_draw_spacebar_vertical () { coord y;- color cl = conf.space_color&0xFF;+ color cl = conf.space_color; int perc = get_space_perc(), width = 2; float size = 0; if (conf.space_warn_type == 0){- cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);+ cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 1){- cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;+ cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 2){- cl = conf.space_color&0xFF;+ cl = conf.space_color; } // space icon / bar@@ -127,16 +127,16 @@ static void gui_space_draw_icon () { coord x;- color cl = conf.space_color&0xFF;+ color cl = conf.space_color; int perc = get_space_perc(); if (conf.space_warn_type == 0){- cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);+ cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 1){- cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;+ cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 2){- cl = conf.space_color&0xFF;+ cl = conf.space_color; } int i; int le = 23;//length@@ -177,15 +177,15 @@ //------------------------------------------------------------------- static void gui_space_draw_percent(){ int perc = get_space_perc();- color cl = conf.space_color&0xFF;+ color cl = conf.space_color; if (conf.space_warn_type == 0){- cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);+ cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 1){- cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;+ cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 2){- cl = conf.space_color&0xFF;+ cl = conf.space_color; } sprintf(osd_buf, "%3d%%", get_space_perc()); osd_buf[5]=0;@@ -195,15 +195,15 @@ //------------------------------------------------------------------- static void gui_space_draw_mb() { int perc = get_space_perc();- color cl = conf.space_color&0xFF;+ color cl = conf.space_color; if (conf.space_warn_type == 0){- cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);+ cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 1){- cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;+ cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color); } if (conf.space_warn_type == 2){- cl = conf.space_color&0xFF;+ cl = conf.space_color; } sprintf(osd_buf, "%3d%M",GetFreeCardSpaceKb()/1024 ); osd_buf[5]=0;Index: core/gui.c===================================================================--- core/gui.c (revision 330)+++ core/gui.c (working copy)@@ -161,6 +161,7 @@ //static const char* gui_tv_enum(int change, int arg); const char* gui_user_menu_show_enum(int change, int arg); static const char* gui_show_clock_enum(int change, int arg);+static const char* gui_clock_format_enum(int change, int arg); static const char* gui_space_bar_enum(int change, int arg); static const char* gui_space_bar_size_enum(int change, int arg); static const char* gui_space_bar_width_enum(int change, int arg);@@ -337,6 +338,15 @@ }; static CMenu values_submenu = { LANG_MENU_OSD_VALUES_TITLE, /*cb_values_menu_change*/ NULL, values_submenu_items }; ++static CMenuItem clock_submenu_items[] = {+ {LANG_MENU_OSD_SHOW_CLOCK, MENUITEM_ENUM, (int*)gui_show_clock_enum },+ {LANG_MENU_OSD_CLOCK_FORMAT, MENUITEM_ENUM, (int*)gui_clock_format_enum },+ {LANG_MENU_BACK, MENUITEM_UP },+ {0}+};+static CMenu clock_submenu = { LANG_MENU_CLOCK_SETTINGS_TITLE, NULL, clock_submenu_items };+ static CMenuItem video_submenu_items[] = { {LANG_MENU_VIDEO_MODE, MENUITEM_ENUM, (int*)gui_video_mode_enum}, {LANG_MENU_VIDEO_BITRATE, MENUITEM_ENUM, (int*)gui_video_bitrate_enum}, @@ -430,6 +440,7 @@ {LANG_MENU_VIS_ZEBRA_OVER, MENUITEM_COLOR_FG, (int*)&conf.zebra_color }, {LANG_MENU_VIS_BATT_ICON, MENUITEM_COLOR_FG, (int*)&conf.batt_icon_color }, {LANG_MENU_VIS_SPACE_ICON, MENUITEM_COLOR_FG, (int*)&conf.space_color },+ {LANG_MENU_VIS_SPACE_ICON_BKG, MENUITEM_COLOR_BG, (int*)&conf.space_color }, {LANG_MENU_VIS_MENU_TEXT, MENUITEM_COLOR_FG, (int*)&conf.menu_color }, {LANG_MENU_VIS_MENU_BKG, MENUITEM_COLOR_BG, (int*)&conf.menu_color }, {LANG_MENU_VIS_READER_TEXT, MENUITEM_COLOR_FG, (int*)&conf.reader_color },@@ -463,8 +474,7 @@ {LANG_MENU_USER_MENU, MENUITEM_SUBMENU, (int*)&user_submenu}, {LANG_MENU_USER_MENU_ENABLE, MENUITEM_ENUM, (int*)gui_user_menu_show_enum }, {LANG_MENU_OSD_SHOW_STATES, MENUITEM_BOOL, &conf.show_state },- - {LANG_MENU_OSD_SHOW_CLOCK, MENUITEM_ENUM, (int*)gui_show_clock_enum },+ {LANG_MENU_CLOCK_SETTINGS, MENUITEM_SUBMENU, (int*)&clock_submenu }, {LANG_MENU_OSD_LAYOUT_EDITOR, MENUITEM_PROC, (int*)gui_draw_osd_le }, {LANG_MENU_OSD_VALUES, MENUITEM_SUBMENU, (int*)&values_submenu }, {LANG_MENU_OSD_DOF_CALC, MENUITEM_SUBMENU, (int*)&dof_submenu },@@ -821,6 +831,18 @@ return modes[conf.show_clock]; } +const char* gui_clock_format_enum(int change, int arg) {+ static const char* modes[]={ "24h", "12h"};++ conf.clock_format+=change;+ if (conf.clock_format<0)+ conf.clock_format=(sizeof(modes)/sizeof(modes[0]))-1;+ else if (conf.clock_format>=(sizeof(modes)/sizeof(modes[0])))+ conf.clock_format=0;++ return modes[conf.clock_format];+}+ const char* gui_space_bar_enum(int change, int arg) { static const char* modes[]={ "Don't", "Horizontal", "Vertical"}; @@ -1765,7 +1787,7 @@ gui_space_draw_osd(); } - if ((conf.show_clock) && (recreview_hold==0) && (!kbd_is_key_pressed(KEY_SHOOT_HALF))) {+ if ((conf.show_clock) && (recreview_hold==0)) { gui_osd_draw_clock(); }
Started by jvcleave General Chat
Started by Dee_Ann Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by PhyrePhoX General Discussion and Assistance
Started by jairbj Completed and Working Scripts
Started by BuckSkin « 1 2 3 » General Help and Assistance on using CHDK stable releases