tomwalters@0: % method of class @parameter tomwalters@0: % bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org tomwalters@0: tomwalters@0: function hand=gethandle(param,text,panel,handnr) tomwalters@0: % set handle of one line. A line can have more then one handle, therefore tomwalters@0: % nr can be bigger then one tomwalters@0: tomwalters@0: if nargin<4 tomwalters@0: handnr=1; tomwalters@0: end tomwalters@0: tomwalters@0: if nargin<3 tomwalters@0: panel='all'; tomwalters@0: end tomwalters@0: tomwalters@0: nr=getentrynumberbytext(param,text,panel); tomwalters@0: tomwalters@0: if nr>0 tomwalters@0: if ~isfield(param.entries{nr},'handle') tomwalters@0: hand=0; tomwalters@0: % disp('error: handle does not exist'); tomwalters@0: return tomwalters@0: end tomwalters@0: if length(param.entries{nr}.handle)>=handnr tomwalters@0: hand=param.entries{nr}.handle{handnr}; tomwalters@0: if length(hand)>1 tomwalters@0: hand=hand(handnr); tomwalters@0: end tomwalters@0: else tomwalters@0: hand=[]; tomwalters@0: end tomwalters@0: else tomwalters@0: hand=0; tomwalters@0: disp('error: handle does not exist'); tomwalters@0: end