view listeningTest/pairComp/PCpush.m @ 1:b64c9fb34bd0

Response folder included in package (put README in it).
author Brecht <b.deman@qmul.ac.uk>
date Wed, 30 Jul 2014 12:38:47 +0100
parents 4fd284285159
children 5e72201496c8
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=[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
   wavplay(0);   
case 3 % B
   set(hb,'backgroundcolor','r');
   set(ha,'backgroundcolor',butCol);
   fidInd=[dat.sesDat.id,'_',dat.sesDat.sesScript];%print 'B'
   fid=fopen(fidInd,'a');
   fprintf(fid,'B');
   playSound(dat.sesDat.cuSndList(comb(noComb,2))); 
end