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
|
tomwalters@0
|
13
|
tomwalters@0
|
14
|
tomwalters@0
|
15 function handles=slider_start(hObject, eventdata, handles)
|
tomwalters@0
|
16 % controls the bahaoviour of the top slider
|
tomwalters@0
|
17 % normaly its the start time of the displayed signal, but in case of sai,
|
tomwalters@0
|
18 % the current frame number is displayed
|
tomwalters@0
|
19
|
tomwalters@0
|
20 curval=get(hObject,'Value');
|
tomwalters@0
|
21 handles.currentslidereditcombi=...
|
tomwalters@0
|
22 slidereditcontrol_set_rawslidervalue(handles.currentslidereditcombi,curval);
|
tomwalters@0
|
23
|
tomwalters@0
|
24 if handles.info.current_plot>=6 %sai has additionally the start time below:
|
tomwalters@0
|
25 sai=handles.data.sai;
|
tomwalters@0
|
26 cval=round(slidereditcontrol_get_value(handles.currentslidereditcombi));
|
tomwalters@0
|
27 start_time=getcurrentframestarttime(sai{cval});
|
tomwalters@0
|
28 set(handles.edit3,'String',num2str(fround(start_time*1000,1)));
|
tomwalters@0
|
29 else
|
tomwalters@0
|
30 % range check:
|
tomwalters@0
|
31 start=slidereditcontrol_get_value(handles.currentslidereditcombi);
|
tomwalters@0
|
32 dur=slidereditcontrol_get_value(handles.slideredit_duration);
|
tomwalters@0
|
33 sig=handles.data.signal;
|
tomwalters@0
|
34 siglen=getmaximumtime(sig);
|
tomwalters@0
|
35 if start+dur>siglen
|
tomwalters@0
|
36 start=siglen-dur;
|
tomwalters@0
|
37 handles.currentslidereditcombi=...
|
tomwalters@0
|
38 slidereditcontrol_set_value(handles.currentslidereditcombi,start);
|
tomwalters@0
|
39 end
|
tomwalters@0
|
40 % % and set a new range
|
tomwalters@0
|
41 % handles.slideredit_start=slidereditcontrol_set_range(handles.slideredit_start,dur); % the duration
|
tomwalters@0
|
42
|
tomwalters@0
|
43 end
|
tomwalters@0
|
44
|
tomwalters@0
|
45
|
tomwalters@0
|
46
|
tomwalters@0
|
47 return
|