GetUIChannelIndex(integer, integer)

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

説明

GetUIChannelIndex 関数は、指定された2つのインデックス番号にマッチするUIチャンネルのインデックス番号を返します。

引数

  • integer:
    フィクスチャのパッチ・インデックスです。
  • integer:
    アトリビュートのインデックス(0ベース)です。 これは、Attribute Definitions または GetAttributeIndex() 関数で確認できます。

戻り値

  • integer:
    UIチャンネルのインデックス番号を返します。

現在のセレクションにある最初のフィクスチャの Dimmer アトリビュートに対するUIチャンネル・インデックスを出力します。

Lua
return function()
    -- Get the Attribute index and UIChannel indexes
    local attributeIndex = GetAttributeIndex("Dimmer")
    local uiChannelIndex = GetUIChannelIndex(SelectionFirst(),attributeIndex)
    -- End the function if any of the index return nil
    if (attributeIndex == nil or uiChannelIndex == nil) then
        ErrPrintf("Something went wrong, maybe your first selected fixture don't have a Dimmer - Please try again")
        return
    end
    Printf("The UI Channel Index is " .. uiChannelIndex)
end