-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCRSCueState.m
More file actions
executable file
·49 lines (41 loc) · 1015 Bytes
/
CRSCueState.m
File metadata and controls
executable file
·49 lines (41 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// CRSCueState.m
// OrientationChange
//
// Created by John Maunsell on 2/25/06.
// Copyright 2006. All rights reserved.
//
#import "CRSCueState.h"
@implementation CRSCueState
- (void)stateAction;
{
cueMS = [[task defaults] integerForKey:CRSCueMSKey];
if (cueMS > 0) {
[stimuli setCueSpot:YES location:trial.attendLoc];
expireTime = [LLSystemUtil timeFromNow:[[task defaults] integerForKey:CRSCueMSKey]];
if ([[task defaults] boolForKey:CRSDoSoundsKey]) {
[[NSSound soundNamed:kFixOnSound] play];
}
[[task dataDoc] putEvent:@"cueOn"];
}
}
- (NSString *)name {
return @"CRSCue";
}
- (LLState *)nextState {
if ([task mode] == kTaskIdle) {
eotCode = kEOTQuit;
return stateSystem->endtrial;
}
if ([[task defaults] boolForKey:CRSFixateKey] && ![fixWindow inWindowDeg:[task currentEyeDeg]]) {
eotCode = kEOTBroke;
return stateSystem->endtrial;
}
if (cueMS <= 0 || [LLSystemUtil timeIsPast:expireTime]) {
return stateSystem->prestim;
}
else {
return nil;
}
}
@end