annotate aim-mat/gui/init_aim_gui.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 % handles : all relevant parameters
tomwalters@0 5 %
tomwalters@0 6 % RETURN VALUE:
tomwalters@0 7 %
tomwalters@0 8 % reset the graphic and everything in the GUI
tomwalters@0 9 %
tomwalters@0 10 %
bleeck@3 11 %
tomwalters@0 12 % (c) 2011, University of Southampton
bleeck@3 13 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 14 % download of current version is on the soundsoftware site:
bleeck@3 15 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 16 % documentation and everything is on http://www.acousticscale.org
bleeck@3 17
tomwalters@0 18
tomwalters@0 19
tomwalters@0 20
tomwalters@0 21 function handles=init_aim_gui(handles)
tomwalters@0 22
tomwalters@0 23 % TCW AIM2006
tomwalters@0 24 handles.hand_scaling=1;
tomwalters@0 25
tomwalters@0 26 modus=handles.screen_modus;
tomwalters@0 27
tomwalters@0 28 switch modus
tomwalters@0 29 case 'screen'
tomwalters@0 30 % set some colors: (green for display)
tomwalters@0 31 %handles.colors.background=[0 .502 0]; %Old AIM
tomwalters@0 32 handles.colors.background=[236/255 233/255 240/255];
tomwalters@0 33 handles.colors.green1=[0 0.75 0];
tomwalters@0 34 handles.colors.green2=[0 1 0];
tomwalters@0 35 handles.colors.blue2=[0 0 1];
tomwalters@0 36 handles.colors.blue1=[0.5 0 0];
tomwalters@0 37 handles.colors.white=[1 1 1];
tomwalters@0 38 handles.colors.black=[0 0 0];
tomwalters@0 39 handles.colors.blue3=[0 0.5 0.5];
tomwalters@0 40 handles.colors.textonbackground=handles.colors.black;
tomwalters@0 41 handles.colors.textonbuttons=handles.colors.black;
tomwalters@0 42 handles.colors.buttoncolor=[0.831 0.816 0.784];
tomwalters@0 43 case 'paper'
tomwalters@0 44 % set some colors: (gray for publication)
tomwalters@0 45 handles.colors.background=[0.83 0.83 0.83];
tomwalters@0 46 handles.colors.green1=[0.75 0.75 0.75];
tomwalters@0 47 handles.colors.green2=[0.6 0.6 0.6];
tomwalters@0 48 handles.colors.blue2=[0.5 0.5 0.5];
tomwalters@0 49 handles.colors.blue1=[0.4 0.4 0.4];
tomwalters@0 50 handles.colors.white=[1 1 1];
tomwalters@0 51 handles.colors.black=[0 0 0];
tomwalters@0 52 handles.colors.blue3=[0.8 0.8 0.8];
tomwalters@0 53 handles.colors.textonbackground=handles.colors.black;
tomwalters@0 54 handles.colors.textonbuttons=handles.colors.white;
tomwalters@0 55 handles.colors.buttoncolor=handles.colors.green1;
tomwalters@0 56 end
tomwalters@0 57
tomwalters@0 58 set(handles.figure1,'Color',handles.colors.background);
tomwalters@0 59 set(handles.text23,'BackgroundColor',handles.colors.background);
tomwalters@0 60 set(handles.text23,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 61 set(handles.text19,'BackgroundColor',handles.colors.background);
tomwalters@0 62 set(handles.text19,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 63 set(handles.text17,'BackgroundColor',handles.colors.background);
tomwalters@0 64 set(handles.text17,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 65 set(handles.displayduration,'BackgroundColor',handles.colors.background);
tomwalters@0 66 set(handles.displayduration,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 67 set(handles.text20,'BackgroundColor',handles.colors.background);
tomwalters@0 68 set(handles.text20,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 69 set(handles.text28,'BackgroundColor',handles.colors.background);
tomwalters@0 70 set(handles.text28,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 71 set(handles.text29,'BackgroundColor',handles.colors.background);
tomwalters@0 72 set(handles.text29,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 73 set(handles.text30,'BackgroundColor',handles.colors.background);
tomwalters@0 74 set(handles.text30,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 75 set(handles.text27,'BackgroundColor',handles.colors.background);
tomwalters@0 76 set(handles.text27,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 77 set(handles.text25,'BackgroundColor',handles.colors.background);
tomwalters@0 78 set(handles.text25,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 79 set(handles.text24,'BackgroundColor',handles.colors.background);
tomwalters@0 80 set(handles.text24,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 81 set(handles.text9,'BackgroundColor',handles.colors.background);
tomwalters@0 82 set(handles.text9,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 83 set(handles.text10,'BackgroundColor',handles.colors.background);
tomwalters@0 84 set(handles.text10,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 85 set(handles.text8,'BackgroundColor',handles.colors.background);
tomwalters@0 86 set(handles.text8,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 87 set(handles.text7,'BackgroundColor',handles.colors.background);
tomwalters@0 88 set(handles.text7,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 89 set(handles.text21,'BackgroundColor',handles.colors.background);
tomwalters@0 90 set(handles.text21,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 91 set(handles.text22,'BackgroundColor',handles.colors.background);
tomwalters@0 92 set(handles.text22,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 93 set(handles.text13,'BackgroundColor',handles.colors.background);
tomwalters@0 94 set(handles.text13,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 95
tomwalters@0 96 set(handles.frame16,'BackgroundColor',handles.colors.background);
tomwalters@0 97 set(handles.frame15,'BackgroundColor',handles.colors.background);
tomwalters@0 98 set(handles.frame18,'BackgroundColor',handles.colors.background);
tomwalters@0 99 set(handles.frame17,'BackgroundColor',handles.colors.background);
tomwalters@0 100 set(handles.frame17,'ForegroundColor',handles.colors.black);
tomwalters@0 101 set(handles.frame14,'BackgroundColor',handles.colors.background);
tomwalters@0 102 set(handles.frame14,'ForegroundColor',handles.colors.black);
tomwalters@0 103 set(handles.frame19,'BackgroundColor',handles.colors.background);
tomwalters@0 104 set(handles.frame19,'ForegroundColor',handles.colors.background);
tomwalters@0 105
tomwalters@0 106 set(handles.frame7,'BackgroundColor',handles.colors.background);
tomwalters@0 107 set(handles.frame10,'BackgroundColor',handles.colors.blue3);
tomwalters@0 108
tomwalters@0 109 set(handles.checkbox10,'BackgroundColor',handles.colors.background);
tomwalters@0 110 set(handles.checkbox10,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 111 set(handles.checkbox6,'BackgroundColor',handles.colors.background);
tomwalters@0 112 set(handles.checkbox6,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 113 set(handles.checkbox7,'BackgroundColor',handles.colors.background);
tomwalters@0 114 set(handles.checkbox7,'ForegroundColor',handles.colors.textonbackground);
tomwalters@0 115
tomwalters@0 116 set(handles.checkbox0,'BackgroundColor',handles.colors.background);
tomwalters@0 117 set(handles.checkbox1,'BackgroundColor',handles.colors.background);
tomwalters@0 118 set(handles.checkbox2,'BackgroundColor',handles.colors.background);
tomwalters@0 119 set(handles.checkbox3,'BackgroundColor',handles.colors.background);
tomwalters@0 120 set(handles.checkbox4,'BackgroundColor',handles.colors.background);
tomwalters@0 121 set(handles.checkbox8,'BackgroundColor',handles.colors.background);
tomwalters@0 122 set(handles.checkbox5,'BackgroundColor',handles.colors.blue3);
tomwalters@0 123
tomwalters@0 124 set(handles.pushbutton24,'BackgroundColor',handles.colors.buttoncolor);
tomwalters@0 125 set(handles.pushbutton25,'BackgroundColor',handles.colors.buttoncolor);
tomwalters@0 126 set(handles.pushbuttonautoscale,'BackgroundColor',handles.colors.buttoncolor);
tomwalters@0 127 set(handles.slider1,'BackgroundColor',handles.colors.buttoncolor);
tomwalters@0 128 set(handles.slider2,'BackgroundColor',handles.colors.buttoncolor);
tomwalters@0 129 set(handles.slider3,'BackgroundColor',handles.colors.buttoncolor);
tomwalters@0 130
tomwalters@0 131
tomwalters@0 132 % % % first load the default values from the default parameter file:
tomwalters@0 133 % handles=loadallparameterfiles(handles);
tomwalters@0 134 all_options=handles.all_options;
tomwalters@0 135
tomwalters@0 136
tomwalters@0 137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tomwalters@0 138 %%%%%%%%% PCP
tomwalters@0 139 pcpnames = fieldnames(all_options.pcp);
tomwalters@0 140 finalpcpnames=[];
tomwalters@0 141 finddefault=1;
tomwalters@0 142 findold=-1;
tomwalters@0 143
tomwalters@0 144 % TCW AIM2006 Reorder the list so that the default value comes first
tomwalters@0 145 for i=1:length(pcpnames)
tomwalters@0 146 if strcmp(pcpnames{i},handles.info.default_start_module_pcp)
tomwalters@0 147 finalpcpnames=[pcpnames(i) finalpcpnames];
tomwalters@0 148 else
tomwalters@0 149 finalpcpnames=[finalpcpnames pcpnames(i)];
tomwalters@0 150 end
tomwalters@0 151 end
tomwalters@0 152 %%%
tomwalters@0 153
tomwalters@0 154 for i=1:length(finalpcpnames)
tomwalters@0 155 if strcmp(finalpcpnames{i},handles.info.default_start_module_pcp)
tomwalters@0 156 finddefault=i;
tomwalters@0 157 end
tomwalters@0 158 if isfield(handles.info,'init')
tomwalters@0 159 if isfield(handles.info.init,'calculated_pcp_module')
tomwalters@0 160 if strcmp(finalpcpnames{i},handles.info.init.calculated_pcp_module)
tomwalters@0 161 findold=i;
tomwalters@0 162 end
tomwalters@0 163 end
tomwalters@0 164 end
tomwalters@0 165 end
tomwalters@0 166 set(handles.listbox0,'String',finalpcpnames);
tomwalters@0 167 if findold>0
tomwalters@0 168 handles.info.current_pcp_module=finalpcpnames{findold};
tomwalters@0 169 set(handles.listbox0,'Value',findold);
tomwalters@0 170 else
tomwalters@0 171 handles.info.current_pcp_module=finalpcpnames{finddefault};
tomwalters@0 172 set(handles.listbox0,'Value',finddefault);
tomwalters@0 173 end
tomwalters@0 174 handles.info.defaults.default_pcp_module=finddefault;
tomwalters@0 175
tomwalters@0 176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tomwalters@0 177 %%%%%%%%% BMM
tomwalters@0 178 bmmnames = fieldnames(all_options.bmm);
tomwalters@0 179 finalbmmnames=[];
tomwalters@0 180 finddefault=1;
tomwalters@0 181 findold=-1;
tomwalters@0 182 % TCW AIM2006 Reorder the list so that the default value comes first
tomwalters@0 183 for i=1:length(bmmnames)
tomwalters@0 184 if strcmp(bmmnames{i},handles.info.default_start_module_bmm)
tomwalters@0 185 finalbmmnames=[bmmnames(i) finalbmmnames];
tomwalters@0 186 else
tomwalters@0 187 finalbmmnames=[finalbmmnames bmmnames(i)];
tomwalters@0 188 end
tomwalters@0 189 end
tomwalters@0 190 %%%
tomwalters@0 191
tomwalters@0 192 for i=1:length(finalbmmnames)
tomwalters@0 193 if strcmp(finalbmmnames{i},handles.info.default_start_module_bmm)
tomwalters@0 194 finddefault=i;
tomwalters@0 195 end
tomwalters@0 196 if isfield(handles.info,'init')
tomwalters@0 197 if isfield(handles.info.init,'calculated_bmm_module')
tomwalters@0 198 if strcmp(finalbmmnames{i},handles.info.init.calculated_bmm_module)
tomwalters@0 199 findold=i;
tomwalters@0 200 end
tomwalters@0 201 end
tomwalters@0 202 end
tomwalters@0 203 end
tomwalters@0 204 set(handles.listbox1,'String',finalbmmnames);
tomwalters@0 205 if findold>0
tomwalters@0 206 handles.info.current_bmm_module=finalbmmnames{findold};
tomwalters@0 207 set(handles.listbox1,'Value',findold);
tomwalters@0 208 else
tomwalters@0 209 handles.info.current_bmm_module=finalbmmnames{finddefault};
tomwalters@0 210 set(handles.listbox1,'Value',finddefault);
tomwalters@0 211 end
tomwalters@0 212 handles.info.defaults.default_bmm_module=finddefault;
tomwalters@0 213
tomwalters@0 214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tomwalters@0 215 %%%%%%%%% NAP
tomwalters@0 216 napnames = fieldnames(all_options.nap);
tomwalters@0 217 finalnapnames=[];
tomwalters@0 218 finddefault=1;
tomwalters@0 219 findold=-1;
tomwalters@0 220 % TCW AIM2006 Reorder the list so that the default value comes first
tomwalters@0 221 for i=1:length(napnames)
tomwalters@0 222 if strcmp(napnames{i},handles.info.default_start_module_nap)
tomwalters@0 223 finalnapnames=[napnames(i) finalnapnames];
tomwalters@0 224 else
tomwalters@0 225 finalnapnames=[finalnapnames napnames(i)];
tomwalters@0 226 end
tomwalters@0 227 end
tomwalters@0 228 %%%
tomwalters@0 229
tomwalters@0 230 for i=1:length(finalnapnames)
tomwalters@0 231 if strcmp(finalnapnames{i},handles.info.default_start_module_nap)
tomwalters@0 232 finddefault=i;
tomwalters@0 233 end
tomwalters@0 234 if isfield(handles.info,'init')
tomwalters@0 235 if isfield(handles.info.init,'calculated_nap_module')
tomwalters@0 236 if strcmp(finalnapnames{i},handles.info.init.calculated_nap_module)
tomwalters@0 237 findold=i;
tomwalters@0 238 end
tomwalters@0 239 end
tomwalters@0 240 end
tomwalters@0 241 end
tomwalters@0 242 set(handles.listbox2,'String',finalnapnames);
tomwalters@0 243 if findold>0
tomwalters@0 244 handles.info.current_nap_module=finalnapnames{findold};
tomwalters@0 245 set(handles.listbox2,'Value',findold);
tomwalters@0 246 else
tomwalters@0 247 handles.info.current_nap_module=finalnapnames{finddefault};
tomwalters@0 248 set(handles.listbox2,'Value',finddefault);
tomwalters@0 249 end
tomwalters@0 250 handles.info.defaults.default_nap_module=finddefault;
tomwalters@0 251
tomwalters@0 252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tomwalters@0 253 %%%%%%%%% STROBES
tomwalters@0 254 strobesnames = fieldnames(all_options.strobes);
tomwalters@0 255 finalstrobesnames=[];
tomwalters@0 256 finddefault=1;
tomwalters@0 257 findold=-1;
tomwalters@0 258
tomwalters@0 259 % TCW AIM2006 Reorder the list so that the default value comes first
tomwalters@0 260 for i=1:length(strobesnames)
tomwalters@0 261 if strcmp(strobesnames{i},handles.info.default_start_module_strobes)
tomwalters@0 262 finalstrobesnames=[strobesnames(i) finalstrobesnames];
tomwalters@0 263 else
tomwalters@0 264 finalstrobesnames=[finalstrobesnames strobesnames(i)];
tomwalters@0 265 end
tomwalters@0 266 end
tomwalters@0 267
tomwalters@0 268 for i=1:length(finalstrobesnames)
tomwalters@0 269 %finalstrobesnames=[finalstrobesnames strobesnames(i)];
tomwalters@0 270 % default value is sf2003:
tomwalters@0 271 if strcmp(finalstrobesnames{i},handles.info.default_start_module_strobes)
tomwalters@0 272 finddefault=i;
tomwalters@0 273 end
tomwalters@0 274 % if loaded from a project, set the settings to the loaded ones
tomwalters@0 275 if isfield(handles.info,'init')
tomwalters@0 276 if isfield(handles.info.init,'calculated_strobes_module')
tomwalters@0 277 if strcmp(finalstrobesnames{i},handles.info.init.calculated_strobes_module)
tomwalters@0 278 findold=i;
tomwalters@0 279 end
tomwalters@0 280 end
tomwalters@0 281 end
tomwalters@0 282 end
tomwalters@0 283 set(handles.listbox3,'String',finalstrobesnames);
tomwalters@0 284 if findold>0
tomwalters@0 285 handles.info.current_strobes_module=finalstrobesnames{findold};
tomwalters@0 286 set(handles.listbox3,'Value',findold);
tomwalters@0 287 else
tomwalters@0 288 handles.info.current_strobes_module=finalstrobesnames{finddefault};
tomwalters@0 289 set(handles.listbox3,'Value',finddefault);
tomwalters@0 290 end
tomwalters@0 291 handles.info.defaults.default_strobes_module=finddefault;
tomwalters@0 292
tomwalters@0 293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tomwalters@0 294 %%%%%%%%% SAI
tomwalters@0 295 sainames = fieldnames(all_options.sai);
tomwalters@0 296 finalsainames=[];
tomwalters@0 297 finddefault=1;
tomwalters@0 298 findold=-1;
tomwalters@0 299
tomwalters@0 300 % TCW AIM2006 Reorder the list so that the default value comes first
tomwalters@0 301 for i=1:length(sainames)
tomwalters@0 302 if strcmp(sainames{i},handles.info.default_start_module_sai)
tomwalters@0 303 finalsainames=[sainames(i) finalsainames];
tomwalters@0 304 else
tomwalters@0 305 finalsainames=[finalsainames sainames(i)];
tomwalters@0 306 end
tomwalters@0 307 end
tomwalters@0 308
tomwalters@0 309 for i=1:length(finalsainames)
tomwalters@0 310 if strcmp(finalsainames{i},handles.info.default_start_module_sai)
tomwalters@0 311 finddefault=i;
tomwalters@0 312 end
tomwalters@0 313 if isfield(handles.info,'init')
tomwalters@0 314 if isfield(handles.info.init,'calculated_sai_module')
tomwalters@0 315 if strcmp(finalsainames{i},handles.info.init.calculated_sai_module)
tomwalters@0 316 findold=i;
tomwalters@0 317 end
tomwalters@0 318 end
tomwalters@0 319 end
tomwalters@0 320 end
tomwalters@0 321 set(handles.listbox4,'String',finalsainames);
tomwalters@0 322 if findold>0
tomwalters@0 323 handles.info.current_sai_module=finalsainames{findold};
tomwalters@0 324 set(handles.listbox4,'Value',findold);
tomwalters@0 325 else
tomwalters@0 326 handles.info.current_sai_module=finalsainames{finddefault};
tomwalters@0 327 set(handles.listbox4,'Value',finddefault);
tomwalters@0 328 end
tomwalters@0 329 handles.info.defaults.default_sai_module=finddefault;
tomwalters@0 330
tomwalters@0 331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tomwalters@0 332 %%%%%%%%% USERMODULES
tomwalters@0 333 usermodulenames = fieldnames(all_options.usermodule);
tomwalters@0 334 finalusermodulenames=[];
tomwalters@0 335 finddefault=1;
tomwalters@0 336 findold=-1;
tomwalters@0 337
tomwalters@0 338 % TCW AIM2006 Reorder the list so that the default value comes first
tomwalters@0 339 for i=1:length(usermodulenames)
tomwalters@0 340 if strcmp(usermodulenames{i},handles.info.default_start_module_usermodule)
tomwalters@0 341 finalusermodulenames=[usermodulenames(i) finalusermodulenames];
tomwalters@0 342 else
tomwalters@0 343 finalusermodulenames=[finalusermodulenames usermodulenames(i)];
tomwalters@0 344 end
tomwalters@0 345 end
tomwalters@0 346
tomwalters@0 347 for i=1:length(finalusermodulenames)
tomwalters@0 348 %finalusermodulenames=[finalusermodulenames usermodulenames(i)];
tomwalters@0 349 % default value is dualprofile:
tomwalters@0 350 if strcmp(finalusermodulenames{i},handles.info.default_start_module_usermodule)
tomwalters@0 351 finddefault=i;
tomwalters@0 352 end
tomwalters@0 353 if isfield(handles.info,'init')
tomwalters@0 354 if isfield(handles.info.init,'calculated_usermodule_module')
tomwalters@0 355 if strcmp(finalusermodulenames{i},handles.info.init.calculated_usermodule_module)
tomwalters@0 356 findold=i;
tomwalters@0 357 end
tomwalters@0 358 end
tomwalters@0 359 end
tomwalters@0 360
tomwalters@0 361 end
tomwalters@0 362 set(handles.listbox6,'String',finalusermodulenames);
tomwalters@0 363 if findold>0
tomwalters@0 364 handles.info.current_usermodule_module=finalusermodulenames{findold};
tomwalters@0 365 set(handles.listbox6,'Value',findold);
tomwalters@0 366 else
tomwalters@0 367 handles.info.current_usermodule_module=finalusermodulenames{finddefault};
tomwalters@0 368 set(handles.listbox6,'Value',finddefault);
tomwalters@0 369 end
tomwalters@0 370 handles.info.defaults.default_usermodule_module=finddefault;
tomwalters@0 371
tomwalters@0 372
tomwalters@0 373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tomwalters@0 374 %%%%%%%%% MOVIES
tomwalters@0 375 movienames = fieldnames(all_options.movie);
tomwalters@0 376 finalmovienames=[];
tomwalters@0 377 finddefault=1;
tomwalters@0 378 findold=-1;
tomwalters@0 379 for i=1:length(movienames)
tomwalters@0 380 finalmovienames=[finalmovienames movienames(i)];
tomwalters@0 381 % default value is dpai:
tomwalters@0 382 if strcmp(finalmovienames{i},handles.info.default_start_module_movie)
tomwalters@0 383 finddefault=i;
tomwalters@0 384 end
tomwalters@0 385 if isfield(handles.info,'init')
tomwalters@0 386 if isfield(handles.info.init,'calculated_movie_module')
tomwalters@0 387 if strcmp(finalmovienames{i},handles.info.init.calculated_movie_module)
tomwalters@0 388 findold=i;
tomwalters@0 389 end
tomwalters@0 390 end
tomwalters@0 391 end
tomwalters@0 392
tomwalters@0 393 end
tomwalters@0 394 set(handles.listbox5,'String',finalmovienames);
tomwalters@0 395 if findold>0
tomwalters@0 396 handles.info.current_movie_module=finalmovienames{findold};
tomwalters@0 397 set(handles.listbox5,'Value',findold);
tomwalters@0 398 else
tomwalters@0 399 handles.info.current_movie_module=finalmovienames{finddefault};
tomwalters@0 400 set(handles.listbox5,'Value',finddefault);
tomwalters@0 401 end
tomwalters@0 402 handles.info.defaults.default_movie_module=finddefault;
tomwalters@0 403
tomwalters@0 404
tomwalters@0 405
tomwalters@0 406
tomwalters@0 407
tomwalters@0 408
tomwalters@0 409 % set all calculation orders to false
tomwalters@0 410 handles.info.calculate_signal=0;
tomwalters@0 411 handles.info.calculate_pcp=0;
tomwalters@0 412 handles.info.calculate_bmm=0;
tomwalters@0 413 handles.info.calculate_nap=0;
tomwalters@0 414 handles.info.calculate_strobes=0;
tomwalters@0 415 handles.info.calculate_sai=0;
tomwalters@0 416 handles.info.calculate_usermodule=0;
tomwalters@0 417 handles.info.calculate_movie=0;
tomwalters@0 418
tomwalters@0 419 % in the graphic version, store the results
tomwalters@0 420 handles.info.save_signal=1;
tomwalters@0 421 handles.info.save_pcp=1;
tomwalters@0 422 handles.info.save_bmm=1;
tomwalters@0 423 handles.info.save_nap=1;
tomwalters@0 424 handles.info.save_strobes=1;
tomwalters@0 425 handles.info.save_sai=1;
tomwalters@0 426 handles.info.save_usermodule=1;
tomwalters@0 427 handles.info.save_movie=1;
tomwalters@0 428
tomwalters@0 429
tomwalters@0 430
tomwalters@0 431
tomwalters@0 432 if isfield(handles.info,'init')
tomwalters@0 433 set(handles.checkbox6,'Value',handles.info.init.hastime);
tomwalters@0 434 set(handles.checkbox7,'Value',handles.info.init.hasfreq);
tomwalters@0 435 set(handles.checkbox10,'Value',handles.info.init.hassignal);
tomwalters@0 436 handles.info.old_current_plot=0;
tomwalters@0 437
tomwalters@0 438 else
tomwalters@0 439 % set the frequency profile off
tomwalters@0 440 set(handles.checkbox6,'Value',0);
tomwalters@0 441 % set the temporal profile off
tomwalters@0 442 set(handles.checkbox7,'Value',0);
tomwalters@0 443 % set the signal on
tomwalters@0 444 set(handles.checkbox10,'Value',1);
tomwalters@0 445 % set the current visible plot (the signal alone)
tomwalters@0 446 handles.info.current_plot=-1;
tomwalters@0 447 handles.info.old_current_plot=0;
tomwalters@0 448 end
tomwalters@0 449
tomwalters@0 450
tomwalters@0 451
tomwalters@0 452 if isfield(handles.info,'init')
tomwalters@0 453 duration=handles.info.init.duration;
tomwalters@0 454 start_time=handles.info.init.start_time;
tomwalters@0 455 scale=handles.info.init.scale;
tomwalters@0 456 else
tomwalters@0 457 duration=0.04;
tomwalters@0 458 start_time=0;
tomwalters@0 459 scale=1;
tomwalters@0 460 end
tomwalters@0 461
tomwalters@0 462
tomwalters@0 463 sig=handles.data.signal;
tomwalters@0 464
tomwalters@0 465
tomwalters@0 466 % set up the combicontrols
tomwalters@0 467 handles.slideredit_start=slidereditcontrol_setup(...
tomwalters@0 468 handles.slider2,... % handle of the slider
tomwalters@0 469 handles.edit2,...% handle of the edit control
tomwalters@0 470 getminimumtime(sig), ... % min value
tomwalters@0 471 getmaximumtime(sig), ... % max value
tomwalters@0 472 max(start_time,getminimumtime(sig)), ... % current value
tomwalters@0 473 0, ... % islog
tomwalters@0 474 1000, ...% multiplier on the edit control
tomwalters@0 475 1); % nr digits in the edit control after comma
tomwalters@0 476 handles.slideredit_duration=slidereditcontrol_setup(...
tomwalters@0 477 handles.slider3,... % handle of the slider
tomwalters@0 478 handles.edit3,...% handle of the edit control
tomwalters@0 479 0.001, ... % min value
tomwalters@0 480 getlength(sig), ... % max value
tomwalters@0 481 duration, ... % current value
tomwalters@0 482 0, ... % islog
tomwalters@0 483 1000, ...% multiplier on the edit control
tomwalters@0 484 1); % nr digits in the edit control after comma
tomwalters@0 485 handles.slideredit_scale=slidereditcontrol_setup(...
tomwalters@0 486 handles.slider1,... % handle of the slider
tomwalters@0 487 handles.edit1,...% handle of the edit control
tomwalters@0 488 0.001, ... % min value
tomwalters@0 489 1000, ... % max value
tomwalters@0 490 scale, ... % current value
tomwalters@0 491 1, ... % islog
tomwalters@0 492 1, ...% multiplier on the edit control
tomwalters@0 493 3); % nr digits in the edit control after comma
tomwalters@0 494 handles.slideredit_frames=slidereditcontrol_setup(...
tomwalters@0 495 handles.slider2,... % handle of the slider
tomwalters@0 496 handles.edit2,...% handle of the edit control
tomwalters@0 497 1, ... % min value
tomwalters@0 498 100, ... % max value
tomwalters@0 499 start_time, ... % current value
tomwalters@0 500 0, ... % islog
tomwalters@0 501 1, ...% multiplier on the edit control
tomwalters@0 502 0); % nr digits in the edit control after comma
tomwalters@0 503
tomwalters@0 504 current_plot=handles.info.current_plot;
tomwalters@0 505 if current_plot<6
tomwalters@0 506 handles.currentslidereditcombi=handles.slideredit_start;
tomwalters@0 507 else
tomwalters@0 508 handles.slideredit_frames.maxvalue=length(handles.data.sai);
tomwalters@0 509 handles.currentslidereditcombi=handles.slideredit_frames;
tomwalters@0 510 % handles.currentslidereditcombi=
tomwalters@0 511 end
tomwalters@0 512 % handles.slideredit_scale=slidereditcontrol_set_value(handles.slideredit_scale,scale);
tomwalters@0 513 % handles.slideredit_duration=slidereditcontrol_set_value(handles.slideredit_duration,duration);
tomwalters@0 514 handles.slideredit_start=slidereditcontrol_set_range(handles.slideredit_start,duration);
tomwalters@0 515
tomwalters@0 516 handles=aim_set_current_slider(handles);
tomwalters@0 517
tomwalters@0 518 % display the signal lenght and samplerate
tomwalters@0 519 len=getlength(sig);
tomwalters@0 520 if len>1
tomwalters@0 521 set(handles.displayduration,'String',num2str(fround(getlength(sig),2)));
tomwalters@0 522 set(handles.text20,'String','sec');
tomwalters@0 523 else
tomwalters@0 524 set(handles.displayduration,'String',num2str(fround(getlength(sig)*1000,0)));
tomwalters@0 525 set(handles.text20,'String','ms');
tomwalters@0 526 end
tomwalters@0 527 % samlerate
tomwalters@0 528 set(handles.text25,'String',num2str(fround(getsr(sig)/1000,1)));
tomwalters@0 529
tomwalters@0 530 % offset
tomwalters@0 531 if start_time>0
tomwalters@0 532 set(handles.text29,'String',num2str(fround(start_time*1000,1)));
tomwalters@0 533 set(handles.text29,'Visible','on');
tomwalters@0 534 set(handles.text30,'Visible','on');
tomwalters@0 535 else
tomwalters@0 536 set(handles.text29,'Visible','off');
tomwalters@0 537 set(handles.text30,'Visible','off');
tomwalters@0 538 end
tomwalters@0 539
tomwalters@0 540
tomwalters@0 541 set(handles.edit1,'Enable','on');
tomwalters@0 542 set(handles.slider1,'Enable','on');
tomwalters@0 543 set(handles.edit2,'Enable','on');
tomwalters@0 544 set(handles.slider2,'Enable','on');
tomwalters@0 545 set(handles.edit3,'Enable','on');
tomwalters@0 546 set(handles.slider3,'Enable','on');
tomwalters@0 547
tomwalters@0 548
tomwalters@0 549 % set the displayed module name to the one that was loaded
tomwalters@0 550 if handles.info.pcp_loaded
tomwalters@0 551 setstring(handles.listbox0,handles.info.current_pcp_module);end
tomwalters@0 552 if handles.info.bmm_loaded
tomwalters@0 553 setstring(handles.listbox1,handles.info.current_bmm_module);end
tomwalters@0 554 if handles.info.nap_loaded
tomwalters@0 555 setstring(handles.listbox2,handles.info.current_nap_module);end
tomwalters@0 556 if handles.info.strobes_loaded
tomwalters@0 557 setstring(handles.listbox3,handles.info.current_strobes_module);end
tomwalters@0 558 if handles.info.sai_loaded
tomwalters@0 559 setstring(handles.listbox4,handles.info.current_sai_module);end
tomwalters@0 560 if handles.info.usermodule_loaded
tomwalters@0 561 setstring(handles.listbox6,handles.info.current_usermodule_module);end
tomwalters@0 562 if handles.info.movie_loaded
tomwalters@0 563 setstring(handles.listbox5,handles.info.current_movie_module);end
tomwalters@0 564
tomwalters@0 565 if isfield(handles.info,'init')
tomwalters@0 566 set(handles.checkbox6,'Value',handles.info.init.hastime);
tomwalters@0 567 set(handles.checkbox7,'Value',handles.info.init.hasfreq);
tomwalters@0 568 set(handles.checkbox10,'Value',handles.info.init.hassignal);
tomwalters@0 569 handles.info.old_current_plot=0;
tomwalters@0 570
tomwalters@0 571 else
tomwalters@0 572 % set the frequency profile off
tomwalters@0 573 set(handles.checkbox6,'Value',0);
tomwalters@0 574 % set the temporal profile off
tomwalters@0 575 set(handles.checkbox7,'Value',0);
tomwalters@0 576 % set the signal on
tomwalters@0 577 set(handles.checkbox10,'Value',1);
tomwalters@0 578 % set the current visible plot (the signal alone)
tomwalters@0 579 handles.info.current_plot=-1;
tomwalters@0 580 handles.info.old_current_plot=0;
tomwalters@0 581 end
tomwalters@0 582
tomwalters@0 583
tomwalters@0 584
tomwalters@0 585
tomwalters@0 586
tomwalters@0 587 handles.audioplayer_enabled = true;
tomwalters@0 588 try
tomwalters@0 589 y=getvalues(sig);
tomwalters@0 590 Fs=getsr(sig);
tomwalters@0 591 player = audioplayer(y / abs(max(y)), Fs); %make a player for the normalized signal
tomwalters@0 592 set(player, 'UserData', handles.figure1, 'TimerPeriod', 0.05, 'TimerFcn', @update_audio_position, ...
tomwalters@0 593 'StartFcn', @start_function);
tomwalters@0 594 % the toolbar callback fcns look for these named bits of appdata
tomwalters@0 595 setappdata(hfig, 'theAudioPlayer', player);
tomwalters@0 596 setappdata(hfig, 'theAudioRecorder', []);
tomwalters@0 597 selection.inPoint = 1;
tomwalters@0 598 selection.outPoint = length(y);
tomwalters@0 599 setappdata(hfig, 'audioSelection', selection); % selection starts as "full"
tomwalters@0 600 catch
tomwalters@0 601 audioplayer_enabled = false;
tomwalters@0 602 end
tomwalters@0 603
tomwalters@0 604
tomwalters@0 605
tomwalters@0 606
tomwalters@0 607
tomwalters@0 608 return
tomwalters@0 609
tomwalters@0 610 function handles=setstring(hand,name)
tomwalters@0 611 strings=get(hand,'String');
tomwalters@0 612 nrstring=size(strings);
tomwalters@0 613 for i=1:nrstring
tomwalters@0 614 if strcmp(strings{i},name)
tomwalters@0 615 set(hand,'Value',i);
tomwalters@0 616 return
tomwalters@0 617 end
tomwalters@0 618 end
tomwalters@0 619 return