view listeningTest/pairComp/PCpush.m @ 8:2afd6ff39f08

prepare2listen fixes
author Brecht De Man <b.deman@qmul.ac.uk>
date Fri, 28 Nov 2014 00:52:12 +0000
parents 5e72201496c8
children
line wrap: on
line source
function PCpush(hf,but)

dat=get(hf,'userdata');
noComb=dat.noComb;
comb=dat.comb;
ha=dat.ha;
hb=dat.hb;
butCol=dat.butCol;

switch but
case 1 % A
   set(ha,'backgroundcolor','r');
   set(hb,'backgroundcolor',butCol);
   fidInd=['responses/' dat.sesDat.id,'_',dat.sesDat.sesScript]; %print 'A'
   fid=fopen(fidInd,'a');
   fprintf(fid,'A');
   playSound(dat.sesDat.cuSndList(comb(noComb,1)));
case 2 % Stop ()
   audioplayer(0,1);
case 3 % B
   set(hb,'backgroundcolor','r');
   set(ha,'backgroundcolor',butCol);
   fidInd=['responses/' dat.sesDat.id,'_',dat.sesDat.sesScript];%print 'B'
   fid=fopen(fidInd,'a');
   fprintf(fid,'B');
   playSound(dat.sesDat.cuSndList(comb(noComb,2))); 
end