Mercurial > hg > aimmat
annotate aim-mat/tools/@parameter/gethandle.m @ 4:537f939baef0 tip
various bug fixes and changed copyright message
author | Stefan Bleeck <bleeck@gmail.com> |
---|---|
date | Tue, 16 Aug 2011 14:37:17 +0100 |
parents | 20ada0af3d7d |
children |
rev | line source |
---|---|
tomwalters@0 | 1 % method of class @parameter |
tomwalters@0 | 2 % |
bleeck@3 | 3 % (c) 2011, University of Southampton |
bleeck@3 | 4 % Maintained by Stefan Bleeck (bleeck@gmail.com) |
bleeck@3 | 5 % download of current version is on the soundsoftware site: |
bleeck@3 | 6 % http://code.soundsoftware.ac.uk/projects/aimmat |
bleeck@3 | 7 % documentation and everything is on http://www.acousticscale.org |
tomwalters@0 | 8 |
tomwalters@0 | 9 function hand=gethandle(param,text,panel,handnr) |
tomwalters@0 | 10 % set handle of one line. A line can have more then one handle, therefore |
tomwalters@0 | 11 % nr can be bigger then one |
tomwalters@0 | 12 |
tomwalters@0 | 13 if nargin<4 |
tomwalters@0 | 14 handnr=1; |
tomwalters@0 | 15 end |
tomwalters@0 | 16 |
tomwalters@0 | 17 if nargin<3 |
tomwalters@0 | 18 panel='all'; |
tomwalters@0 | 19 end |
tomwalters@0 | 20 |
tomwalters@0 | 21 nr=getentrynumberbytext(param,text,panel); |
tomwalters@0 | 22 |
tomwalters@0 | 23 if nr>0 |
tomwalters@0 | 24 if ~isfield(param.entries{nr},'handle') |
tomwalters@0 | 25 hand=0; |
tomwalters@0 | 26 % disp('error: handle does not exist'); |
tomwalters@0 | 27 return |
tomwalters@0 | 28 end |
tomwalters@0 | 29 if length(param.entries{nr}.handle)>=handnr |
tomwalters@0 | 30 hand=param.entries{nr}.handle{handnr}; |
tomwalters@0 | 31 if length(hand)>1 |
tomwalters@0 | 32 hand=hand(handnr); |
tomwalters@0 | 33 end |
tomwalters@0 | 34 else |
tomwalters@0 | 35 hand=[]; |
tomwalters@0 | 36 end |
tomwalters@0 | 37 else |
tomwalters@0 | 38 hand=0; |
tomwalters@0 | 39 disp('error: handle does not exist'); |
tomwalters@0 | 40 end |