annotate listeningTest/pairComp/PCpush.m @ 0:4fd284285159
Adding listening test plus some helpful functions and scripts.
author |
Brecht <b.deman@qmul.ac.uk> |
date |
Thu, 24 Apr 2014 23:53:31 +0100 |
parents |
|
children |
5e72201496c8 |
rev |
line source |
b@0
|
1 function PCpush(hf,but)
|
b@0
|
2
|
b@0
|
3 dat=get(hf,'userdata');
|
b@0
|
4 noComb=dat.noComb;
|
b@0
|
5 comb=dat.comb;
|
b@0
|
6 ha=dat.ha;
|
b@0
|
7 hb=dat.hb;
|
b@0
|
8 butCol=dat.butCol;
|
b@0
|
9
|
b@0
|
10 switch but
|
b@0
|
11 case 1 % A
|
b@0
|
12 set(ha,'backgroundcolor','r');
|
b@0
|
13 set(hb,'backgroundcolor',butCol);
|
b@0
|
14 fidInd=[dat.sesDat.id,'_',dat.sesDat.sesScript]; %print 'A'
|
b@0
|
15 fid=fopen(fidInd,'a');
|
b@0
|
16 fprintf(fid,'A');
|
b@0
|
17 playSound(dat.sesDat.cuSndList(comb(noComb,1)));
|
b@0
|
18 case 2 % Stop
|
b@0
|
19 wavplay(0);
|
b@0
|
20 case 3 % B
|
b@0
|
21 set(hb,'backgroundcolor','r');
|
b@0
|
22 set(ha,'backgroundcolor',butCol);
|
b@0
|
23 fidInd=[dat.sesDat.id,'_',dat.sesDat.sesScript];%print 'B'
|
b@0
|
24 fid=fopen(fidInd,'a');
|
b@0
|
25 fprintf(fid,'B');
|
b@0
|
26 playSound(dat.sesDat.cuSndList(comb(noComb,2)));
|
b@0
|
27 end |