tomwalters@0: % tool tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % bleeck@3: % This external file is included as part of the 'aim-mat' distribution package 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 bleeck@3: tomwalters@0: tomwalters@0: function combi=slidereditcontrol_set_value(combi,value) tomwalters@0: % a slidereditcontrol consists of a slider and an edit object, that are tomwalters@0: % related. When one value changes, the other also changes. tomwalters@0: % The combination has the following variables: tomwalters@0: % sliderhandle - the handle of the slider control tomwalters@0: % edithandle - the handle of the edit control tomwalters@0: % minvalue - the minimum value allowed tomwalters@0: % maxvalue - the maximum allowed value tomwalters@0: % (current_value - the current value) tomwalters@0: % is_log - whether the slider reponds logarithmically tomwalters@0: % editscaler - a number, that is multiplied to the edit control (to make ms of secs) tomwalters@0: % nreditdigits - the number of digits in the edit control tomwalters@0: tomwalters@0: % translate the value to the value, the slider wants to see tomwalters@0: if combi.is_log==1 tomwalters@0: sliderval=f2f(value,combi.minvalue,combi.maxvalue,0,1,'loglin'); tomwalters@0: else tomwalters@0: sliderval=f2f(value,combi.minvalue,combi.maxvalue,0,1,'linlin'); tomwalters@0: end tomwalters@0: sliderval=max(sliderval,0); tomwalters@0: sliderval=min(sliderval,1); tomwalters@0: set(combi.sliderhandle,'Value',sliderval); tomwalters@0: tomwalters@0: editval=value*combi.editscaler; tomwalters@0: editval=max(editval,combi.minvalue*combi.editscaler); tomwalters@0: editval=min(editval,combi.maxvalue*combi.editscaler); tomwalters@0: tomwalters@0: editval=fround(editval,combi.nreditdigits); tomwalters@0: set(combi.edithandle,'String',num2str(editval)); tomwalters@0: tomwalters@0: combi.current_value=value;