/* autogenerated from "macros/Sources/READAU_f.sci" */ function READAU_f() { READAU_f.prototype.define = function READAU_f() { frmt = "uc "; fname = "test.au"; lunit = 0; this.N = 20; M = 1; tmask = []; this.swap = 0; offset = 1; outmask = 1; ievt = 0; nout = size(outmask,"*"); model = scicos_model(); model.sim = list("readau",2); model.out = nout; model.evtin = 1; model.dstate = [[1],[1],[lunit],[zeros(this.N*M,1)]]; model.ipar = [[length(fname)],[this._str2code[frmt-1]],[ievt],[this.N],[M],[this.swap],[offset],[this._str2code[fname-1]],[tmask],[outmask]]; model.blocktype = "d"; model.dep_ut = [false,false]; exprs = [[fname],[string(this.N)],[string(this.swap)]]; gr_i = []; this.x = standard_define([5,2],model,exprs,gr_i); return new BasicBlock(this.x); } READAU_f.prototype.details = function READAU_f() { return this.x; } READAU_f.prototype.get = function READAU_f() { var options = { fname1:["Input File Name",this.fname1], N:["Buffer size",this.N], swap:["Swap Mode (0:No, 1:Yes)",this.swap], } return options; } READAU_f.prototype.set = function READAU_f() { this.fname1 = parseFloat((arguments[0]["fname1"])) this.N = parseFloat((arguments[0]["N"])) this.swap = parseFloat((arguments[0]["swap"])) this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; out = model.out; dstate = model.dstate; ipar = model.ipar; imask = 9+ipar[1-1]; tmask = ipar[imask-1]; lunit = dstate[3-1]; fname = exprs[1-1]; while (true) { [ok,this.fname1,this.N,this.swap,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","READAU_f")],[" "],["(Read Audio File)"],[" "],["Read is done on a binary \'.au\' file"]],["Input File Name","Buffer size","Swap Mode (0:No, 1:Yes)"],list("str",1,"vec",1,"vec",1),exprs); tmask1 = []; outmask = 1; frmt1 = "uc"; M = 1; offset = 1; if (!ok) { break; } this.fname1 = stripblanks(this.fname1); frmt1 = stripblanks(frmt1); if (this.alreadyran&&this.fname1!=fname) { block_parameter_error("Simulation running !!! You cannot modify Input file name","End current simulation first."); } else if (this.fname1=="") { block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Input File Name"),"You must provide a filename."); } else if (this.N<1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Buffer size",this.N),msprintf("Must be greater than %d.",1)); } else if (this.alreadyran&&(this.N!=ipar[6-1])) { block_parameter_error(msprintf("You cannot modify \'%s\' when running.","Buffer Size"),"End current simulation first."); } else if (this.swap!=0&&this.swap!=1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Swap Mode",this.swap),msprintf("Must be in the interval %s.","[0, 1]")); } else { [model,graphics,ok] = check_io(model,graphics,[],1,1,[]); frmt1 = part(frmt1,1,3); if (ok) { ipar = [[length(this.fname1)],[this._str2code[frmt1-1]],[0],[this.N],[M],[this.swap],[offset,this._str2code[this.fname1-1]],[tmask1,outmask.slice()]]; if (prod(size(dstate))!=(this.N*M)+3) { dstate = [[-1],[-1],[lunit],[zeros(this.N*M,1)]]; } model.dstate = dstate; model.ipar = ipar; graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = model; break; } } } return new BasicBlock(this.x); } }