Example
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: |
<?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>
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.
Handles.ClearSelection()
and ActionScript.SetProperty(“Playbacks.Editor.SelectedPlayback”, null)
always make sure that there is no playback selected from previous actionsHandles.SetSourceHandle(“PlaybackWindow”, 0)
. This refers to the index of the button on the current page of this windows. however we cannot be sure that an actual playback is there in this slot - and if there is not then the macro will cause an error. Thus we need to make sure that an actual playback is selected as soure handle:<step condition=“Playbacks.IsCueHandle(Handles.SourceHandle)”>
checks that this really is a cue handleActionScript.SetProperty(“Playbacks.Editor.SelectedPlayback”, Handles.SourceHandle)
sets this as source handle for the next operationsPlaybacks.Editor.EnsurePlaybackCueSelected()
makes sure a cue is selectedActionScript.SetProperty(“Playbacks.Editor.Times.CueFadeOutTime”, time:3)
finally sets the fade-out time
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.