|
grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » HookObjectChange(function, handle, handle[, handle]) |
Version 2.2 |
HookObjectChange 関数は、grandMA3 オブジェクトが変更されたときに関数を自動的に呼び出します。
|
|
ヒント |
| 関連する関数の DumpAllHooks、Unhook、UnhookMultiple も参照してください。 |
Sequence プールの内容が変更されるたびに関数を呼び出すには、以下のようなコードでプラグインを作成します。
Lua |
-- Get the handle to this Lua component. local luaComponentHandle = select(4,...) function Main() -- Get a handle to the sequence pool. local hookObject = DataPool().Sequences -- Get a handle to this plugin. local pluginHandle = luaComponentHandle:Parent() -- Create the hook and save the Hook ID. SequenceHookId = HookObjectChange(MySequencePoolCallback, hookObject, pluginHandle) -- Print the returned Hook ID. Printf("HookId: " .. SequenceHookId) end -- This function is called when there are changes in the sequence pool. function MySequencePoolCallback(obj) Printf(tostring(obj.name) .. " changed!") end return Main |