Example #1
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
}
Example #2
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;
}