You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

60 lines
1.4 KiB

include("again_utils.js")
outlets = 2;
var top_level_patcher = null;
// var agn_host_js = null;
var host_name = null;
var remote_args = [];
// var patcherargs = null;
function loadbang() {
// post("this: " + this.box.maxclass);
// patcherargs = this.patcher.newdefault(400, 25, "patcherargs", "test");
// this.patcher.connect(patcherargs, 0, this.box, 0);
// patcherargs.bang();
top_level_patcher = get_top_level_patcher();
top_level_patcher.applydeep(get_host_name);
}
// function anything() {
// remote_args = arrayfromargs(messagename,arguments);
// post("number of args: " + remote_args.length);
// if (remote_args.length == 0) {
// outlet(1, "dump");
// } else {
// outlet(1, remote_args);
// }
// }
function get_host_name(obj) {
if (obj.maxclass === "js") {
// post(obj.varname); post();
if (obj.patcher.getattr("name") === "agn.host") {
// post("troué !! " + obj.value); post();
obj.message("request_host_name");
}
}
}
function set_agn_host_name(param) {
// post("set host name: " + param); post();
if (host_name !== param) {
host_name = param;
outlet(0, param);
// if (remote_args.length == 0) {
// outlet(1, "dump");
// } else {
// outlet(1, remote_args);
// }
}
}