Example #1
0
// Push a button release action onto the stack
// Can only be called from an action stack
void action_push_release(long key)
{
    // WARNING stack program flow is reversed
    action_push_delay(camera_info.cam_key_release_delay);
    action_push(key);
    action_push_func(action_stack_AS_RELEASE);
}
Example #2
0
// Push a button press action onto the stack
// Can only be called from an action stack
void action_push_press(long key)
{
    // WARNING stack program flow is reversed
    action_push_delay(camera_info.cam_key_press_delay);
    action_push(key);
    action_push_func(action_stack_AS_PRESS);
}
Example #3
0
// Action stack function - wait for shooting to be finished
// parameters - retry flag
static int action_stack_AS_WAIT_SHOOTING_DONE()
{
    // Are we there yet?
    if (!shooting_in_progress())
    {
        // Remove this action from stack
        int retry = action_pop_func(1); // Retry parameter returned

        // Check if shoot succeeded or not
        if (camera_info.state.state_shooting_progress == SHOOTING_PROGRESS_NONE)
        {
            if (retry)
            {
                // Shoot failed, retry once, if it fails again give up
                action_push_shoot(0);

                // Short delay before retrying shoot
                action_push_delay(250);
            }
            else
            {
                // Failed - already retried, or no retry requested
                // Return 'shoot' status to script - 2 = shoot failed
                libscriptapi->set_as_ret(2);
            }
        }
        else
        {
            // Return 'shoot' status to script - 0 = shoot succesful
            libscriptapi->set_as_ret(0);

            // Final script config delay (XXX FIXME find out how to wait to jpeg save finished)
            if (conf.script_shoot_delay > 0)
                action_push_delay(conf.script_shoot_delay*100);
        }

        return 1;
    }
    return 0;
}
Example #4
0
static void md_kbd_sched_immediate_shoot(int no_release)
{
    action_pop();// REMOVE MD ITEM
  
    // stack operations are reversed!
    if (!no_release)  // only release shutter if allowed
    {
      action_push_release(KEY_SHOOT_FULL);
      action_push_delay(20);
    }
    action_push(AS_MOTION_DETECTOR); // it will removed right after exit from this function
    kbd_key_press(KEY_SHOOT_FULL); // not a stack operation... pressing right now
}
Example #5
0
static void md_kbd_sched_immediate_shoot(int no_release)
{
    action_pop_func(0);// REMOVE MD ITEM

    // stack operations are reversed!
    if (!no_release)  // only release shutter if allowed
    {
        action_push_release(KEY_SHOOT_FULL);
    }
    if (camera_info.cam_key_press_delay > 0)
        action_push_delay(camera_info.cam_key_press_delay);
    action_push_func(action_stack_AS_MOTION_DETECTOR); // it will removed right after exit from this function
    kbd_key_press(KEY_SHOOT_FULL); // not a stack operation... pressing right now

    // MD testing with AF LED
    if (camera_info.perf.md_af_tuning)
    {
        camera_info.perf.md_af_on_flag = 1;
    }
}
Example #6
0
static int luaCB_sleep( lua_State* L )
{
    action_push_delay( luaL_checknumber( L, 1 ) );
    return lua_yield( L, 0 );
}