Get Specific Cue Legend In A Cuelist

This is a place for people to chare the custom macros they have written.

Moderator: Moderators

User avatar
kimwida
Posts: 250
Joined: 05 Aug 2016, 16:26
Location: Seoul

Get Specific Cue Legend In A Cuelist

Postby kimwida » 16 Apr 2018, 10:15

Hi
"Playbacks.SetCueLegend" can set specific cue's legend in a cuelist using second parameter.
Is there anyway to get specific cue's legend in a cuelist??
I searched Titan API and what I found is "Playbacks.Editor.Times.CueLegend" to get cue legend.
But it only get "first" cue's legend.
How can I get second or third cue's legend in the cuelist??

I am trying to make a macro which show currently running cue's legend to the cuelist legend.
For understanding.
There is a cuelist which has "Colour" legend. It has 4 cues and each cue have "Red", "Green", "Blue" and "White" legend.
What I want is when I fire the cuelist, cuelist legend change "Colour" to "Red". Then "Red" to "Green"... like this.

Code: Select all

     <step pause="0.01">Handles.SetSourceHandleFromHandle(Handles.GetHandle("PlaybackWindow",0,76))</step>
     <step pause="0.01">ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", Handles.GetHandle("PlaybackWindow",0,76))</step>
     <step pause="0.01">ActionScript.SetProperty("Handles.PendingLegend", Math.ToString(Playbacks.Editor.Times.CueLegend))</step>
          <step pause="0.01">Handles.SetLegend()</step>
     <step pause="0.01">Handles.ClearSelection()</step>


But this code only shows first cue's legend to the cuelist even on second or third cue's step.
=======================================================================================

Code: Select all

Void Playbacks.FillCueLegend(Handle handle, Single cueNumber, String propertyId)


What is the propertyId??
This function might get the specific cue's legend of a cuelist.
User avatar
Gregory
Posts: 1301
Joined: 14 Dec 2007, 15:25
Location: London, United Kingdom
Contact:

Re: Get Specific Cue Legend In A Cuelist

Postby Gregory » 16 Apr 2018, 16:09

The Playbacks.FillCueLegend function should do what you need. The third parameter is the string identifier for where to store the result in the same way as the first parameter in ActionScript.SetProperty is used. So you could do something like this:

Code: Select all

<step pause="0.01">Handles.SetSourceHandleFromHandle("Location=PlaybackWindow,0,76")</step>
<step pause="0.01">Playbacks.FillCueLegend("Location=PlaybackWindow,0,76", 2.0, "Handles.PendingLegend")</step>
<step pause="0.01">Handles.SetLegend()</step>
<step pause="0.01">Handles.ClearSelection()</step>
User avatar
kimwida
Posts: 250
Joined: 05 Aug 2016, 16:26
Location: Seoul

Re: Get Specific Cue Legend In A Cuelist

Postby kimwida » 16 Apr 2018, 20:00

Hi, Gregory.
I tried many codes but I couldn't get connected cuelist's current cue number.
Would you help me??

Code: Select all

<step pause="0.01">ActionScript.SetProperty("CueLists.ConnectedHandle",Handles.GetHandle("PlaybackWindow",0,76))</step>
<step pause="0.01">Handles.SetSourceHandleFromHandle(Handles.GetHandle("PlaybackWindow",0,76))</step>
<step pause="0.01">Playbacks.FillCueLegend(Handles.GetHandle("PlaybackWindow",0,76), Math.Cast.ToSingle(Cuelists.nextCueNumber) - 1.0, "Handles.PendingLegend")</step>
<step pause="0.01">Handles.SetLegend()</step>
<step pause="0.01">Handles.ClearSelection()</step>
User avatar
kimwida
Posts: 250
Joined: 05 Aug 2016, 16:26
Location: Seoul

Re: Get Specific Cue Legend In A Cuelist

Postby kimwida » 17 Apr 2018, 06:22

Code: Select all

<step pause="0.01">ActionScript.SetProperty("CueLists.ConnectedHandle", Handles.GetHandle("PlaybackWindow",0,76))</step>
<step pause="0.01">Handles.SetSourceHandleFromHandle(Handles.GetHandle("PlaybackWindow",0,76))</step>
<step pause="0.01">Playbacks.FillCueLegend(Handles.GetHandle("PlaybackWindow",0,76), Math.Cast.ToSingle(CueLists.LiveCueNumber), "Handles.PendingLegend")</step>
<step pause="0.01">Handles.SetLegend()</step>
<step pause="0.01">Handles.ClearSelection()</step>


This code only works after I edit one of the cue legend of the cuelist in playback view window.
Any advice thanks!!
=======================================================================================
Ok. It only works with "Connected" Cuelist.
If you don't set "Auto Connect" cuelist in user setting, it may not work.
=======================================================================================

Code: Select all

<step pause="0.01">ConnectedPlayback.Connect(Handles.GetHandle("PlaybackWindow",0,76))</step>
<step pause="0.01">Handles.SetSourceHandleFromHandle(Handles.GetHandle("PlaybackWindow",0,76))</step>
<step pause="0.01">Playbacks.FillCueLegend(Handles.GetHandle("PlaybackWindow",0,76), Math.Cast.ToSingle(CueLists.LiveCueNumber), "Handles.PendingLegend")</step>
<step pause="0.01">Handles.SetLegend()</step>
<step pause="0.01">Handles.ClearSelection()</step>

It works!!
Put this macro each macro column of the cuelist which is located in "Playback Windows" 77th slot.

p.s. 1 if you didn't put cue legend of the cuelist, it will show default cuelist name.
p.s. 2 You could use "CueLists.LiveCueNumber +1", if you want to see next cue.

Who is online

Users browsing this forum: No registered users and 9 guests