Exemplo n.º 1
0
//-------------------------------------------------------------------
void gui_osd_draw_ev_video(int is_osd_edit)
{
#if CAM_EV_IN_VIDEO
    if (!is_video_recording() && !is_osd_edit) return;

    int visible = get_ev_video_avail() || is_osd_edit;

    int x0=conf.ev_video_pos.x, y0=conf.ev_video_pos.y;
    int i, deltax;

    twoColors col = user_color(conf.osd_color);

    draw_rectangle(x0,y0,x0+70,y0+24, visible? MAKE_COLOR(BG_COLOR(col),BG_COLOR(col)): COLOR_TRANSPARENT, RECT_BORDER1|DRAW_FILLED);

    if (!visible) { return; }

    for (i=0;i<9;i++) draw_line(x0+2+i*8,   y0+12, x0+2+i*8,   y0+12-(i&1 ? 5 : 10), col);
    for (i=0;i<9;i++) draw_line(x0+2+i*8+1, y0+12, x0+2+i*8+1, y0+12-(i&1 ? 5 : 10), col);

    deltax=8*get_ev_video();

    x0+=deltax;

    draw_line(x0+34,y0+16,x0+34,y0+22,col);
    draw_line(x0+35,y0+16,x0+35,y0+22,col);

    draw_line(x0+32,y0+19,x0+32,y0+22,col);
    draw_line(x0+33,y0+18,x0+33,y0+22,col);
    draw_line(x0+36,y0+18,x0+36,y0+22,col);
    draw_line(x0+37,y0+19,x0+37,y0+22,col);
#endif
}
Exemplo n.º 2
0
int mute_on_zoom(int x){
 static int old_busy=0;
 int busy=zoom_busy||focus_busy;
 if (old_busy!=busy) {
  if (busy) {
#if CAM_CAN_MUTE_MICROPHONE
   if (conf.mute_on_zoom) _TurnOffMic();
#endif
   }
   else {
#if CAM_CAN_MUTE_MICROPHONE
  if (conf.mute_on_zoom) _TurnOnMic();
#endif
#if CAM_EV_IN_VIDEO
  if (get_ev_video_avail()) set_ev_video_avail(0);
#endif
  }
  old_busy=busy;
 }
 return x; // preserve R0 if called from assembler
}
Exemplo n.º 3
0
//------------------------------------------------------------------- 
// Handler for button presses in normal camera shooting or playback modes
static int gui_std_kbd_process()
{
#ifdef CAM_USE_ZOOM_FOR_MF
    if (conf.use_zoom_mf && kbd_use_zoom_as_mf())
        return 1;
#endif 

    if (kbd_use_up_down_left_right_as_fast_switch())
        return 1;

    // Process Shutter Half Press + BUTTON shortcuts
    gui_kbd_shortcuts();

    // process other keys in not <alt> mode

#if CAM_AF_SCAN_DURING_VIDEO_RECORD 
    if (is_video_recording())
        if (kbd_is_key_clicked(conf.video_af_key)) MakeAFScan(); 
#endif 

#if CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
    // return from digital to optical zoom in video
#if CAM_HAS_ZOOM_LEVER
    if (conf.unlock_optical_zoom_for_video && is_video_recording() &&  kbd_is_key_clicked(KEY_ZOOM_OUT))
#else
    if (conf.unlock_optical_zoom_for_video && is_video_recording() &&  kbd_is_key_clicked(KEY_DOWN))
#endif
    {
        short x;
        // state = 1 => digital zoom standard
        if (shooting_get_digital_zoom_state())
        {
            get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION, &x, sizeof(x));
#if defined(CAM_USE_OPTICAL_MAX_ZOOM_STATUS)
	        if (x==0) zoom_status=ZOOM_OPTICAL_MAX; //ERR99: No zoom back from digital to optical zoom possible if set to medium
#else
	        if (x==0) zoom_status=ZOOM_OPTICAL_MEDIUM;
#endif
        }
    }
#endif

#if CAM_EV_IN_VIDEO
    if (is_video_recording() && !camera_info.state.is_shutter_half_press)
    {
#if CAM_HAS_ERASE_BUTTON
        if (kbd_is_key_clicked(KEY_ERASE))
#elif CAM_HAS_DISP_BUTTON
        if (kbd_is_key_clicked(KEY_DISPLAY))
#else
        if (kbd_is_key_clicked(KEY_MENU))
#endif
        {
            set_ev_video_avail(!get_ev_video_avail());
#ifdef CAM_TOUCHSCREEN_UI
            redraw_buttons = 1;
#endif
        }
        if (get_ev_video_avail())
        {
            if (kbd_is_key_clicked(KEY_LEFT))
            {
                set_ev_video(get_ev_video()-1);
            }
            if (kbd_is_key_clicked(KEY_RIGHT))
            {
                set_ev_video(get_ev_video()+1);
            }
        }
    }
#endif

    return 0;
}
Exemplo n.º 4
0
//------------------------------------------------------------------- 
// Process up/down/left/right/jogdial shortcuts when control options enabled
static int kbd_use_up_down_left_right_as_fast_switch()
{
    static long key_pressed = 0;
    int ev_video = 0;
    int jogdial;

#if CAM_EV_IN_VIDEO
    ev_video = get_ev_video_avail(); 
#endif

    // One of the control options must be enabled or don't do anything
    if (!conf.fast_ev && !conf.fast_movie_control && !conf.fast_movie_quality_control) return 0;

    // Clear state variable is neither UP or DOWN is pressed
    if (!kbd_is_key_pressed(KEY_UP) && !kbd_is_key_pressed(KEY_DOWN)) key_pressed = 0;

    // Must be in record mode and not have either Canon menu open
    if ( (canon_menu_active!=(int)&canon_menu_active-4) || canon_shoot_menu_active!=0 || !camera_info.state.mode_rec) return 0;

    // Adjust exposure if 'Enable Fast EV switch?' option is set
    if (conf.fast_ev && (key_pressed == 0) && (camera_info.state.mode_shooting != MODE_M))
    {
#if !CAM_HAS_JOGDIAL
        if (kbd_is_key_pressed(KEY_UP))
        {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ev_correction1()+(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ev_correction2()+(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
            key_pressed = KEY_UP;
                    
            return 1;
        } 

        if (kbd_is_key_pressed(KEY_DOWN))
        {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ev_correction1()-(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ev_correction2()-(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
            key_pressed = KEY_DOWN;

            return 1;
        }
#else
        jogdial=get_jogdial_direction();

        if (camera_info.state.is_shutter_half_press && (jogdial==JOGDIAL_RIGHT))
        {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ev_correction1()+(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ev_correction2()+(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
        }

        if (camera_info.state.is_shutter_half_press && (jogdial==JOGDIAL_LEFT))
        {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_ev_correction1()-(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_ev_correction2()-(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
        }
#endif
    } 

    // Adjust video quality/bitrate if 'Video Quality Control?' option is set
    if (conf.fast_movie_quality_control && key_pressed == 0 && is_video_recording())
    {
        if (kbd_is_key_pressed(KEY_UP))
        {
            if (conf.video_mode==0)
            {
#if !CAM_VIDEO_QUALITY_ONLY
                gui_video_bitrate_enum(1,0);
                movie_reset = 1;
#endif
            }    
            else if (conf.video_mode==1)
            {
                conf.video_quality+=1;
                if (conf.video_quality>VIDEO_MAX_QUALITY)
                    conf.video_quality=VIDEO_MAX_QUALITY;
                movie_reset = 1;
            }              
            key_pressed = KEY_UP;
            return 1;
        }
    
        if (kbd_is_key_pressed(KEY_DOWN))
        {
            if (conf.video_mode==0)
            {
#if !CAM_VIDEO_QUALITY_ONLY
                conf.video_bitrate-=1;
                if (conf.video_bitrate<0)
                    conf.video_bitrate=0;

                shooting_video_bitrate_change(conf.video_bitrate);
                movie_reset = 1;
#endif
            }
            else if (conf.video_mode==1)
            {
                conf.video_quality-=1;
                if (conf.video_quality<1)
                    conf.video_quality=1;
                movie_reset = 1;
            }          
            key_pressed = KEY_DOWN;
            return 1;
        }
    } 
    
#if CAM_VIDEO_CONTROL
    // Pause / unpause video if 'Fast Movie Control' option is set
    if (conf.fast_movie_control && key_pressed == 0 && !ev_video
#ifndef CAM_HAS_VIDEO_BUTTON 
        && (camera_info.state.mode_video || is_video_recording())
#endif
        )
    {
        if (kbd_is_key_pressed(KEY_LEFT) && is_video_recording())
        {
            movie_status = VIDEO_RECORD_STOPPED;
            key_pressed = KEY_LEFT;
            return 1;
        }

    	// reyalp - HACK for cams that can do video in any mode
	    // note that this means this will probably run whenever you press right
        // BUG this doesn't know whether recording was stopped or paused.
        if (kbd_is_key_pressed(KEY_RIGHT) && (movie_status == VIDEO_RECORD_STOPPED))
        {
            movie_status = VIDEO_RECORD_IN_PROGRESS;
            movie_reset = 1;
            key_pressed = KEY_RIGHT;
            return 1;
        }
    } 
#endif

    return key_pressed;
}
Exemplo n.º 5
0
long kbd_use_up_down_left_right_as_fast_switch() {
    static long key_pressed = 0; // ??? static masking a global
    int m=mode_get(); 
    int mode_video = MODE_IS_VIDEO(m) || (movie_status > 1);
    int ev_video=0;
    int jogdial;

#if CAM_EV_IN_VIDEO
    ev_video=get_ev_video_avail(); 
#endif

    if (!(kbd_is_key_pressed(KEY_UP)) && !(kbd_is_key_pressed(KEY_DOWN))) key_pressed = 0;

    if (canon_shoot_menu_active!=0 || (m&MODE_MASK) != MODE_REC)
        return 0;

#if !CAM_HAS_JOGDIAL
    if (kbd_is_key_pressed(KEY_UP) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) {
        if (conf.fast_ev && key_pressed == 0) {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_prop(PROPCASE_EV_CORRECTION_1)+(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_prop(PROPCASE_EV_CORRECTION_2)+(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
            key_pressed = KEY_UP;
                
            return 1;
        }

    } 

    if (kbd_is_key_pressed(KEY_DOWN) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) {
        if (conf.fast_ev && key_pressed == 0) {
            kbd_key_release_all();
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_prop(PROPCASE_EV_CORRECTION_1)-(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_prop(PROPCASE_EV_CORRECTION_2)-(conf.fast_ev_step+1)*16);
            key_pressed = KEY_DOWN;
            EnterToCompensationEVF();
            return 1;
        }
    } 

#else
    jogdial=get_jogdial_direction();

    if (conf.fast_ev &&kbd_is_key_pressed(KEY_SHOOT_HALF) && (jogdial==JOGDIAL_RIGHT) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_prop(PROPCASE_EV_CORRECTION_1)+(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_prop(PROPCASE_EV_CORRECTION_2)+(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
        }

    if (conf.fast_ev &&kbd_is_key_pressed(KEY_SHOOT_HALF) && (jogdial==JOGDIAL_LEFT) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_prop(PROPCASE_EV_CORRECTION_1)-(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_prop(PROPCASE_EV_CORRECTION_2)-(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
        }
     

#endif

    if (kbd_is_key_pressed(KEY_UP) && mode_video && movie_status == 4 ) {
        if (conf.fast_movie_quality_control && key_pressed == 0) {
            if (conf.video_mode==0) {
#if !CAM_VIDEO_QUALITY_ONLY
                conf.video_bitrate+=1;
                if (conf.video_bitrate>=VIDEO_BITRATE_STEPS)
                    conf.video_bitrate=VIDEO_BITRATE_STEPS-1;
                shooting_video_bitrate_change(conf.video_bitrate);
                movie_reset = 1;
#endif
            }    
            else if (conf.video_mode==1) {
                conf.video_quality+=1;
                if (conf.video_quality>VIDEO_MAX_QUALITY)
                    conf.video_quality=VIDEO_MAX_QUALITY;
                movie_reset = 1;
            }              
            key_pressed = KEY_UP;
            return 1;
        }
    } 
    
    if (kbd_is_key_pressed(KEY_DOWN) && mode_video && movie_status == 4) {
        if (conf.fast_movie_quality_control && key_pressed == 0) {
            if (conf.video_mode==0) {                
#if !CAM_VIDEO_QUALITY_ONLY
                conf.video_bitrate-=1;
                if (conf.video_bitrate<0)
                    conf.video_bitrate=0;

                shooting_video_bitrate_change(conf.video_bitrate);
                movie_reset = 1;
#endif
            }
            else if (conf.video_mode==1) {
                conf.video_quality-=1;
                if (conf.video_quality<1)
                    conf.video_quality=1;
                movie_reset = 1;
            }          
            key_pressed = KEY_DOWN;
            return 1;
        }
    } 
    
    if (kbd_is_key_pressed(KEY_LEFT) && mode_video && (movie_status == 4) && !ev_video) {
        if (conf.fast_movie_control && key_pressed == 0) {
            movie_status = VIDEO_RECORD_STOPPED;
            key_pressed = KEY_LEFT;
            return 1;
        }
    } 
	// reyalp - HACK for cams that can do video in any mode
	// note that this means this will probably run whenever you press right
    if (kbd_is_key_pressed(KEY_RIGHT) &&
#ifndef CAM_HAS_VIDEO_BUTTON 
            mode_video &&
#endif
	        (movie_status == 1) && !ev_video) {
        // BUG this doesn't know whether recording was stopped or paused.
        if (conf.fast_movie_control && key_pressed == 0) {
            movie_status = VIDEO_RECORD_IN_PROGRESS;
            movie_reset = 1;
            key_pressed = KEY_RIGHT;
            return 1;
        }
    } 

    return 0;
}