Skip to content

Commit

Permalink
Merge pull request #5930 from telephon/topic-call-dispatch-in-Ndef
Browse files Browse the repository at this point in the history
class library: in Ndef, call proxyspace dispatch explicitly
  • Loading branch information
adcxyz committed May 5, 2024
2 parents 3bddf7c + 70aa961 commit 96c4fc5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
12 changes: 11 additions & 1 deletion HelpSource/Classes/Ndef.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private::initClass
subsection::Creation

method::new
Return a new node proxy and store it in a global ProxySpace under the key. If there is already an Ndef there, replace its object with the new one. The object can be any supported class, see link::Classes/NodeProxy#Supported sources:: help.
Return a new node proxy and store it in a global ProxySpace under the key. If there is already an Ndef there, replace its object with the new one. The object can be any supported class, see link::Classes/NodeProxy#Supported sources:: help. Internally, all instances are kept in a link::Classes/ProxySpace::. The link::Classes/EnvironmentRedirect#dispatch:: function is called when the source is set.

argument::key
the name of the proxy (usually a symbol). If only the key is given and no object, it returns the proxy object:
Expand Down Expand Up @@ -84,6 +84,16 @@ code::
Ndef.dictFor(s);
::

InstanceMethods::

method::proxyspace
Return the proxyspace for this instance

code::
Ndef(\x).proxyspace
::


subsection::Setting default parameters
Behind every Ndef there is one single instance of link::Classes/ProxySpace:: per server used (usually just the one for the default server). This ProxySpace keeps default values for the proxies that can be set. This can be done by:

Expand Down
9 changes: 6 additions & 3 deletions SCClassLibrary/JITLib/ProxySpace/NodeProxy.sc
Original file line number Diff line number Diff line change
Expand Up @@ -1090,11 +1090,14 @@ Ndef : NodeProxy {
if(res.isNil) {
res = super.new(server).key_(key);
dict.initProxy(res);
dict.envir.put(key, res)
dict.envir.put(key, res);
};
object !? {
res.source = object;
dict.dispatch.value(key, object)
};

object !? { res.source = object };
^res;
^res
}

*ar { | key, numChannels, offset = 0 |
Expand Down

0 comments on commit 96c4fc5

Please sign in to comment.