grandMA3 User Manual Publication

HasActivePlayback(handle)

grandMA3 User Manual » Plugins » Lua Functions - Object API » HasActivePlayback(handle)
Version 2.0

Description

The HasActivePlayback Lua function returns a boolean indicating if an object has a currently active playback, for instance, if a sequence has an active cue.

Arguments

  • Handle:
    The function takes a handle of the type "light_userdata" as an argument. It can be omitted when using the colon notation on an object. See the example below.

Return

  • Boolean:
    The function returns a boolean indicating the playback status:
    • True: There is active playback.
    • False: There is no active playback.

Example

To return the information if the selected sequence has an active playback, create a plugin with this code:

Lua
return function()
-- Stores the handle of the selected sequence.
local selectedSequence = SelectedSequence()

-- The following 'if' gives different feedback based on the playback status.
if selectedSequence:HasActivePlayback() then
Printf("Sequence '" ..selectedSequence.name.. "' has active playback.")
else
Printf("Sequence '" ..selectedSequence.name.. "' has NO active playback.")
end
end