File: AbstractResponderFunc.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (101 lines) | stat: -rw-r--r-- 3,692 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
CLASS:: AbstractResponderFunc
summary:: Abstract superclass of responder func objects
categories:: External Control>Abstract Classes
related:: Classes/OSCFunc, Classes/OSCdef, Classes/MIDIFunc, Classes/MIDIdef, Classes/AbstractDispatcher

DESCRIPTION::
AbstractResponderFunc is the abstract superclass of responder funcs, which are classes which register one or more functions to respond to a particular type of input. It provides some common functionality such as introspection. Its two main subclasses are link::Classes/OSCFunc::, and link::Classes/MIDIFunc::. By default responder funcs do not persist beyond Cmd-. (see link::#-permanent:: below).

Instances will register with a dispatcher (an instance of a subclass of link::Classes/AbstractDispatcher::), which will actually dispatch incoming messages to an instance's Function(s).


CLASSMETHODS::

private:: initClass

METHOD:: allFuncProxies
Get all current instances of this classes concrete subclasses, sorted by type.

returns:: An link::Classes/IdentityDictionary::.

METHOD:: allEnabled
As allFuncProxies above, but only return those instances currently listening for input.

returns:: An link::Classes/IdentityDictionary::.

METHOD:: allDisabled
As allFuncProxies above, but only return those instances currently not listening for input.

returns:: An link::Classes/IdentityDictionary::.


INSTANCEMETHODS::
private:: cmdPeriod, prFunc

METHOD:: func
Get or set this objects response function.

returns:: The getter returns a link::Classes/Function:: or similar object.

METHOD:: srcID
Get this object's source.

returns:: The return type will depend on subclass. For link::Classes/OSCFunc:: this will be a link::Classes/NetAddr::, for link::Classes/MIDIFunc:: a UID. This can be nil, which indicates that the object will respond to any source.

METHOD:: enabled
Check if this object is currently responding to incoming messages.

returns:: A link::Classes/Boolean::.

METHOD:: dispatcher
et this object's dispatcher. This is the object which matches incoming messages with responder funcs. Instances can use custom dispatchers to support arbitrary matching schemes.

returns:: An instance of an appropriate subclass of link::Classes/AbstractDispatcher::. (The return type will depend on subclass.)

METHOD:: permanent
Get or set whether this responder func is persists when the user executes Cmd-. If false this will be disabled and removed from the global lists. The default is false.

argument:: bool
A link::Classes/Boolean:: indicating if this object is permanent.

returns:: The getter returns a link::Classes/Boolean::.

METHOD:: enable
Enable this object to receive incoming messages. This is done automatically at creation time.

METHOD:: disable
Stop this object from receiving incoming messages.

METHOD:: add
Add a new function to the list of functions which will be executed when this object receives an incoming message.

argument:: newFunc
A link::Classes/Function:: or similar object to be added.

METHOD:: remove
Remove a function from the list of functions which will be executed when this object receives an incoming message.

argument:: removeFunc
The link::Classes/Function:: to be removed.

METHOD:: gui
Open a subclass specific GUI. (Not yet implemented)

returns:: The GUI object.

METHOD:: oneShot
Indicate that this object should execute only once and then free itself.

METHOD:: fix
A synonym for link::#-permanent::

METHOD:: free
Disable this object and remove it from the global lists. This should be done when you are finished using this object.

METHOD:: clear
Remove all active functions from this object's function list.


EXAMPLES::

See link::Classes/OSCFunc:: and link::Classes/MIDIFunc::.