User Tools

Site Tools


macros:example:timecodeonoff

Example

Timecode - Enable/Disable

by: Gregory Haynes, Mar. 2016
published: http://forum.avolites.com/viewtopic.php?f=20&t=4416
description: Enable/disable/toggle timecode input
remarks: These macros are now factory default macros, and are shown here for documentation.

functions

affected properties

Code

TimecodeMacros.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
  <macro id="Avolites.Macros.Timecode.Enable" name="Enable Timecode">
	<description>Enable Timecode timer.</description>
    <sequence>
      <step>ActionScript.SetProperty.Boolean("Timecode.Enabled", true)</step>
      <step>Timecode.SetEnabled(Timecode.Enabled)</step>
    </sequence>
  </macro>
  <macro id="Avolites.Macros.Timecode.Disable" name="Disable Timecode">
	<description>Disable Timecode timer.</description>
    <sequence>
      <step>ActionScript.SetProperty.Boolean("Timecode.Enabled", false)</step>
      <step>Timecode.SetEnabled(Timecode.Enabled)</step>
    </sequence>
  </macro>
  <macro id="Avolites.Macros.Timecode.Toggle" name="Toggle Timecode">
	<description>Toggle Timecode timer.</description>
    <sequence>
      <step>ActionScript.SetProperty.Boolean("Timecode.Enabled", !Timecode.Enabled)</step>
      <step>Timecode.SetEnabled(Timecode.Enabled)</step>
    </sequence>
  </macro>
</avolites.macros>

Explanation

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

These macros are a good example for keeping the programming core and the menu in sync - this is explained in Action and Menus.

  • ActionScript.SetProperty.Boolean(“Timecode.Enabled”, true) sets the variable 'Timecode.Enabled', which in fact enables the timer AND sets the menu if the timecode menu is open.
  • Timecode.SetEnabled(Timecode.Enabled) sets the timecode timer to the value the variable 'Timecode.Enabled' is set to.
  • ActionScript.SetProperty.Boolean(“Timecode.Enabled”, !Timecode.Enabled) is explained in Control Structures: it is a simple toggle logic which sets the variable 'Timecode.Enabled' to its counterpart: if it is enabled, it will be disabled - and vice versa.

How to use it

See Deploying macros.
Fire any of the macros if you want to enable/disable/toggle the macro timer.

You could leave a comment if you were logged in.
macros/example/timecodeonoff.txt · Last modified: 2019/01/15 02:19 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki