target_seek(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸŽ€ target_seek(3) β€” Arcan Lua API, bestie πŸ’…

Okay so this is the page for target_seek(3) from the Arcan Lua API, and we're about to make frameserver seeking make sense. No cap. 🫢


✨ NAME ✨

target_seek β€” request a change playback or presentation position for a frameserver. That's the whole name, and honestly it ate. 🎯


🌈 SYNOPSIS 🌈

The synopsis is giving "many ways to call me" energy, so here it is exactly:

nil
target_seek( vid:tgt, number:step )
target_seek( vid:tgt, number:step, bool:relative )
target_seek( vid:tgt, number:step, bool:relative )
target_seek( vid:tgt, number:step, bool:relative, bool:time )
target_seek( vid:tgt, number:step, bool:relative, bool:time=false )
target_seek( vid:tgt, number:step, bool:relative, bool:time=false,
number:xaxis )
target_seek( vid:tgt, number:step, bool:relative, bool:time=false,
number:xaxis, number:zaxis )

πŸ’– DESCRIPTION πŸ’–

So target_seek is your "please move the active content position" button. It requests an absolute or relative, step-sized change in active content position β€” and you can do it in either time or space. The frameserver communicates this capability, and the meaning of the ranges, through the 'content_state' event. This feature can be used to implement things like scrollbars, as well as client-side defined UI 'scaling'. Literally iconic for interactive stuff. πŸ–±οΈβœ¨

If you're seeking in time β€” that's the default β€” the relative step (also the default) is expected to be an offset in miliseconds. If you're setting an absolute time position, the absolute step is floating point in the 0..1 range. πŸ•°οΈ

If you're seeking in space (panning), the relative (default) is in discrete +- steps on a target defined scale. Absolute seeking is a float in the 0..1 range from start (0) to end (1). Slide to the left, slide to the right, periodt. 🧚

The zaxis axis is a hint on magnification, where the absolute value will treat 1 as normal scale, < 1 as minification, and > 1 as magnification. Big zoom energy, tiny zoom energy, all valid. πŸ”

The boolean arguments relative and time has constants defined as SEEK_SPACE | SEEK_TIME and SEEK_ABSOLUTE | SEEK_RELATIVE. Keep those exact, bestie β€” they're the vibe check for whether you're moving in space or time, absolute or relative. 🌈


🌸 EXAMPLE 🌸 β€” seek +100ms

First example is a whole little snack: launch the avfeed, handle the resize, then seek forward by 100 milliseconds.

function target_seek0()
      vid = launch_avfeed("file=test.mkv", "",
            function(source, status)
                  if status.kind == "resized" then
                        show_image(source)
                        resize_image(source, status.width, status.height)
                  end
            end
      )
      target_seek(vid, 100) -- seek +100ms
end

πŸ¦‹ EXAMPLE πŸ¦‹ β€” tick that pan

Second example is giving clock pulse panning. Every tick, dx,dy += 1, no cap. πŸ•Ί

function target_seek1()
      vid = launch_avfeed("file=test.mkv", "",
            function(source, status)
                  if status.kind == "resized" then
                        show_image(source)
                        resize_image(source, status.width, status.height)
                  end
            end
      )
end
function main_clock_pulse()
      target_seek(vid, 1, SEEK_RELATIVE, SEEK_SPACE, 1) -- dx,dy += 1 every tick
end
end

πŸŽ€ EXAMPLE πŸŽ€ β€” randomized zoom

Third example is randomized zoom each tick. Main character energy only. πŸ”₯

function target_seek2()
      vid = launch_avfeed("file=test.mkv", "",
            function(source, status)
                  if status.kind == "resized" then
                        show_image(source)
                        resize_image(source, status.width, status.height)
                  end
            end
      )
end
function main_clock_pulse()
      target_seek(vid, 0, SEEK_ABSOLUTE, SEEK_SPACE, 0, math.random(0.1, 3)) -- randomized zoom each tick
end
end

πŸ’€ MISUSE πŸ’€

⚠️ Bestie, this section is called MISUSE for a reason. Look at that target_seek(BADID) just sitting there outside the function. Do not copy this energy. 😭
function target_seek0()
      vid = launch_avfeed("file=test.mkv", "",
            function(source, status)
                  if status.kind == "resized" then
                        show_image(source)
                        resize_image(source, status.width, status.height)
                  end
            end
      )
end
      target_seek(BADID)
end

That's the whole page, bestie 🫢 β€” source/version line: targetcontrol, date: October 2026, page: target_seek(3). Slay responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from