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: function display(param) tomwalters@0: % display the content of an object of the parameter class. This function is tomwalters@0: % called when the object is listed somewhere or the mouse is over it in the tomwalters@0: % editor tomwalters@0: tomwalters@0: cont=param.entries; tomwalters@0: nrent=length(cont); tomwalters@0: disp(sprintf('%s: object of class datastruct with %d entries:',param.name,nrent)); tomwalters@0: tomwalters@0: for i=1:nrent tomwalters@0: panel=cont{i}.panel; tomwalters@0: if ~strcmp(panel,'all') tomwalters@0: indent=' '; tomwalters@0: else tomwalters@0: indent=''; tomwalters@0: end tomwalters@0: text=cont{i}.text; tomwalters@0: switch cont{i}.type tomwalters@0: case {'string','pop-up menu','filename','directoryname'} tomwalters@0: val=get(param,text); tomwalters@0: disp(sprintf('%s(%12s) %30s = %s',indent,cont{i}.type,cont{i}.text,val)); tomwalters@0: case {'int'} tomwalters@0: val=getstringvalue(param,text); tomwalters@0: disp(sprintf('%s(%12s) %30s = %s',indent,cont{i}.type,cont{i}.text,val)); tomwalters@0: case {'float','slider'} tomwalters@0: strval=getstringvalue(param,text); tomwalters@0: if isequal(strval,'auto') tomwalters@0: disp(sprintf('%s(%12s) %30s = %s',indent,cont{i}.type,text,strval)); tomwalters@0: else tomwalters@0: curunit=getcurrentunit(param,text); tomwalters@0: uninttype=cont{i}.unittype; tomwalters@0: if isa(uninttype,'unit_none') tomwalters@0: disp(sprintf('%s(%12s) %30s = %s',indent,cont{i}.type,text,strval)); tomwalters@0: else tomwalters@0: disp(sprintf('%s(%12s) %30s = %s %s',indent,cont{i}.type,text,strval,curunit)); tomwalters@0: end tomwalters@0: end tomwalters@0: case {'bool','radiobutton'} tomwalters@0: val=get(param,text,cont{i}.panel); tomwalters@0: if val==0 tomwalters@0: val='false'; tomwalters@0: else tomwalters@0: val='true'; tomwalters@0: end tomwalters@0: if strcmp(text,'other...') && isequal(val,'true'); tomwalters@0: setto=getradiobutton(param,cont{i}.panel); tomwalters@0: disp(sprintf('%s(%12s) %30s = %s (%s)',indent,cont{i}.type,text,val,setto)); tomwalters@0: else tomwalters@0: disp(sprintf('%s(%12s) %30s = %s',indent,cont{i}.type,text,val)); tomwalters@0: end tomwalters@0: case 'button' tomwalters@0: disp(sprintf('%s( button) %22s (callback:) %s',indent,cont{i}.text,cont{i}.callback)); tomwalters@0: case 'panel' tomwalters@0: disp(sprintf('( panel) %22s with %d entries:',cont{i}.text,cont{i}.nr_elements)); tomwalters@0: otherwise tomwalters@0: % val=[]; tomwalters@0: % disp(sprintf('(%s) %s ',cont{i}.type,cont{i}.text,val)); tomwalters@0: end tomwalters@0: end