annotate aim-mat/gui/edit_start.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 % procedure for 'aim-mat'
tomwalters@0 2 %
tomwalters@0 3 % INPUT VALUES:
tomwalters@0 4 %
tomwalters@0 5 % RETURN VALUE:
tomwalters@0 6 %
tomwalters@0 7 %
tomwalters@0 8 % (c) 2011, University of Southampton
bleeck@3 9 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 10 % download of current version is on the soundsoftware site:
bleeck@3 11 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 12 % documentation and everything is on http://www.acousticscale.org
bleeck@3 13
tomwalters@0 14
tomwalters@0 15
tomwalters@0 16 function handles=edit_start(hObject, eventdata, handles)
tomwalters@0 17
tomwalters@0 18 curval=get(hObject,'String');
tomwalters@0 19 curval=str2num(curval);
tomwalters@0 20 handles.currentslidereditcombi=...
tomwalters@0 21 slidereditcontrol_set_raweditvalue(handles.currentslidereditcombi,curval);
tomwalters@0 22
tomwalters@0 23 if handles.info.current_plot>=6 %sai has additionally the start time below:
tomwalters@0 24 sai=handles.data.sai;
tomwalters@0 25 cval=slidereditcontrol_get_value(handles.currentslidereditcombi);
tomwalters@0 26 cval=round(cval);
tomwalters@0 27 start_time=getcurrentframestarttime(sai{cval});
tomwalters@0 28 set(handles.edit2,'String',num2str(cval));
tomwalters@0 29 set(handles.edit3,'String',num2str(fround(start_time*1000,1)));
tomwalters@0 30 else
tomwalters@0 31 % range check:
tomwalters@0 32 start=slidereditcontrol_get_value(handles.currentslidereditcombi);
tomwalters@0 33 start=max(start,0);
tomwalters@0 34 dur=slidereditcontrol_get_value(handles.slideredit_duration);
tomwalters@0 35 sig=handles.data.signal;
tomwalters@0 36 siglen=getmaximumtime(sig);
tomwalters@0 37 if start+dur>siglen
tomwalters@0 38 start=siglen-dur;
tomwalters@0 39 end
tomwalters@0 40 handles.currentslidereditcombi=...
tomwalters@0 41 slidereditcontrol_set_value(handles.currentslidereditcombi,start);
tomwalters@0 42 % % and set a new range
tomwalters@0 43 % handles.slideredit_start=slidereditcontrol_set_range(handles.slideredit_start,dur); % the duration
tomwalters@0 44
tomwalters@0 45 end