Example ====== Dummy speed as condition ====== ^ by: | Kim Wida, February 2018 | ^ published: | http://forum.avolites.com/viewtopic.php?f=20&t=5584 | ^ description: | example of how to use a dummy playback speed as step condition | {{tag>dummy step condition toggle}} ==== functions ==== * [[:macros:function:ActionScript.SetProperty]] * [[:macros:function:Handles.SetSourceHandleFromHandle]] * [[:macros:function:Math.IsEqual]] * [[:macros:function:Profiles.AssignHandleProfile]] * [[:macros:function:Handles.SetLegend]] * [[:macros:function:Handles.ClearSelection]] ==== affected properties ==== * [[:macros:property:Playbacks.Editor.SelectedPlayback]] * [[:macros:property:Playbacks.Editor.Times.PlaybackSpeed]] * [[:macros:property:Handles.PendingLegend]] ==== control structures ==== * conditional steps, see [[macros:control_structures|]] ===== Code ===== ActionScript.SetProperty("Playbacks.Editor.SelectedPlayback", handle:"chaseHandleUN=1049") Handles.SetSourceHandleFromHandle("chaseHandleUN=1049") { if ( Math.IsEqual(Playbacks.Editor.Times.PlaybackSpeed, 60.0) ) { Profiles.AssignHandleProfile(handle:"chaseHandleUN=19162",493461); } else { Profiles.AssignHandleProfile(handle:"chaseHandleUN=19162",493448); } } { if(Math.IsEqual(Playbacks.Editor.Times.PlaybackSpeed, 60.0) ) { ActionScript.SetProperty("Handles.PendingLegend", "Instant"); } else { ActionScript.SetProperty("Handles.PendingLegend", "Latch"); } } { if(Math.IsEqual(Playbacks.Editor.Times.PlaybackSpeed, 60.0) ) { ActionScript.SetProperty("Playbacks.Editor.Times.PlaybackSpeed", 30.0); } else { ActionScript.SetProperty("Playbacks.Editor.Times.PlaybackSpeed", 60.0); } } Handles.SetLegend() Handles.ClearSelection() ===== Explanation ===== * The chase with usernumber 1049 is used as dummy, its speed is used as contions for the next steps * if the speed is 60 BPM then another chase's profile is set to a certain profile, else it is set to another profile * if the speed is 60 BPM then the dummy's legend is set to 'Instant', else it is set to 'Latch' * if the speed is 60 BPM then the speed is set to 30 BPM, else it is set to 60 BPM (the classic toggle) This is not operational within itself but a good example for some special syntax. ~~DISCUSSION~~