annotate aim-mat/gui/aim_deletefile.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:
tomwalters@0 5 % RETURN VALUE:
tomwalters@0 6 %
tomwalters@0 7 %
bleeck@3 8 %
tomwalters@0 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
tomwalters@0 18 function handles=aim_deletefile(handles,type)
tomwalters@0 19 % deletes the file, if it is there
tomwalters@0 20
tomwalters@0 21 switch type
tomwalters@0 22 case 'bmm'
tomwalters@0 23 todelete=handles.info.bmmname;
tomwalters@0 24 handles.info.bmm_loaded=0;
tomwalters@0 25 case 'nap'
tomwalters@0 26 todelete=handles.info.napname;
tomwalters@0 27 handles.info.nap_loaded=0;
tomwalters@0 28 case 'strobes'
tomwalters@0 29 todelete=handles.info.strobesname;
tomwalters@0 30 handles.info.strobes_loaded=0;
tomwalters@0 31 case 'sai'
tomwalters@0 32 todelete=handles.info.sainame;
tomwalters@0 33 handles.info.sai_loaded=0;
tomwalters@0 34 case 'pitch_image'
tomwalters@0 35 todelete=handles.info.pitch_imagename;
tomwalters@0 36 handles.info.pitch_image_loaded=0;
tomwalters@0 37 case 'usermodule'
tomwalters@0 38 todelete=handles.info.usermodulename;
tomwalters@0 39 handles.info.usermodule_loaded=0;
tomwalters@0 40 case 'movie'
tomwalters@0 41 handles.info.movie_loaded=0;
tomwalters@0 42 mnames=handles.info.moviename;
tomwalters@0 43 for i=1:length(mnames)
tomwalters@0 44 todelete=handles.info.moviename{i};
tomwalters@0 45 if ~fexist(todelete)
tomwalters@0 46 return
tomwalters@0 47 end
tomwalters@0 48 delete(todelete);
tomwalters@0 49 end
tomwalters@0 50 return
tomwalters@0 51 %otherwise
tomwalters@0 52 % todelete=''; % Stops it crashing if given junk, left out as this
tomwalters@0 53 % is a good indicator that there's something wrong.
tomwalters@0 54 end
tomwalters@0 55
tomwalters@0 56 if ~fexist(todelete)
tomwalters@0 57 return
tomwalters@0 58 end
tomwalters@0 59
tomwalters@0 60 delete(todelete);