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 %
|
bleeck@3
|
8 %
|
bleeck@3
|
9 % (c) 2011, University of Southampton
|
bleeck@3
|
10 % Maintained by Stefan Bleeck (bleeck@gmail.com)
|
bleeck@3
|
11 % download of current version is on the soundsoftware site:
|
bleeck@3
|
12 % http://code.soundsoftware.ac.uk/projects/aimmat
|
bleeck@3
|
13 % documentation and everything is on http://www.acousticscale.org
|
bleeck@3
|
14
|
bleeck@3
|
15
|
tomwalters@0
|
16
|
tomwalters@0
|
17 function aim_savecurrentstate(handles)
|
tomwalters@0
|
18 % save some crucial information to a file
|
tomwalters@0
|
19
|
tomwalters@0
|
20 nam=handles.info.projectfilename;
|
tomwalters@0
|
21
|
tomwalters@0
|
22 % in which directory is the wavefile? users could have changed it!
|
tomwalters@0
|
23 dirname=handles.info.original_soundfile_directory;
|
tomwalters@0
|
24
|
tomwalters@0
|
25 rnam=fullfile(dirname,nam);
|
tomwalters@0
|
26 id=fopen(rnam,'wt');
|
tomwalters@0
|
27
|
tomwalters@0
|
28 fprintf(id,'\n%% Project information');
|
tomwalters@0
|
29 fprintf(id,'\n%% for the project: \n\n%%%%%%%%%%%%%%%%%%%%%%%%%%');
|
tomwalters@0
|
30 fprintf(id,'\n%%');
|
tomwalters@0
|
31 filename=sprintf(' %s\n',handles.info.uniqueworkingname);
|
tomwalters@0
|
32 fprintf(id,filename);
|
tomwalters@0
|
33 fprintf(id,'%% %s',date);
|
tomwalters@0
|
34 fprintf(id,'\n%% produced by ');
|
tomwalters@0
|
35 result = license('inuse');
|
tomwalters@0
|
36 cuser=result(1).user;
|
tomwalters@0
|
37 fprintf(id,'%s',cuser);
|
tomwalters@0
|
38 fprintf(id,'\n%% Dont write anything in this file');
|
tomwalters@0
|
39 fprintf(id,'\n%%%%%%%%%%%%%%%%%%%%%%%%%%\n');
|
tomwalters@0
|
40
|
tomwalters@0
|
41 % infos about the setup of the project itself
|
tomwalters@0
|
42 % fprintf(id,'current_pcp_module=''%s'';\n',handles.info.calculated_pcp_module);
|
tomwalters@0
|
43 % fprintf(id,'current_bmm_module=''%s'';\n',handles.info.calculated_nap_module);
|
tomwalters@0
|
44 % fprintf(id,'current_nap_module=''%s'';\n',handles.info.calculated_bmm_module);
|
tomwalters@0
|
45 % fprintf(id,'current_strobes_module=''%s'';\n',handles.info.calculated_strobes_module);
|
tomwalters@0
|
46 % fprintf(id,'current_sai_module=''%s'';\n',handles.info.calculated_sai_module);
|
tomwalters@0
|
47 % fprintf(id,'current_usermodule=''%s'';\n',handles.info.calculated_usermodule_module);
|
tomwalters@0
|
48 % fprintf(id,'current_movie_module=''%s'';\n',handles.info.calculated_movie_module);
|
tomwalters@0
|
49
|
tomwalters@0
|
50
|
tomwalters@0
|
51 % and infos about the grapical display
|
tomwalters@0
|
52 fprintf(id,'current_plot=%d;\n',handles.info.current_plot);
|
tomwalters@0
|
53
|
tomwalters@0
|
54 start_time=slidereditcontrol_get_value(handles.currentslidereditcombi);
|
tomwalters@0
|
55 if handles.info.current_plot<6
|
tomwalters@0
|
56 fprintf(id,'start_time=%f;\n',start_time);
|
tomwalters@0
|
57 else
|
tomwalters@0
|
58 fprintf(id,'start_time=%d;\n',round(start_time));
|
tomwalters@0
|
59 end
|
tomwalters@0
|
60
|
tomwalters@0
|
61 duration=slidereditcontrol_get_value(handles.slideredit_duration);
|
tomwalters@0
|
62 fprintf(id,'duration=%f;\n',duration);
|
tomwalters@0
|
63 scale=slidereditcontrol_get_value(handles.slideredit_scale);
|
tomwalters@0
|
64 fprintf(id,'scale=%f;\n',scale);
|
tomwalters@0
|
65
|
tomwalters@0
|
66
|
tomwalters@0
|
67 hastime=get(handles.checkbox6,'Value');
|
tomwalters@0
|
68 hasfreq=get(handles.checkbox7,'Value');
|
tomwalters@0
|
69 hassignal=get(handles.checkbox10,'Value');
|
tomwalters@0
|
70 fprintf(id,'hastime=%d;\n',hastime);
|
tomwalters@0
|
71 fprintf(id,'hasfreq=%d;\n',hasfreq);
|
tomwalters@0
|
72 fprintf(id,'hassignal=%d;\n',hassignal);
|
tomwalters@0
|
73
|
tomwalters@0
|
74 pos=get(handles.figure1,'Position');
|
tomwalters@0
|
75 if isfield(handles.info,'current_figure')
|
tomwalters@0
|
76 fprintf(id,'winx=%d;\n',pos(1));
|
tomwalters@0
|
77 fprintf(id,'winy=%d;\n',pos(2));
|
tomwalters@0
|
78 if ishandle(handles.info.current_figure)
|
tomwalters@0
|
79 gpos=get(handles.info.current_figure,'Position');
|
tomwalters@0
|
80 fprintf(id,'grafixwinnr=%d;\n',handles.info.current_figure);
|
tomwalters@0
|
81 fprintf(id,'grafixwinx=%d;\n',gpos(1));
|
tomwalters@0
|
82 fprintf(id,'grafixwiny=%d;\n',gpos(2));
|
tomwalters@0
|
83 fprintf(id,'grafixwinb=%d;\n',gpos(3));
|
tomwalters@0
|
84 fprintf(id,'grafixwinh=%d;\n',gpos(4));
|
tomwalters@0
|
85 end
|
tomwalters@0
|
86 end
|
tomwalters@0
|
87 fclose(id); |