User Tools

Site Tools


macros:example:parkfixtures1thru100000

Example

Patch - Park fixtures 1 thru 100000

by: Sebastian Beutel, july 2020
idea: Yenz Nyholm, see https://www.facebook.com/groups/Avolites/permalink/1931175330348025/
description: Parks/unparks fixtures 1 ~ 100000

From Titan v15 on ClearAll() requires two parameters, see Programmer.Editor.ClearAll.
Simply change the relevant line(s) to Programmer.Editor.ClearAll(false, false).

functions

affected properties

The repatch menu does not actually use the PatchSelection, it has its own property Patch.Repatch.SelectedFixtureHandles.

Code

ParkFixtures1Thru100000.xml
<?xml version="1.0" encoding="utf-8" ?>
<avolites.macros>
 
<!-- 
  Sebastian Beutel, July 2020
  idea by Yenz Nyholm
  see https://www.facebook.com/groups/Avolites/permalink/1931175330348025/
-->
 
 
<macro id="Avolites.Macros.ParkFixturesOneThru100000" name="Park Fixtures 1 Thru 100000">
  <description>Parks fixtures 1 ~ 100000.</description>
  <sequence>
    <step pause="0.001">Menu.Stack.PushOrReloadMenu("Primary", "Expert.Root.Program")</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","Channel","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",1)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","KeypadThrough","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",1)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","KeypadEnter","",0)</step>
    <step pause="0.01">Programmer.Editor.Selection.GetSelectedHandles("Windows.PatchView.Handles")</step>
    <step pause="0.01">Handles.SetSourceHandleRangeFromHandles(Windows.PatchView.Handles, true)</step>
    <step pause="0.01">Patch.Repatch.SetDmxAddressesFromSelectedFixture()</step>
    <step pause="0.01">Patch.Repatch.ParkSelectedFixtures()</step>
    <step pause="0.01">Handles.ClearSelection()</step>
    <step pause="0.01">Programmer.Editor.ClearAll()</step>
  </sequence>
</macro> 
 
<macro id="Avolites.Macros.UnparkFixturesOneThru100000" name="Unpark Fixtures 1 Thru 100000">
  <description>Unparks fixtures 1 ~ 100000.</description>
  <sequence>
    <step pause="0.001">Menu.Stack.PushOrReloadMenu("Primary", "Expert.Root.Program")</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","Channel","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",1)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","KeypadThrough","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",1)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","NumericKeys","",0)</step>
    <step pause="0.001">Menu.InjectInput("OnButtonDown","KeypadEnter","",0)</step>
    <step pause="0.01">Programmer.Editor.Selection.GetSelectedHandles("Windows.PatchView.Handles")</step>
    <step pause="0.01">Handles.SetSourceHandleRangeFromHandles(Windows.PatchView.Handles, true)</step>
    <step pause="0.01">Patch.Repatch.SetDmxAddressesFromSelectedFixture()</step>
    <step pause="0.01">Patch.Repatch.UnParkSelectedFixtures(true)</step>
    <step pause="0.01">Handles.ClearSelection()</step>
    <step pause="0.01">Programmer.Editor.ClearAll()</step>
  </sequence>
</macro>
 
</avolites.macros>

Here, the pause=“0.01” seems to be required - if there is no pause, always the previously for repatching selected fixtures will be parked, and if there aren't any an exception is thrown.

Explanation

This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax

The first part simply emulates fixture selection by syntax, like 1 THRO 100000:

  • Menu.Stack.PushOrReloadMenu(“Primary”, “Expert.Root.Program”) makes sure we are in the root menu
  • the Menu.InjectInput(..) commands emulate the button presses Fixture 1 THRO 1 0 0 0 0 0 Enter

This way the fixtures 1 ~ 100000 are selected.

The following code is taken from Patch - Park selected fixtures

  • The first line retrieves the current selection and stores it in a menu property, it is not important which one just that it is the correct type.
  • From that we then set the source handle selection (this is the same selection that is used for copy, move, set legend etc.).
  • The third line copies the source handle selection to the Repatch property (and initialises other properties used in the repatch menu).
  • The forth line performs the Park operation and
  • the last line clears the source handle selection once you are done.

How to use it

You could leave a comment if you were logged in.
macros/example/parkfixtures1thru100000.txt · Last modified: 2021/06/10 19:06 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki