Skip to content

Commit

Permalink
Merged comments and loadfromstring() method from Spencer.
Browse files Browse the repository at this point in the history
  • Loading branch information
chr15m committed Feb 3, 2011
1 parent a29127a commit f2e8cec
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pd.js
Expand Up @@ -69,6 +69,13 @@ var Pd = function Pd(sampleRate, bufferSize, debug, arrayType) {
MakeRequest(url, this);
return this;
}

/** Initiate a load of a Pd source string **/
this.loadfromstring = function (string, callback) {
this.loadcallback = callback;
this.loadcomplete(string,{"status":200});
return string;
}

/** send a message from outside the graph to a named receiver inside the graph **/
this.send = function(name, val) {
Expand Down Expand Up @@ -107,6 +114,8 @@ var Pd = function Pd(sampleRate, bufferSize, debug, arrayType) {
// if this is a message object
if (tokens[1] == "msg") {
proto = "msg";
}else if (tokens[1] == "text") {
proto = "text";
} else {
// see if we know about this type of object yet
proto = tokens[4];
Expand Down Expand Up @@ -3327,6 +3336,18 @@ var PdObjects = {
},
},

//text comments
"text": {
"defaultinlets":0,
"defaultoutlets":0,
"description":"passive comments or instructions",
"outletTypes": ["message"],
"init": function() {
},
"message": function(inletnum, message) {
}
}


};

Expand Down

0 comments on commit f2e8cec

Please sign in to comment.