User Tools

Site Tools


macros:example:cuelistsetffq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
macros:example:cuelistsetffq [2021/06/11 11:07] – created icke_siegenmacros:example:cuelistsetffq [2021/06/11 11:45] (current) – external edit 127.0.0.1
Line 9: Line 9:
  
 {{tag>cuelist set option range fire first}} {{tag>cuelist set option range fire first}}
 +
 +This example shows how to select playbacks, how to set their options, and how to reference macros in other macros.
  
 ==== functions ==== ==== functions ====
-  * [[:macros:function:someusedfunction]] +  * [[:macros:function:Handles.FilterHandleOptions]] 
-  * [[:macros:function:anotherusedfunction]] +  * [[:macros:function:ActionScript.SetProperty.Boolean]] 
-  * [[:macros:function:someusedfunction]] +  * [[:macros:function:Handles.ClearSelection]] 
-  * [[:macros:function:anotherusedfunction]]+  * [[:macros:function:Handles.ClearHandleOptionsFilter]] 
 +  * [[:macros:function:Handles.SetSourceHandleFromHandle]] 
 +  * [[:macros:function:UserMacros.RecallMacroById]] 
 +  * [[:macros:function:Handles.SetSourceHandleRange]]
  
 ==== affected properties ==== ==== affected properties ====
-  * [[:macros:property:someproperty]] +  * [[:macros:property:HandleOptions.CueLists.FireFirstCue]]
-  * [[:macros:property:anotherusedproperty]]+
  
 ==== control structures ==== ==== control structures ====
-  * [[macros:control_structures|step condition]] +  * [[macros:step_pause|]] 
- + 
 +Tests showed that these macros require a step_pause to function properly. 
 ===== Code ===== ===== Code =====
 <code xml SetCuelistOptionFFQ.xml> <code xml SetCuelistOptionFFQ.xml>
Line 69: Line 75:
 <!-- that's why here it is set the other way before the range is set as intended -->      <!-- that's why here it is set the other way before the range is set as intended -->     
              
-  <macro id="Wiki.Macros.Cuelists.SetOption.FFQ1thro4.On" name="Set PB thro 4 to FFQ On"> +  <macro id="Wiki.Macros.Cuelists.SetOption.FFQ1thro4.On" name="Set PB thro 4 to FFQ On">
     <sequence>     <sequence>
       <step pause="0.05">Handles.SetSourceHandle("Playbacks", 0)</step>       <step pause="0.05">Handles.SetSourceHandle("Playbacks", 0)</step>
Line 78: Line 84:
   </macro>    </macro> 
                
-  <macro id="Wiki.Macros.Cuelists.SetOption.FFQ1thro4.Off" name="Set PB thro 4 to FFQ Off"> +  <macro id="Wiki.Macros.Cuelists.SetOption.FFQ1thro4.Off" name="Set PB thro 4 to FFQ Off">
     <sequence>     <sequence>
       <step pause="0.05">Handles.SetSourceHandle("Playbacks", 0)</step>       <step pause="0.05">Handles.SetSourceHandle("Playbacks", 0)</step>
Line 95: Line 101:
 This explains the functional steps within the sequence. For all the other XML details please refer to [[:macros:formats_and_syntax#xml_format|Formats and syntax]] This explains the functional steps within the sequence. For all the other XML details please refer to [[:macros:formats_and_syntax#xml_format|Formats and syntax]]
  
-tbd+Note that this is an example for reusing code by referencing other macros. Of course this works only if the correct MacroIds are used: the first two macros do the real work - the other macros just select the very playback or cuelist and then call the work macros. 
 + 
 +**Please note that these macros require a certain step_pause in order to function properly.** 
 + 
 +The 'base' macros: 
 +  * ''Handles.FilterHandleOptions()'' sets the filter so that options can be set 
 +  * ''ActionScript.SetProperty.Boolean("HandleOptions.CueLists.FireFirstCue",true)'' actually sets the option as required to true or false 
 +  * ''Handles.ClearSelection()'' clears the selection 
 +  * ''Handles.ClearHandleOptionsFilter()'' clears the filter 
 + 
 +The select macros: 
 +  * ''Handles.SetSourceHandleFromHandle("playbackHandleUN=101")'' selects a particular playback by its user number 
 +  * ''UserMacros.RecallMacroById("Wiki.Macros.Cuelists.SetOption.FFQ.On")'' then calls one of the 'base' macros to do the work 
 + 
 +For ranges of playbacks something special needs to be taken into account: tests revealed that setting an option for a range works only if the first item needs to be toggled, i.e. wouldn't work if the first item is already set correctly and only some other elements need to be set. Thus here the first element is deliberately set the other way, and then the range is set as intended: 
 + 
 +  * ''Handles.SetSourceHandle("Playbacks", 0)'' selects the first handle of the range 
 +  * ''UserMacros.RecallMacroById("Wiki.Macros.Cuelists.SetOption.FFQ.Off")'' calls the base macro to set the option in the wrong way 
 +  * ''Handles.SetSourceHandleRange("Playbacks", {0, 1, 2, 3})'' now selects the whole range 
 +  * ''UserMacros.RecallMacroById("Wiki.Macros.Cuelists.SetOption.FFQ.On")'' finally calls the base macro to set the option of the range correctly
  
 ===== How to use it ===== ===== How to use it =====
  
   - [[:macros:deploying|make this macro available]]   - [[:macros:deploying|make this macro available]]
- +  - fire the 'select' macros as needed. The 'base' macros with xxx in their name are only useful with a cuelist selected.
-tbd+
  
  
 ~~DISCUSSION~~ ~~DISCUSSION~~
macros/example/cuelistsetffq.1623409627.txt.gz · Last modified: 2021/06/11 11:07 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki