HasActivePlayback(handle)

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object API » HasActivePlayback(handle) Version 2.2

説明

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.

引数

  • 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.

    The Colon Notation is a way to omit the handle as the first argument when using the Object functions.

    This is the general syntax with the colon notation: object:function()

    This is the general syntax with standard handle notation: object.function(object)

    Learn more in the Lua Functions - Object API topic.

戻り値

  • boolean:
    The function returns a boolean indicating the playback status:
    • true: There is active playback.
    • false: There is no active playback.

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