Example ====== Timecode - Toggle On/Off for particular playback ====== ^ by: | Gregory Haynes, May 2016 | ^ published: | http://forum.avolites.com/viewtopic.php?f=20&t=4517 | ^ description: | Toggle whether the cue list on handle 1 of the current page is enabled for timecode. | ^ remarks: | The original idea was to toggle a cuelist which is identified by its legend - but that's not possible. Greg writes //'I don't think there is a way to do this at the moment. I found a way of toggling a playback based on its location but it uses the current page, you could use the Playbacks window instead (which would be "PlaybackWindow").'// | {{tag>handle timecode toggle source}} ==== functions ==== * [[macros:function:handles.setsourcehandle]] * [[macros:function:playbacks.timecode.toggleenabled.handle]] * [[macros:function:handles.setsourcehandlefromhandle]] ===== Code ===== Toggle Timecode Enabled Toggle whether the cue list on handle 1 of the current page is enabled for timecode. Handles.SetSourceHandle("Playbacks", 0) Playbacks.Timecode.ToggleEnabled.Handle(Handles.SourceHandle) Handles.SetSourceHandleFromHandle(null) ===== Explanation ===== This explains the functional steps within the sequence. For all the other XML details please refer to [[macros:formats_and_syntax#xml_format|Formats and syntax]] * ''Handles.SetSourceHandle("Playbacks", 0)'' makes the playback 1 the source handle * ''Playbacks.Timecode.ToggleEnabled.Handle(Handles.SourceHandle)'' toggles the Timecode.Enabled setting of this handle - this is the 'Connected Cuelists' toggle button in the Timecode menu * ''Handles.SetSourceHandleFromHandle(null)'' empties the source handle property. ===== How to use it ===== * [[macros:deploying|Make this macro available]]- * create a cuelist on playback 1 * open the ''[Timecode]'' menu * go to ''[Connected Cue Lists]'' - the button ''[Cue List Playbacks[1]]'' is inactive * (the macro doesn't run as long as we are in this menu) * fire the macro * go to ''[Connected Cue Lists]'' - the button ''[Cue List Playbacks[1]]'' is now active ~~DISCUSSION~~