sc3.base.systemactions module¶
SystemActions.sc
-
class
SystemAction
¶ Bases:
object
-
classmethod
add
(action, *args, **kwargs)¶ Register a function to be evaluated after a specific library state.
- Parameters
action (
function
) – The action function.args – Optional positional arguments passed to action when evaluated.
kwargs – Optional keyword arguments passed to action when evaluated.
-
classmethod
remove
(action)¶ Remove a function from the evaluation queue.
-
classmethod
remove_all
()¶ Remove all registered functions.
-
classmethod
run
()¶ Evaluate functions in order of registration.
-
classmethod
-
class
CmdPeriod
¶ Bases:
sc3.base.systemactions.SystemAction
Register functions to be called when a reset is needed.
This singleton class clears clocks and reset servers’ nodes when run or hard_run is called. It is similar to a MIDI panic action.
-
era
= 0¶
-
clear_clocks
= True¶
-
free_servers
= True¶
-
free_remote
= False¶
-
classmethod
do_once
(action, *args, **kwargs)¶ Register a function to be evaluated once and then removed.
- Parameters
action (
function
) – The action function.args – Optional positional arguments passed to action when evaluated.
kwargs – Optional keyword arguments passed to action when evaluated.
-
classmethod
run
()¶ Reset clocks and servers.
This method clears all clocks’ scheduling queues and stop all non permanent TempoClock instances and frees all the nodes of the registered servers through Server.free_all class method.
-
classmethod
hard_run
()¶ Reset clocks and servers.
This method clears all clocks’ scheduling queues and stop all non permanent TempoClock instances and frees all the nodes of the running servers through Server.hard_free_all class method.
-
-
class
StartUp
¶ Bases:
sc3.base.systemactions.SystemAction
Register functions to be evaluated after the startup is finished.
A singleton class to register functions to perform an action after the library has been initialized, and after the startup file has run.
-
done
= True¶
-
classmethod
run
()¶ Evaluate functions in order of registration.
-
classmethod
defer
(action, *args, **kwargs)¶ Register a function to be evaluated after startup is finished, or immediately, if this has happened already. Optional positional or keyword arguments can be supplied.
- Parameters
action (
function
) – Post startup action function.args – Optional positional arguments passed to action when evaluated.
kwargs – Optional keyword arguments passed to action when evaluated.
-
-
class
ShutDown
¶ Bases:
sc3.base.systemactions.SystemAction
Register functions to be evaluated before system shuts down.
A singleton class to register functions to perform an action before system shut down.
-
class
ServerAction
¶ Bases:
object
Register server state related functions.
This is a base superclass for singletons like ServerQuit, which provides a place for registering functions for events that should happen when something happens in the server.
-
classmethod
add
(server, action, *args, **kwargs)¶ Register a function for a specific server.
- Parameters
server (
Server
) – The server for which the action is evaluated.action (
function
) – The function to be evaluated for the specific server state.args – Optional positional arguments passed to action when called.
kwargs – Optional keyword arguments passed to action when called.
-
classmethod
remove
(server, action)¶ Remove a function for the specified server.
-
classmethod
remove_server
(server)¶ Remove a server from all server actions.
-
classmethod
remove_all
()¶ Remove all servers from server actions.
-
classmethod
run
(server=None)¶ Evaluate functions in order of registration of each server.
-
classmethod
-
class
ServerBoot
¶ Bases:
sc3.base.systemactions.ServerAction
Register actions to be taken when a server has booted.
Singleton class that provides a place for registering functions for events that should happen when a given server has booted.
-
class
ServerQuit
¶ Bases:
sc3.base.systemactions.ServerAction
Register actions to be taken when a server quits.
Singleton class that provides a place for registering functions for events that should happen when a given server quits.
-
class
ServerTree
¶ Bases:
sc3.base.systemactions.ServerAction
Register actions to initialise a basic tree of groups on the server.
Singleton class that provides a place for registering functions for events that should happen when a given server has booted and initialised or when all synths are freed. This is to initialise a basic tree of groups on the server.