Auto Bracketing termination

Started by garry23, December 04, 2019, 02:10:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

@a1ex

My memory is not as good as yours (so forgive me if you have already answered this question)  ;)

Is there a way in Lua to look for a particular Canon or ML state to detect that Auto bracketing has completed, when I don't know the number of images that will be captured.

For example, is there a test I can use for 'bracketing_test'?


    while bracketing_test do
        display.notify_box("bracketing running")
        task.yield(1000)
    end
    display.notify_box("bracketing finished")


garry23

OK a bit hacky, but I got something partially working. Here is the test script, which starts with the bracketing off and in LV:


menu.set("Shoot","Advanced Bracket",1)

menu.close()
msleep(1000)

key.wait(KEY.FULLSHUTTER)

-- user presses a full shutter to start bracketing

local brack_running = true
while brack_running do
    task.yield(1000)
    key.press(KEY.HALFSHUTTER) -- but this doesn't work, whereas a finger driven halfpress does
    if lv.overlays == 2 then brack_running = false end
end

menu.set("Shoot","Advanced Bracket",0)


The issue is that the key.press(KEY.HALFSHUTTER) doesn't seem to trigger the auto bracketing returning to the ML screen, but my finger does, which then brings the ML menu up and hence completion of the script, ie turning off the advanced bracketing.

More experiments I think  ::)

garry23

OK a bit clunky, but as long as a do advanced bracketing as the last thing in my script, ie before, say, doing an MLV FLV capture, the following will work:

menu.set("Shoot","Advanced Bracket",1)

menu.close()

display.notify_box("Press Shutter to start Advanced Bracketing",3000)

key.wait( KEY.FULLSHUTTER)

task.yield(1000)

menu.set("Shoot","Advanced Bracket",0)


I guess the task.yield call allows the Advanced Bracketing to start, then I can switch it off, even if it's running.

garry23

OK, no more on this now as I'm content with this code snippet:


menu.set("Shoot","Advanced Bracket",1)

menu.close()

display.notify_box("Full Shutter to start Advanced Bracketing",3000)

local done = false
while not done do
    if key.last == KEY.UNPRESS_HALFSHUTTER then
        done = true
        menu.set("Shoot","Advanced Bracket",0)
        return
    elseif key.last == KEY.UNPRESS_FULLSHUTTER then
        task.yield(1000)
        done = true
        menu.set("Shoot","Advanced Bracket",0)
    end
end