Table of Contents

Example

Playback - Set fade-out time

by: Sebastian Beutel, July 2020
published: here
description: sets some playbacks' fade-out time
also this is a good example for various was to select playback handles
remarks:

functions

affected properties

control structures

Code

SetPBFadeOutTime.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
  <macro id="Wiki.Macros.FadeOutTime3" name="PB Fade-Out Time 3s">
  <!-- sets the Fade-Out time for playbacks in slots 1 and 2 on the current page of the playbacks window -->
    <sequence>
      <step>Handles.ClearSelection()</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", null)</step>
 
      <step>Handles.SetSourceHandle("PlaybackWindow", 0)</step>
      <step condition="Playbacks.IsCueHandle(Handles.SourceHandle)">
        ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", Handles.SourceHandle)</step>
      <step>Playbacks.Editor.EnsurePlaybackCueSelected()</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.Times.CueFadeOutTime", time:3)</step>
 
      <step>Handles.SetSourceHandle("PlaybackWindow", 1)</step>
      <step condition="Playbacks.IsCueHandle(Handles.SourceHandle)">
        ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", Handles.SourceHandle)</step>
      <step>Playbacks.Editor.EnsurePlaybackCueSelected()</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.Times.CueFadeOutTime", time:3)</step>
 
      <step>Handles.ClearSelection()</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", null)</step>
    </sequence>
  </macro>
 
  <macro id="Wiki.Macros.FadeOutTime1.5" name="PB Fade-out Time 1.5s">
  <!-- sets the Fade-Out time for playbacks in slots 1 and 2 on page 1 of the playbacks window -->
    <sequence>
      <step>Handles.ClearSelection()</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", null)</step>
 
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", handle:"Location=Playbacks,1,1")</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.Times.CueFadeOutTime", time:1.5)</step>
 
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", handle:"Location=Playbacks,1,2")</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.Times.CueFadeOutTime", time:1.5)</step>
 
      <step>Handles.ClearSelection()</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", null)</step>
    </sequence>
  </macro> 
 
  <macro id="Wiki.Macros.FadeOutTime0" name="PB Fade-out Time 0s">
  <!-- sets the Fade-Out time for playbacks with user numbers 101 and 102 -->
    <sequence>
      <step>Handles.ClearSelection()</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", null)</step>
 
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", handle:"playbackHandleUN=101")</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.Times.CueFadeOutTime", time:0)</step>
 
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", handle:"playbackHandleUN=102")</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.Times.CueFadeOutTime", time:0)</step>
 
      <step>Handles.ClearSelection()</step>
      <step>ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", null)</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

This example shows various ways to select playback handles: by index on the current page, by location, and by user number.

In the other two macros the playbacks are directly selected using either the location (ActionScript.SetProperty(“Playbacks.Editor.SelectedPlayback”, handle:“Location=Playbacks,1,1”)) or the user number (ActionScript.SetProperty(“Playbacks.Editor.SelectedPlayback”, handle:“playbackHandleUN=101”)). Thus it's possible to omit some of the checks.

How to use it