Ignore:
Timestamp:
08/12/08 12:52:17 (5 years ago)
Author:
phyrephox
Message:

+ added taskviewer by reyalp http://chdk.setepontos.com/index.php/topic,2110.msg19622.html#msg19622
+ added Fishpeppers Boot Logo from here: http://chdk.setepontos.com/index.php/topic,2122.0.html
+ raw subtract for filebrowser by reyalp - http://chdk.setepontos.com/index.php/topic,2099.msg19362.html#msg19362

  • makefile changes:

added several docs in the /docs dir, these are "catted" together during compilation -> one big readme file's gonna be put into the zip. Also includes camera specific notes, if existing (placeholders for now) (thx for helping with this, Hacki).

  • Ixus 860is / SD870 - fixed ubasic_set_led (diff provided by FE50)
  • patched symboldmod and changed splashscreen a little (diff sent in by CHDKLover)
  • added toggle in scripts menu: now the saving of script params can be turned on/off (default: off)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/juciphox/core/gui.c

    r473 r479  
    3131#include "raw.h" 
    3232#include "curves.h" 
    33  
     33#include "gui_logo.h" 
    3434//------------------------------------------------------------------- 
    3535 
     
    146146static const char* gui_raw_prefix_enum(int change, int arg); 
    147147static const char* gui_raw_ext_enum(int change, int arg); 
     148static const char* gui_sub_batch_prefix_enum(int change, int arg); 
     149static const char* gui_sub_batch_ext_enum(int change, int arg); 
     150 
    148151static const char* gui_raw_nr_enum(int change, int arg); 
    149152static const char* gui_autoiso_shutter_enum(int change, int arg); 
     
    193196static const char* gui_override_disable_enum(int change, int arg); 
    194197static const char* gui_conf_curve_enum(int change, int arg); 
     198static const char* gui_debug_shortcut_enum(int change, int arg); 
     199static const char* gui_debug_display_enum(int change, int arg); 
     200static void gui_debug_shortcut(void); 
     201 
    195202void rinit(); 
    196203 
     
    207214static void cb_zebra_restore_osd(); 
    208215 
     216static int debug_tasklist_start; 
     217static int debug_display_direction=1; 
    209218// Menu definition 
    210219//------------------------------------------------------------------- 
     
    236245    {0x5d,LANG_MENU_SCRIPT_DEFAULT_VAL,     MENUITEM_PROC,                      (int*)gui_load_script_default }, 
    237246    {0x5e,LANG_MENU_SCRIPT_PARAM_SET,     MENUITEM_ENUM,                         (int*)gui_script_param_set_enum }, 
     247    {0x5c,LANG_MENU_SCRIPT_PARAM_SAVE,             MENUITEM_BOOL,                    &conf.script_param_save              },     
    238248    {0x0,(int)script_title,                 MENUITEM_SEPARATOR }, 
    239249//    {0x0,LANG_MENU_SCRIPT_CURRENT,          MENUITEM_SEPARATOR }, 
     
    317327 
    318328static CMenuItem debug_submenu_items[] = { 
    319     {0x5c,LANG_MENU_DEBUG_SHOW_PROPCASES,    MENUITEM_BOOL,          &debug_propcase_show }, 
    320     {0x5c,LANG_MENU_DEBUG_SHOW_PARAMETER_DATA,        MENUITEM_BOOL,          &debug_pardata_show }, 
     329    {0x5c,LANG_MENU_DEBUG_DISPLAY,           MENUITEM_ENUM,          (int*)gui_debug_display_enum }, 
    321330    {0x2a,LANG_MENU_DEBUG_PROPCASE_PAGE,     MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,   &debug_propcase_page, MENU_MINMAX(0, 128) }, 
     331    {0x2a,LANG_MENU_DEBUG_TASKLIST_START,    MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,   &debug_tasklist_start, MENU_MINMAX(0, 63) }, 
    322332    {0x5c,LANG_MENU_DEBUG_SHOW_MISC_VALS,    MENUITEM_BOOL,          &debug_vals_show }, 
    323333    {0x2a,LANG_MENU_DEBUG_MEMORY_BROWSER,    MENUITEM_PROC,          (int*)gui_draw_debug }, 
    324334    {0x2a,LANG_MENU_DEBUG_BENCHMARK,         MENUITEM_PROC,          (int*)gui_draw_bench }, 
    325     {0x5c,LANG_MENU_DEBUG_DUMP_RAM,          MENUITEM_BOOL,          &conf.ns_enable_memdump }, 
     335    {0x5c,LANG_MENU_DEBUG_SHORTCUT_ACTION,   MENUITEM_ENUM,          (int*)gui_debug_shortcut_enum }, 
    326336    {0x33,LANG_MENU_DEBUG_MAKE_BOOTABLE,     MENUITEM_PROC,             (int*)gui_menuproc_mkbootdisk }, 
    327337#if CAM_MULTIPART 
     
    661671    {0x5f,LANG_MENU_RAW_PREFIX,              MENUITEM_ENUM,      (int*)gui_raw_prefix_enum }, 
    662672    {0x5f,LANG_MENU_RAW_EXTENSION,           MENUITEM_ENUM,      (int*)gui_raw_ext_enum }, 
     673    {0x5f,LANG_MENU_SUB_PREFIX,              MENUITEM_ENUM,      (int*)gui_sub_batch_prefix_enum }, 
     674    {0x5f,LANG_MENU_SUB_EXTENSION,           MENUITEM_ENUM,      (int*)gui_sub_batch_ext_enum }, 
     675    {0x60,LANG_MENU_SUB_IN_DARK_VALUE,       MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,  &conf.sub_in_dark_value, MENU_MINMAX(0, 1023)}, 
     676    {0x60,LANG_MENU_SUB_OUT_DARK_VALUE,      MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX,  &conf.sub_out_dark_value, MENU_MINMAX(0, 1023)}, 
    663677    {0x2a,LANG_MENU_RAW_DEVELOP,             MENUITEM_PROC,      (int*)gui_raw_develop }, 
    664678    {0x5c,LANG_MENU_BAD_PIXEL_REMOVAL,       MENUITEM_ENUM,      (int*)gui_bad_pixel_enum }, 
     
    814828        if (change != 0) 
    815829        { 
     830                        if (conf.script_param_save) 
     831                                { 
    816832        save_params_values(0); 
    817          
     833      } 
    818834                conf.script_param_set += change; 
    819835                if (conf.script_param_set < 0) conf.script_param_set = (sizeof(modes)/sizeof(modes[0]))-1; else 
     
    911927//------------------------------------------------------------------- 
    912928const char* gui_raw_prefix_enum(int change, int arg) { 
    913     static const char* prefixes[]={ "IMG_", "CRW_", "SND_"}; 
    914  
    915929    conf.raw_prefix+=change; 
    916930    if (conf.raw_prefix<0) 
    917         conf.raw_prefix=(sizeof(prefixes)/sizeof(prefixes[0]))-1; 
    918     else if (conf.raw_prefix>=(sizeof(prefixes)/sizeof(prefixes[0]))) 
     931        conf.raw_prefix=NUM_IMG_PREFIXES-1; 
     932    else if (conf.raw_prefix>=NUM_IMG_PREFIXES) 
    919933        conf.raw_prefix=0; 
    920934 
    921     return prefixes[conf.raw_prefix]; 
     935    return img_prefixes[conf.raw_prefix]; 
    922936} 
    923937 
    924938//------------------------------------------------------------------- 
    925939const char* gui_raw_ext_enum(int change, int arg) { 
    926     static const char* exts[]={ ".JPG", ".CRW", ".CR2", ".THM", ".WAV"}; 
    927  
    928940    conf.raw_ext+=change; 
    929941    if (conf.raw_ext<0) 
    930         conf.raw_ext=(sizeof(exts)/sizeof(exts[0]))-1; 
    931     else if (conf.raw_ext>=(sizeof(exts)/sizeof(exts[0]))) 
     942        conf.raw_ext=NUM_IMG_EXTS-1; 
     943    else if (conf.raw_ext>=NUM_IMG_EXTS) 
    932944        conf.raw_ext=0; 
    933945 
    934     return exts[conf.raw_ext]; 
     946    return img_exts[conf.raw_ext]; 
     947} 
     948 
     949//------------------------------------------------------------------- 
     950const char* gui_sub_batch_prefix_enum(int change, int arg) { 
     951    conf.sub_batch_prefix+=change; 
     952    if (conf.sub_batch_prefix<0) 
     953        conf.sub_batch_prefix=NUM_IMG_PREFIXES-1; 
     954    else if (conf.sub_batch_prefix>=NUM_IMG_PREFIXES) 
     955        conf.sub_batch_prefix=0; 
     956 
     957    return img_prefixes[conf.sub_batch_prefix]; 
     958} 
     959 
     960//------------------------------------------------------------------- 
     961const char* gui_sub_batch_ext_enum(int change, int arg) { 
     962    conf.sub_batch_ext+=change; 
     963    if (conf.sub_batch_ext<0) 
     964        conf.sub_batch_ext=NUM_IMG_EXTS-1; 
     965    else if (conf.sub_batch_ext>=NUM_IMG_EXTS) 
     966        conf.sub_batch_ext=0; 
     967 
     968    return img_exts[conf.sub_batch_ext]; 
    935969} 
    936970 
     
    12571291//------------------------------------------------------------------- 
    12581292const char* gui_video_bitrate_enum(int change, int arg) { 
    1259     static const char* modes[]={ "0.25x", "0.5x","0.75x", "1x", "1.25x", "1.5x", "1.75x", "2x", "2.5x", "3x"}; 
    1260  
    12611293    conf.video_bitrate+=change; 
    12621294    if (conf.video_bitrate<0) 
    1263         conf.video_bitrate=sizeof(modes)/sizeof(modes[0])-1; 
    1264     else if (conf.video_bitrate>=(sizeof(modes)/sizeof(modes[0]))) 
     1295        conf.video_bitrate=VIDEO_BITRATE_STEPS-1; 
     1296    else if (conf.video_bitrate>=VIDEO_BITRATE_STEPS) 
    12651297        conf.video_bitrate=0; 
    12661298 
    12671299    shooting_video_bitrate_change(conf.video_bitrate); 
    12681300 
    1269     return modes[conf.video_bitrate]; 
     1301    return video_bitrate_strings[conf.video_bitrate]; 
    12701302} 
    12711303 
     
    15891621 int m=mode_get(); 
    15901622 gui_fselect_init(LANG_RAW_DEVELOP_SELECT_FILE, "A/DCIM", raw_fselect_cb); 
     1623} 
     1624 
     1625//------------------------------------------------------------------- 
     1626#define TASKLIST_MAX_LINES 12 // probably as much as will fit on screen 
     1627#define TASKLIST_NUM_TASKS 64 // should be enough ? 
     1628static void gui_debug_draw_tasklist(void) { 
     1629#ifndef CAM_DRYOS 
     1630    int tasklist[TASKLIST_NUM_TASKS]; // max number of tasks we will look at 
     1631    char buf[40]; // a single line of the list 
     1632    int n_tasks,n_show_tasks,show_start; 
     1633    const char *name; 
     1634    int i; 
     1635    n_tasks = task_id_list_get(tasklist,sizeof(tasklist)/sizeof(tasklist[0])); 
     1636    show_start = debug_tasklist_start; 
     1637    n_show_tasks = n_tasks - show_start; 
     1638    // auto adjust to show the last N tasks 
     1639    if(n_show_tasks < TASKLIST_MAX_LINES) { 
     1640        show_start = n_tasks - TASKLIST_MAX_LINES; 
     1641        if(show_start<0) 
     1642            show_start = 0; 
     1643         n_show_tasks = n_tasks - show_start; 
     1644    } 
     1645    else if( n_show_tasks > TASKLIST_MAX_LINES ) { 
     1646        n_show_tasks = TASKLIST_MAX_LINES; 
     1647    } 
     1648    sprintf(buf,"%d-%d of %d tasks %c",show_start,show_start+n_show_tasks,n_tasks,debug_display_direction > 0?'+':'-'); 
     1649    draw_string(64,0,buf, conf.osd_color); 
     1650    for( i = 0;  i < n_show_tasks; i++ ) { 
     1651        // TODO get full task info 
     1652        name = task_name(tasklist[show_start+i]); 
     1653        if ( !name || !*name ) { 
     1654            name = "(unknown)"; 
     1655        } 
     1656        sprintf(buf,"%10s %8X",name,tasklist[show_start+i]); 
     1657        draw_string(64,16+16*i,buf, conf.osd_color); 
     1658    } 
     1659#endif //CAM_DRYOS 
     1660} 
     1661 
     1662#define DEBUG_DISPLAY_NONE 0 
     1663#define DEBUG_DISPLAY_PROPS 1 
     1664#define DEBUG_DISPLAY_PARAMS 2 
     1665#define DEBUG_DISPLAY_TASKS 3 
     1666static const char * gui_debug_shortcut_enum(int change, int arg) { 
     1667    static const char* modes[]={ "None", "Dmp RAM", "Page"}; 
     1668 
     1669    conf.debug_shortcut_action += change; 
     1670    if (conf.debug_shortcut_action < 0)  
     1671        conf.debug_shortcut_action = sizeof(modes)/sizeof(modes[0])-1; 
     1672    else if (conf.debug_shortcut_action >= (sizeof(modes)/sizeof(modes[0]))) 
     1673        conf.debug_shortcut_action = 0; 
     1674     
     1675    return modes[conf.debug_shortcut_action];  
     1676} 
     1677 
     1678static const char * gui_debug_display_enum(int change, int arg) { 
     1679    static const char* modes[]={ "None", "Props", "Params", "Tasks"}; 
     1680 
     1681    conf.debug_display += change; 
     1682    if (conf.debug_display < 0)  
     1683        conf.debug_display=sizeof(modes)/sizeof(modes[0])-1; 
     1684    else if (conf.debug_display >= (sizeof(modes)/sizeof(modes[0]))) 
     1685        conf.debug_display = 0; 
     1686     
     1687    return modes[conf.debug_display];  
     1688} 
     1689 
     1690static void gui_debug_shortcut(void) { 
     1691    static int lastcall = -1; 
     1692    int t=get_tick_count(); 
     1693    if ( lastcall != -1) { 
     1694        if (t-lastcall <= 400) 
     1695            debug_display_direction = -debug_display_direction; 
     1696    } 
     1697    lastcall=t; 
     1698    switch(conf.debug_shortcut_action) { 
     1699        case 1: 
     1700            dump_memory(); 
     1701        break; 
     1702        case 2: 
     1703            if(conf.debug_display == DEBUG_DISPLAY_TASKS) { 
     1704                debug_tasklist_start += debug_display_direction*(TASKLIST_MAX_LINES-2); // a little intentional overlap 
     1705                if(debug_tasklist_start >= TASKLIST_NUM_TASKS || debug_tasklist_start < 0) 
     1706                    debug_tasklist_start = 0; 
     1707            } 
     1708            else if (conf.debug_display == DEBUG_DISPLAY_PROPS || conf.debug_display == DEBUG_DISPLAY_PARAMS) { 
     1709                debug_propcase_page += debug_display_direction*1; 
     1710                if(debug_propcase_page > 128 || debug_propcase_page < 0)  
     1711                    debug_propcase_page = 0; 
     1712            } 
     1713        break; 
     1714    } 
    15911715} 
    15921716 
     
    18471971        case GUI_MODE_ALT: 
    18481972            if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) { 
    1849                 if (conf.ns_enable_memdump) dump_memory();  
     1973                if (conf.debug_shortcut_action > 0) gui_debug_shortcut();  
    18501974#if !CAM_HAS_ERASE_BUTTON && CAM_CAN_SD_OVERRIDE 
    18511975                else if (!shooting_get_common_focus_mode()) 
     
    21252249    } 
    21262250     
    2127     mode_video = ((m&MODE_SHOOTING_MASK)==MODE_VIDEO_STD ||  
    2128                                  (m&MODE_SHOOTING_MASK)==MODE_VIDEO_SPEED ||   
    2129                                  (m&MODE_SHOOTING_MASK)==MODE_VIDEO_COMPACT || 
    2130                                  (m&MODE_SHOOTING_MASK)==MODE_VIDEO_MY_COLORS ||  
    2131                                  (m&MODE_SHOOTING_MASK)==MODE_VIDEO_COLOR_ACCENT ||  
    2132                  (m&MODE_SHOOTING_MASK)==MODE_VIDEO_TIME_LAPSE); 
    2133      
    2134      
     2251        // TODO some of the ifs below should probably use this 
     2252        mode_video = MODE_IS_VIDEO(m); 
     2253 
    21352254    mode_photo = (m&MODE_MASK) == MODE_PLAY ||  
    21362255                 !( mode_video || 
     
    21832302            gui_grid_draw_osd(1); 
    21842303        } 
    2185         if ((gui_mode==GUI_MODE_NONE || gui_mode==GUI_MODE_ALT) && (((kbd_is_key_pressed(KEY_SHOOT_HALF) || (state_kbd_script_run) || (shooting_get_common_focus_mode())) && (mode_photo || (m&MODE_SHOOTING_MASK)==MODE_STITCH )) || (mode_video && conf.show_values_in_video) )) { 
     2304        if ((gui_mode==GUI_MODE_NONE || gui_mode==GUI_MODE_ALT) && (((kbd_is_key_pressed(KEY_SHOOT_HALF) || (state_kbd_script_run) || (shooting_get_common_focus_mode())) && (mode_photo || (m&MODE_SHOOTING_MASK)==MODE_STITCH )) || ((mode_video || movie_status > 1) && conf.show_values_in_video) )) { 
    21862305                  
    21872306           if (conf.show_dof!=DOF_DONT_SHOW) gui_osd_calc_dof(); 
     
    21912310           if (conf.values_show_real_iso || conf.values_show_market_iso || conf.values_show_ev_seted || conf.values_show_ev_measured || conf.values_show_bv_measured || conf.values_show_bv_seted || conf.values_show_overexposure || conf.values_show_canon_overexposure) gui_osd_calc_expo_param();                               
    21922311        } 
    2193         if (conf.show_state && !mode_video) gui_osd_draw_state(); 
     2312        if (conf.show_state) gui_osd_draw_state(); 
    21942313        if (conf.save_raw && conf.show_raw_state && !mode_video && (!kbd_is_key_pressed(KEY_SHOOT_HALF))) gui_osd_draw_raw_info(); 
    21952314         
    2196             if ((conf.show_values==SHOW_ALWAYS && mode_photo) || (mode_video && conf.show_values_in_video) || ((kbd_is_key_pressed(KEY_SHOOT_HALF) || (recreview_hold==1)) && (conf.show_values==SHOW_HALF))) 
     2315            if ((conf.show_values==SHOW_ALWAYS && mode_photo) || ((mode_video || movie_status > 1)&& conf.show_values_in_video) || ((kbd_is_key_pressed(KEY_SHOOT_HALF) || (recreview_hold==1)) && (conf.show_values==SHOW_HALF))) 
    21972316                   gui_osd_draw_values(1); 
    21982317        else if  (shooting_get_common_focus_mode() && mode_photo && conf.show_values && !(conf.show_dof==DOF_SHOW_IN_DOF) )    
     
    22192338        gui_osd_draw_temp(); 
    22202339      } 
    2221  if (conf.show_movie_time > 0) 
     2340 if (conf.show_movie_time > 0 && (mode_video || movie_status > 1)) 
    22222341 { 
    22232342 gui_osd_draw_movie_time_left(); 
    2224   
    2225  if ((movie_status > 1) && (conf.fast_movie_quality_control==1)){ 
    2226     if (conf.video_mode == 0 ) 
    2227         { 
    2228     gui_print_osd_state_string_chr("Bitrate: ",gui_video_bitrate_enum(0,0)); 
    2229         } 
    2230         else 
    2231                 { 
    2232         gui_print_osd_state_string_int("Quality: ",conf.video_quality); 
    2233     } 
    2234  } 
    22352343} 
    22362344  
     
    22702378        static char sbuf[100]; 
    22712379    int r,i, p, len; 
    2272     if (debug_propcase_show){ 
     2380    if (conf.debug_display == DEBUG_DISPLAY_PROPS){ 
    22732381 
    22742382        for (i=0;i<10;i++){ 
     
    22812389    } 
    22822390 
    2283 if (debug_pardata_show){ 
     2391    if (conf.debug_display == DEBUG_DISPLAY_PARAMS){ 
    22842392        extern long* FlashParamsTable[];  
    22852393        char s[30]; 
     
    23082416   } 
    23092417 
     2418    if(conf.debug_display == DEBUG_DISPLAY_TASKS) { 
     2419        gui_debug_draw_tasklist(); 
     2420    } 
    23102421 
    23112422    if (ubasic_error){ 
     
    24432554    int i, l; 
    24442555   // color cl = MAKE_COLOR((gui_splash_mode==MODE_REC)?0xDA:0xD9, COLOR_WHITE); 
    2445  color cl = MAKE_COLOR(COLOR_RED, COLOR_WHITE); 
     2556    color cl = MAKE_COLOR(COLOR_RED, COLOR_WHITE); 
    24462557 
    24472558 
     
    24562567    w=w*FONT_WIDTH+10; 
    24572568 
    2458     x = (screen_width-w)>>1; y = (screen_height-h)>>1; 
    2459     draw_filled_round_rect(x, y, x+w, y+h, cl); 
     2569    x = (screen_width-w)>>1; y = ((screen_height-h)>>1) + 20; 
     2570    draw_filled_round_rect(x, y, x+w, y+h, MAKE_COLOR(COLOR_RED, COLOR_RED)); 
    24602571    for (i=0; i<sizeof(text)/sizeof(text[0]); ++i) { 
    24612572        draw_string(x+((w-strlen(text[i])*FONT_WIDTH)>>1), y+i*FONT_HEIGHT+4, text[i], cl); 
     2573    } 
     2574    int mx,my; 
     2575    int offset_x = (screen_width-150)>>1; 
     2576    int offset_y = ((screen_height-84)>>1) - 42; 
     2577     
     2578    for(mx=0; mx<150; mx++){ 
     2579        for(my=0; my<84; my++){ 
     2580            color c = header_data[my*150+mx]; 
     2581            if (c != 0x00) 
     2582                draw_pixel(offset_x+mx,offset_y+my,c); 
     2583        } 
    24622584    } 
    24632585} 
     
    24902612void gui_load_script_default(int arg) { 
    24912613        script_load(conf.script_file, 0); 
    2492     save_params_values(1); 
    2493 } 
     2614                        if (conf.script_param_save) 
     2615                                { 
     2616        save_params_values(1); 
     2617      }} 
    24942618 
    24952619 
Note: See TracChangeset for help on using the changeset viewer.