Skip to content

Commit 6f72905

Browse files
committed
lint
1 parent 918d99e commit 6f72905

File tree

4 files changed

+92
-90
lines changed

4 files changed

+92
-90
lines changed

miss_hit.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# style guide (https://florianschanda.github.io/miss_hit/style_checker.html)
2+
project_root
3+
24
line_length: 100
35
regex_function_name: "[a-z]+(([A-Z]){1}[A-Za-z]+)*"
46
regex_script_name: "[a-z]+(([A-Z]){1}[A-Za-z]+)*"

src/defaults/checkCppPtbCfg.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
fieldsToSet = cppPtbDefaults('all');
2020

2121
if isfield(cfg, 'audio') && cfg.audio.do
22-
fieldsToSet.audio = cppPtbDefaults('audio');
22+
fieldsToSet.audio = cppPtbDefaults('audio');
2323
end
2424

2525
if isfield(cfg, 'eyeTracker') && cfg.eyeTracker.do
@@ -46,7 +46,7 @@
4646
end
4747

4848
if ~ismember(cfg.fixation.type, {'cross', 'dot', 'bestFixation'})
49-
error('cfg.fixation.type must be one of ''cross'', ''dot'', ''bestFixation''');
49+
error('cfg.fixation.type must be one of ''cross'', ''dot'', ''bestFixation''');
5050
end
5151

5252
% sort fields alphabetically

src/defaults/cppPtbDefaults.m

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
11
function value = cppPtbDefaults(type)
2-
%
3-
% USAGE::
4-
%
5-
% value = cppPtbDefaults(type)
6-
%
7-
% (C) Copyright 2022 CPP_PTB developers
8-
9-
value = [];
10-
11-
switch lower(type)
12-
13-
case 'all'
14-
value = struct('testingDevice', 'pc', ...
15-
'color', struct('background', [0 0 0]), ...
16-
'skipSyncTests', 0);
17-
18-
value.aperture.type = 'none';
19-
20-
value.debug = cppPtbDefaults('debug');
21-
value.text = cppPtbDefaults('text');
22-
value.screen = cppPtbDefaults('screen');
23-
value.fixation = cppPtbDefaults('fixation');
24-
value.keyboard = cppPtbDefaults('keyboard');
25-
26-
case 'debug'
27-
value.do = true;
28-
value.transpWin = true;
29-
value.smallWin = true;
30-
31-
case 'keyboard'
32-
value.keyboard = [];
33-
value.responseBox = [];
34-
value.responseKey = {};
35-
value.escapeKey = 'ESCAPE';
36-
37-
case 'text'
38-
value.font = 'Courier New';
39-
value.size = 18;
40-
value.style = 1;
41-
42-
case 'fixation'
43-
value.type = 'cross';
44-
value.xDisplacement = 0;
45-
value.yDisplacement = 0;
46-
value.color = [255 255 255];
47-
value.width = 1;
48-
value.lineWidthPix = 5;
49-
50-
case 'screen'
51-
value.monitorWidth = 42;
52-
value.monitorDistance = 134;
53-
value.resolution = {[], [], []};
54-
55-
case 'audio'
56-
value.devIdx = [];
57-
value.playbackMode = 1;
58-
59-
value.fs = 44100;
60-
value.channels = 2;
61-
value.initVolume = 1;
62-
value.requestedLatency = 3;
63-
64-
value.repeat = 1;
65-
66-
% Start immediately (0 = immediately)
67-
value.startCue = 0;
68-
69-
% Should we wait for the device to really start?
70-
value.waitForDevice = 1;
71-
72-
value.pushSize =value.fs * 0.010; % ! push N ms only
73-
74-
value.requestOffsetTime = 1; % offset 1 sec
75-
value.reqsSampleOffset = value.requestOffsetTime * value.fs;
76-
77-
case 'eyetracker'
78-
value.defaultCalibration = true;
79-
value.backgroundColor = [192 192 192];
80-
value.fontColor = [0 0 0];
81-
value.calibrationTargetColor = [0 0 0];
82-
value.calibrationTargetSize = 1;
83-
value.calibrationTargetWidth = 0.5;
84-
value.displayCalResults = 1;
85-
86-
end
2+
%
3+
% USAGE::
4+
%
5+
% value = cppPtbDefaults(type)
6+
%
7+
% (C) Copyright 2022 CPP_PTB developers
8+
9+
value = [];
10+
11+
switch lower(type)
12+
13+
case 'all'
14+
value = struct('testingDevice', 'pc', ...
15+
'color', struct('background', [0 0 0]), ...
16+
'skipSyncTests', 0);
17+
18+
value.aperture.type = 'none';
19+
20+
value.debug = cppPtbDefaults('debug');
21+
value.text = cppPtbDefaults('text');
22+
value.screen = cppPtbDefaults('screen');
23+
value.fixation = cppPtbDefaults('fixation');
24+
value.keyboard = cppPtbDefaults('keyboard');
25+
26+
case 'debug'
27+
value.do = true;
28+
value.transpWin = true;
29+
value.smallWin = true;
30+
31+
case 'keyboard'
32+
value.keyboard = [];
33+
value.responseBox = [];
34+
value.responseKey = {};
35+
value.escapeKey = 'ESCAPE';
36+
37+
case 'text'
38+
value.font = 'Courier New';
39+
value.size = 18;
40+
value.style = 1;
41+
42+
case 'fixation'
43+
value.type = 'cross';
44+
value.xDisplacement = 0;
45+
value.yDisplacement = 0;
46+
value.color = [255 255 255];
47+
value.width = 1;
48+
value.lineWidthPix = 5;
49+
50+
case 'screen'
51+
value.monitorWidth = 42;
52+
value.monitorDistance = 134;
53+
value.resolution = {[], [], []};
54+
55+
case 'audio'
56+
value.devIdx = [];
57+
value.playbackMode = 1;
58+
59+
value.fs = 44100;
60+
value.channels = 2;
61+
value.initVolume = 1;
62+
value.requestedLatency = 3;
63+
64+
value.repeat = 1;
65+
66+
% Start immediately (0 = immediately)
67+
value.startCue = 0;
68+
69+
% Should we wait for the device to really start?
70+
value.waitForDevice = 1;
71+
72+
value.pushSize = value.fs * 0.010; % ! push N ms only
73+
74+
value.requestOffsetTime = 1; % offset 1 sec
75+
value.reqsSampleOffset = value.requestOffsetTime * value.fs;
76+
77+
case 'eyetracker'
78+
value.defaultCalibration = true;
79+
value.backgroundColor = [192 192 192];
80+
value.fontColor = [0 0 0];
81+
value.calibrationTargetColor = [0 0 0];
82+
value.calibrationTargetSize = 1;
83+
value.calibrationTargetWidth = 0.5;
84+
value.displayCalResults = 1;
85+
86+
end
8787

8888
end

src/defaults/setDefaultFields.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
structure.(names{i}) = ...
3030
setDefaultFields( ...
31-
structure.(names{i}), ...
32-
fieldsToSet.(names{i}) ...
33-
);
31+
structure.(names{i}), ...
32+
fieldsToSet.(names{i}) ...
33+
);
3434

3535
else
3636

0 commit comments

Comments
 (0)