| 1 |
/* ExperimentMFC_def.h |
| 2 |
* |
| 3 |
* Copyright (C) 2001-2007,2009,2011,2013,2015-2019,2022,2024 Paul Boersma |
| 4 |
* |
| 5 |
* This code is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2 of the License, or (at |
| 8 |
* your option) any later version. |
| 9 |
* |
| 10 |
* This code is distributed in the hope that it will be useful, but |
| 11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
* See the GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
/* |
| 20 |
* pb 2002/07/16 GPL |
| 21 |
* pb 2003/02/07 added rootDirectory |
| 22 |
* pb 2003/03/08 added stimulusMedialSilenceDuration and stimulusInitialSilenceDuration (version 2) |
| 23 |
* pb 2004/06/22 added response key (version 3) |
| 24 |
* pb 2005/11/21 added replayButton (version 4) |
| 25 |
* pb 2005/12/04 added okButton and oopsButton (version 4) |
| 26 |
* pb 2005/12/06 fix stimuliAreSounds: defaults to TRUE |
| 27 |
* pb 2007/08/12 wchar |
| 28 |
* pb 2007/09/26 added font size (version 5) |
| 29 |
* pb 2011/03/03 added reaction time (version 2 of ResultsMFC) |
| 30 |
* pb 2013/01/01 added finalSilenceDuration and blankWhilePlaying (version 6) |
| 31 |
* pb 2016/09/25 added font size and response key to goodness ratings (version 7) |
| 32 |
*/ |
| 33 |
|
| 34 |
/********* class ExperimentMFC **********/ |
| 35 |
|
| 36 |
#define ooSTRUCT SoundMFC |
| 37 |
oo_DEFINE_STRUCT (SoundMFC) |
| 38 |
|
| 39 |
oo_STRING (name) |
| 40 |
|
| 41 |
#if ! oo_READING && ! oo_WRITING && ! oo_COMPARING |
| 42 |
oo_OBJECT (Sound, 0, sound) |
| 43 |
#endif |
| 44 |
|
| 45 |
oo_END_STRUCT (SoundMFC) |
| 46 |
#undef ooSTRUCT |
| 47 |
|
| 48 |
|
| 49 |
#define ooSTRUCT StimulusMFC |
| 50 |
oo_DEFINE_STRUCT (StimulusMFC) |
| 51 |
|
| 52 |
oo_STRING (name) |
| 53 |
oo_FROM (4) |
| 54 |
oo_STRING (visibleText) |
| 55 |
oo_ENDFROM |
| 56 |
|
| 57 |
#if ! oo_READING && ! oo_WRITING && ! oo_COMPARING |
| 58 |
oo_OBJECT (Sound, 0, sound) |
| 59 |
#endif |
| 60 |
|
| 61 |
oo_END_STRUCT (StimulusMFC) |
| 62 |
#undef ooSTRUCT |
| 63 |
|
| 64 |
|
| 65 |
#define ooSTRUCT ResponseMFC |
| 66 |
oo_DEFINE_STRUCT (ResponseMFC) |
| 67 |
|
| 68 |
oo_FLOAT (left) |
| 69 |
oo_FLOAT (right) |
| 70 |
oo_FLOAT (bottom) |
| 71 |
oo_FLOAT (top) |
| 72 |
oo_STRING (label) |
| 73 |
oo_FROM (5) |
| 74 |
oo_INT16 (fontSize) |
| 75 |
oo_ENDFROM |
| 76 |
oo_FROM (3) |
| 77 |
oo_STRING (key) |
| 78 |
oo_ENDFROM |
| 79 |
oo_STRING (name) |
| 80 |
|
| 81 |
#if ! oo_READING && ! oo_WRITING && ! oo_COMPARING |
| 82 |
oo_OBJECT (Sound, 0, sound) |
| 83 |
#endif |
| 84 |
|
| 85 |
oo_END_STRUCT (ResponseMFC) |
| 86 |
#undef ooSTRUCT |
| 87 |
|
| 88 |
|
| 89 |
#define ooSTRUCT GoodnessMFC |
| 90 |
oo_DEFINE_STRUCT (GoodnessMFC) |
| 91 |
|
| 92 |
oo_FLOAT (left) |
| 93 |
oo_FLOAT (right) |
| 94 |
oo_FLOAT (bottom) |
| 95 |
oo_FLOAT (top) |
| 96 |
oo_STRING (label) |
| 97 |
oo_FROM (7) |
| 98 |
oo_INT16 (fontSize) |
| 99 |
oo_STRING (key) |
| 100 |
oo_ENDFROM |
| 101 |
|
| 102 |
oo_END_STRUCT (GoodnessMFC) |
| 103 |
#undef ooSTRUCT |
| 104 |
|
| 105 |
|
| 106 |
#define ooSTRUCT ExperimentMFC |
| 107 |
oo_DEFINE_CLASS (ExperimentMFC, Daata) |
| 108 |
|
| 109 |
oo_FROM (6) |
| 110 |
oo_QUESTION (blankWhilePlaying) |
| 111 |
oo_ENDFROM |
| 112 |
oo_FROM (4) |
| 113 |
oo_QUESTION (stimuliAreSounds) |
| 114 |
oo_ENDFROM |
| 115 |
oo_STRING (stimulusFileNameHead) |
| 116 |
oo_STRING (stimulusFileNameTail) |
| 117 |
oo_STRUCT (SoundMFC, stimulusCarrierBefore) |
| 118 |
oo_STRUCT (SoundMFC, stimulusCarrierAfter) |
| 119 |
oo_FROM (2) |
| 120 |
oo_DOUBLE (stimulusInitialSilenceDuration) |
| 121 |
oo_DOUBLE (stimulusMedialSilenceDuration) |
| 122 |
oo_ENDFROM |
| 123 |
oo_FROM (6) |
| 124 |
oo_DOUBLE (stimulusFinalSilenceDuration) |
| 125 |
oo_ENDFROM |
| 126 |
oo_INTEGER (numberOfDifferentStimuli) |
| 127 |
oo_STRUCTVEC (StimulusMFC, stimulus, numberOfDifferentStimuli) |
| 128 |
oo_INTEGER (numberOfReplicationsPerStimulus) |
| 129 |
oo_INTEGER (breakAfterEvery) |
| 130 |
oo_ENUM (kExperiment_randomize, randomize) |
| 131 |
oo_STRING (startText) |
| 132 |
oo_STRING (runText) |
| 133 |
oo_STRING (pauseText) |
| 134 |
oo_STRING (endText) |
| 135 |
oo_FROM (4) |
| 136 |
oo_INTEGER (maximumNumberOfReplays) |
| 137 |
oo_FLOAT (replay_left) |
| 138 |
oo_FLOAT (replay_right) |
| 139 |
oo_FLOAT (replay_bottom) |
| 140 |
oo_FLOAT (replay_top) |
| 141 |
oo_STRING (replay_label) |
| 142 |
oo_STRING (replay_key) |
| 143 |
oo_FLOAT (ok_left) |
| 144 |
oo_FLOAT (ok_right) |
| 145 |
oo_FLOAT (ok_bottom) |
| 146 |
oo_FLOAT (ok_top) |
| 147 |
oo_STRING (ok_label) |
| 148 |
oo_STRING (ok_key) |
| 149 |
oo_FLOAT (oops_left) |
| 150 |
oo_FLOAT (oops_right) |
| 151 |
oo_FLOAT (oops_bottom) |
| 152 |
oo_FLOAT (oops_top) |
| 153 |
oo_STRING (oops_label) |
| 154 |
oo_STRING (oops_key) |
| 155 |
oo_ENDFROM |
| 156 |
oo_FROM (4) |
| 157 |
oo_QUESTION (responsesAreSounds) |
| 158 |
oo_STRING (responseFileNameHead) |
| 159 |
oo_STRING (responseFileNameTail) |
| 160 |
oo_STRUCT (SoundMFC, responseCarrierBefore) |
| 161 |
oo_STRUCT (SoundMFC, responseCarrierAfter) |
| 162 |
oo_DOUBLE (responseInitialSilenceDuration) |
| 163 |
oo_DOUBLE (responseMedialSilenceDuration) |
| 164 |
oo_ENDFROM |
| 165 |
oo_FROM (6) |
| 166 |
oo_DOUBLE (responseFinalSilenceDuration) |
| 167 |
oo_ENDFROM |
| 168 |
oo_INTEGER (numberOfDifferentResponses) |
| 169 |
oo_STRUCTVEC (ResponseMFC, response, numberOfDifferentResponses) |
| 170 |
oo_FROM (1) |
| 171 |
oo_INTEGER (numberOfGoodnessCategories) |
| 172 |
oo_STRUCTVEC (GoodnessMFC, goodness, numberOfGoodnessCategories) |
| 173 |
oo_ENDFROM |
| 174 |
#if ! oo_READING && ! oo_WRITING && ! oo_COMPARING |
| 175 |
oo_DOUBLE (samplePeriod) |
| 176 |
oo_INTEGER (numberOfChannels) |
| 177 |
oo_BOOLEAN (pausing) |
| 178 |
oo_INTEGER (trial) |
| 179 |
oo_INTEGER (numberOfTrials) |
| 180 |
oo_INTVEC (stimuli, numberOfTrials) |
| 181 |
oo_INTVEC (responses, numberOfTrials) |
| 182 |
oo_VEC (goodnesses, numberOfTrials) |
| 183 |
oo_DOUBLE (startingTime) |
| 184 |
oo_VEC (reactionTimes, numberOfTrials) |
| 185 |
oo_OBJECT (Sound, 0, playBuffer) |
| 186 |
#endif |
| 187 |
oo_TRANSIENT_FOLDER (rootDirectory) |
| 188 |
#if oo_READING |
| 189 |
MelderFolder_copy (& Data_directoryBeingRead, & rootDirectory); |
| 190 |
oo_VERSION_UNTIL (4) |
| 191 |
stimuliAreSounds = true; |
| 192 |
oo_VERSION_END |
| 193 |
#endif |
| 194 |
|
| 195 |
oo_END_CLASS (ExperimentMFC) |
| 196 |
#undef ooSTRUCT |
| 197 |
|
| 198 |
|
| 199 |
/********** class ResultsMFC **********/ |
| 200 |
|
| 201 |
#define ooSTRUCT TrialMFC |
| 202 |
oo_DEFINE_STRUCT (TrialMFC) |
| 203 |
|
| 204 |
oo_STRING (stimulus) |
| 205 |
oo_STRING (response) |
| 206 |
oo_FROM (1) |
| 207 |
oo_DOUBLE (goodness) |
| 208 |
oo_ENDFROM |
| 209 |
oo_FROM (2) |
| 210 |
oo_DOUBLE (reactionTime) |
| 211 |
oo_ENDFROM |
| 212 |
|
| 213 |
oo_END_STRUCT (TrialMFC) |
| 214 |
#undef ooSTRUCT |
| 215 |
|
| 216 |
|
| 217 |
#define ooSTRUCT ResultsMFC |
| 218 |
oo_DEFINE_CLASS (ResultsMFC, Daata) |
| 219 |
|
| 220 |
oo_INTEGER (numberOfTrials) |
| 221 |
oo_STRUCTVEC (TrialMFC, result, numberOfTrials) |
| 222 |
|
| 223 |
oo_END_CLASS (ResultsMFC) |
| 224 |
#undef ooSTRUCT |
| 225 |
|
| 226 |
|
| 227 |
/* End of file ExperimentMFC_def.h */ |