Hi
Here is the code for the slow zoom script I've been using:
--[[
Slow Zoom Video v1.2
@title Slow Zoom Video 1.2
@param z Zoom Step (1/10%)
@default z 10
@range z 1 100
@param r Zoom Step Delay (mSec)
@default r 500
@range r 10 2000
--]]
zoom_step = z
zoom_delay = r
zoom_timer = 0
zoom_position_percent = 0
zoom_position_step = 0
function restore()
if get_movie_status() == 4 then StartStopVideo() end
set_draw_title_line(1)
end
function update_status_line(msg)
local x = (get_gui_screen_width() - string.len(msg)*8)/2
local y = get_gui_screen_height()-16
draw_string(x, y,msg,258,265)
end
function StartStopVideo()
local rec, vid = get_mode()
local vid_button = get_video_button()
if rec and vid and vid_button == 0 then
press("shoot_full")
sleep(300)
release("shoot_full")
elseif rec and vid_button == 1 then
press("video")
sleep(300)
release("video")
end
end
function rezoom(step)
if get_tick_count() > zoom_timer then
zoom_position_percent = zoom_position_percent + step
if(zoom_position_percent<0) then zoom_position_percent = 0 end
if(zoom_position_percent>1000) then zoom_position_percent = 1000 end
zstep=((get_zoom_steps()-1)*zoom_position_percent)/1000
if zstep ~= zoom_position_step then
zoom_position_step = zstep
set_zoom(zoom_position_step)
end
zoom_timer = get_tick_count() + zoom_delay
--print("Zoom:"..(zoom_position_percent/10).."."..(zoom_position_percent%10).."%. Step:"..zoom_position_step)
end
end
-- check CHDK release and version for compatability
bi=get_buildinfo()
chdk_version = tonumber(string.sub(string.gsub(bi.build_number, "%p", ""), 0, 3))
if ( tonumber(bi.build_revision) > 0 ) then build = tonumber(bi.build_revision)
else build = tonumber(string.match(bi.build_number,'-(%d+)$')) end
if (chdk_version<130) then
error("CHDK 1.3.0 or higher required.")
end
if (build<3487) then
error("CHDK build 3487 or higher required")
end
-- disable title line, console, and script exit via full press
set_console_autoredraw(-1)
cls()
set_exit_key("no_key")
set_draw_title_line(0)
set_zoom(zoom_position_step)
sleep(200)
if ( get_mode() == false ) then
set_record(1)
while ( get_mode() == false ) do sleep(100) end
sleep(1000)
end
repeat
update_status_line("Press MENU to exit")
wait_click(100)
if is_key("set") or is_key("video") or is_key("shoot_full") or is_key("display")then StartStopVideo()
elseif is_key("zoom_in") then while(is_pressed("zoom_in")) do sleep(20) rezoom( zoom_step) end
elseif is_key("zoom_out") then while(is_pressed("zoom_out")) do sleep(20) rezoom(-zoom_step) end
end
until is_key("menu")
restore()
Given that zooming in by slow increments works OK on the A1400, would a possible approach be to integrate the script above into the bookscanner script, so that when bookscanner.lua sets the required parameters, it sets the zoom via slow increments?