Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LUA: Add lens.continuous_af #122

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/lua/lua_lens.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ static int luaCB_lens_index(lua_State * L)
/// Get whether or not auto focus is enabled.
// @tfield bool af readonly
else if(!strcmp(key, "af")) lua_pushboolean(L, !is_manual_focus());
// Check if Live View and AF is enabled and AF is in continuous mode. Useful for lens.focus()
// @tfield bool continuous_af readonly
else if(!strcmp(key, "continuous_af")) lua_pushboolean(L, is_continuous_af());
/// Get the current auto focus mode (may be model-specific, see PROP\_AF\_MODE in property.h).
// @tfield int af_mode readonly
else if(!strcmp(key, "af_mode")) lua_pushinteger(L, af_mode);
Expand All @@ -72,7 +75,7 @@ static int luaCB_lens_index(lua_State * L)
static int luaCB_lens_newindex(lua_State * L)
{
LUA_PARAM_STRING_OPTIONAL(key, 2, "");
if(!strcmp(key, "name") || !strcmp(key, "focal_length") || !strcmp(key, "focus_distance") || !strcmp(key, "hyperfocal") || !strcmp(key, "dof_near") || !strcmp(key, "dof_far") || !strcmp(key, "af"))
if(!strcmp(key, "name") || !strcmp(key, "focal_length") || !strcmp(key, "focus_distance") || !strcmp(key, "hyperfocal") || !strcmp(key, "dof_near") || !strcmp(key, "dof_far") || !strcmp(key, "af") || !strcmp(key, "continuous_af"))
{
return luaL_error(L, "'%s' is readonly!", key);
}
Expand Down Expand Up @@ -245,6 +248,7 @@ static const char * lua_lens_fields[] =
"dof_near",
"dof_far",
"af",
"continuous_af",
"af_mode",
NULL
};
Expand Down