ExtensionAutomation is a SuperCollider Quark to record, save and load GUI element motions. (c) 2009,2016 Neels J. Hofmeyr <neels@hofmeyr.de>, GNU GPL v3 or later. Contributions by: escuta <http://escuta.org>
To get started, please see the Automation tutorial!
This is Automation, the main class of the Automation Quark. This is what you instantiate to use Automation. Automation has a number of subscribed AutomationClient instances and delegates them, as well as plays back their actions. Most GUIs you are already using can be docked to Automation without changing any of your old code. Automation provides a control GUI to start/stop/record/save/load the Automation.
| length |
The initial max value for playing time (default is 180, that's 3 minutes). This value *only* affects the time slider, nothing else. Recorded values are NOT interfered with based on this number, it simply determines the scale of the time slider GUI element. |
| server |
The server to use. If server==nil, then Server.default will be used. If you were ever to run this on a different server from the default server, you have to pass the server arg to the Automation constructor. You may then access it here. |
| showLoadSave |
Show or hide the Load and Save buttons on the transport. The default is true. |
| showSnapshot |
Show or hide the Snapshot button on the transport. The default is true. |
| minTimeStep |
Time lapse in seconds between recorded GUI updates. The default is 0.01. |
Instance
Automatically find dockable GUI elements in a given window, e.g.
Manual docking of GUI elements, if findAndDock doesn't do what you need.
| guiElement |
The GUI element to dock, like a slider, etc. |
| name |
The name to save the element's values as. If name==nil, name will be "automatedN", where N is the current number of GUI elements docked. |
Open a transport control GUI.
| win |
If nil, open a new window. Otherwise the given GUI.window is used to show the transport GUI. |
| bounds |
A Rect(x,y,w,h) for size and position of the transport. |
User callable function to start playback at the current position.
User callable function that stops playback, staying at the current position.
User callable function to seek a given position in seconds. The seeking action is instantaneous.
| seconds |
Time positiong in seconds to seek to. |
| dostop |
If false, playback (if running) continues at the new position. If true, playback is stopped at the new position. If omitted, the value from doStopOnSeek will be used, which in turn is false by default. |
Save all clients' values to disk, using client names as the filenames in a given directory.
Load as many clients as possible from disk.
| dir |
Directory to load from. |
User callable function that records this instant value for each subscribed client. For example, this is useful for setting initial values for all GUI elements.
User provided callback function called when when play is carried out in transport.
User provided callback function called when the transport is stopped. The current transport time in seconds is passed in as a parameter. For example, use this to launch and stop some background action like audio file playback and such. Note, when doStopOnSeek is true, both onStop and onSeek will be called for each seek operation.
User provided callback function called when seek is carried out. The current transport time in seconds is passed in as a parameter. For example, use this to launch and stop some background action like audio file playback and such. Note, when doStopOnSeek is true, both onStop and onSeek will be called for each seek operation.
This callback function is called when the time slider hits its end boundary. The default behaviour is to add 20% of time and continue to run:
But instead, we could also, for example, stop at the end:
Or wrap back to the start:
Add headstart given to the onSeek callback, i.e. call onSeek, and carry out the actual transport and GUI seek this many seconds later. Useful for audio recording that has latency.
Add headstart given to the onPlay callback, i.e. call onPlay, and carry out the actual transport and GUI playback this many seconds later. Useful for audio recording that has latency.
If true, the transport is stopped whenever the transport position is modified.
If false, all informational posts on the server window are omitted.
the current position on the time scale.
| guiElement |
Gui element |
the AutomationGui instance that is connected to this Automation instance, if any.
Button action to switch off recording.
The button action that signals readyness for recording. It makes the record button orange.
If true, then the recording button is active (either orange or red).
rewind and stop.
Internal: defer a given function only if doDefer is true. Used for sending GUI signals.
| func |
Function to be deferred. |
Internal flag to indicate whether GUI actions should be deferred. May be necessary for specific GUI implementations.
Instance variable. A List of AutomationClient instances that are currently docked.
Message function called from any AutomationClient as soon as it was first modified in recording mode. It makes the record button red.
Used as base for all transport timing.
the current real wall clock time
The core of the play function without the semaphore stuff. Don't use unless within a semaphore.wait ... semaphore.signal block.
The core of the stop function without the semaphore stuff. It is also called from the playRoutine itself. Don't use unless within a semaphore.wait ... semaphore.signal block.
The core of the seek function without the semaphore stuff. Don't use unless within a semaphore.wait ... semaphore.signal block.
private, don't use unless within a semaphore.wait ... semaphore.signal block.
Please refer to the Automation tutorial!