Commit 420c37e8 authored by Monica Connelly's avatar Monica Connelly

Re-push

parent f3e5d43b
This diff is collapsed.
This diff is collapsed.
File added
participant,session,date,expName,psychopyVersion,frameRate,
1.0049 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
11.6442 WARNING User requested fullscreen with size [1024 768], but screen is actually [1920, 1080]. Using actual size
13.4293 EXP Created window1 = Window(allowGUI=False, allowStencil=False, args=UNKNOWN, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', bpc=(8, 8, 8), color=array([0., 0., 0.]), colorSpace='rgb', depthBits=8, fullscr=<method-wrapper '__getattribute__' of attributeSetter object at 0x0000027DC19ACEB8>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x0000027DC1701B70>, multiSample=False, name='window1', numSamples=2, pos=[0.0, 0.0], screen=0, size=array([1920, 1080]), stencilBits=0, stereo=False, units='height', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
13.4293 EXP window1: recordFrameIntervals = False
13.5954 EXP window1: recordFrameIntervals = True
13.7791 EXP window1: recordFrameIntervals = False
14.0322 EXP Created OpeningText = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='OpeningText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text=str(...), units='height', win=Window(...), wrapWidth=1)
14.0451 EXP Created Vid1Text = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='Vid1Text', opacity=1.0, ori=0, pos=array([0. , 0.4]), rgb=array([255., 255., 255.]), text='Test SampVidsGAB_GCU', units='height', win=Window(...), wrapWidth=1)
14.5167 EXP Created Vid1Movie = MovieStim3(__class__=<class 'psychopy.visual.movie3.MovieStim3'>, autoLog=True, color=UNKNOWN, colorSpace=UNKNOWN, depth=-1.0, filename='SampVidsGAB_GCU.mp4', flipHoriz=False, flipVert=False, fps=UNKNOWN, interpolate=True, loop=True, name='Vid1Movie', noAudio=True, opacity=1.0, ori=0, pos=array([0., 0.]), size=array([0.5, 0.5]), units='norm', vframe_callback=UNKNOWN, volume=UNKNOWN, win=Window(...))
14.5198 EXP Created ContText1 = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-2.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='ContText1', opacity=1.0, ori=0, pos=array([ 0. , -0.4]), rgb=array([255., 255., 255.]), text="Press 'space bar'", units='height', win=Window(...), wrapWidth=1)
14.5253 EXP Created Vid2Text = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='Vid2Text', opacity=1.0, ori=0, pos=array([0. , 0.4]), rgb=array([255., 255., 255.]), text='Test CAB_31.mp4', units='height', win=Window(...), wrapWidth=1)
14.5282 EXP Created ContText2 = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='ContText2', opacity=1.0, ori=0, pos=array([ 0. , -0.4]), rgb=array([255., 255., 255.]), text="Press 'space bar'", units='height', win=Window(...), wrapWidth=1)
14.6669 EXP Created Vid2Movie = MovieStim3(__class__=<class 'psychopy.visual.movie3.MovieStim3'>, autoLog=True, color=UNKNOWN, colorSpace=UNKNOWN, depth=-2.0, filename='CAB_31.mp4', flipHoriz=False, flipVert=False, fps=UNKNOWN, interpolate=True, loop=True, name='Vid2Movie', noAudio=True, opacity=1.0, ori=0, pos=array([0., 0.]), size=array([0.5, 0.5]), units='norm', vframe_callback=UNKNOWN, volume=UNKNOWN, win=Window(...))
14.6726 EXP Created VideoLoopText = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='VideoLoopText', opacity=1.0, ori=0, pos=array([0. , 0.4]), rgb=array([255., 255., 255.]), text='Loop Test', units='height', win=Window(...), wrapWidth=1)
14.6763 EXP Created ContText3 = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='ContText3', opacity=1.0, ori=0, pos=array([ 0. , -0.4]), rgb=array([255., 255., 255.]), text="Press 'space bar'", units='height', win=Window(...), wrapWidth=1)
14.8236 EXP window1: mouseVisible = True
OpeningText.started,OpeningText.stopped,Vid1Text.started,Vid1Text.stopped,Vid1Movie.started,Vid1Movie.stopped,ContText1.started,ContText1.stopped,Vid2Text.started,Vid2Text.stopped,ContText2.started,ContText2.stopped,Vid2Movie.started,Vid2Movie.stopped,participant,session,date,expName,psychopyVersion,frameRate,
13.279385100000127,None,16.033067800000026,None,16.033067800000026,None,16.033067800000026,17.041561600000023,26.23448270000017,None,26.23448270000017,None,26.23448270000017,None,,,,,,,
1.2363 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use ['sounddevice', 'PTB', 'pyo', 'pygame'] (in that order).
9.3642 WARNING User requested fullscreen with size [1024 768], but screen is actually [1920, 1080]. Using actual size
11.9605 EXP Created window1 = Window(allowGUI=False, allowStencil=False, args=UNKNOWN, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', bpc=(8, 8, 8), color=array([0., 0., 0.]), colorSpace='rgb', depthBits=8, fullscr=<method-wrapper '__getattribute__' of attributeSetter object at 0x000001E5F907FF98>, gamma=None, gammaErrorPolicy='raise', kwargs=UNKNOWN, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x000001E5F8DD2C50>, multiSample=False, name='window1', numSamples=2, pos=[0.0, 0.0], screen=0, size=array([1920, 1080]), stencilBits=0, stereo=False, units='height', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
11.9606 EXP window1: recordFrameIntervals = False
12.1252 EXP window1: recordFrameIntervals = True
12.3758 EXP window1: recordFrameIntervals = False
12.6766 EXP Created OpeningText = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='OpeningText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text=str(...), units='height', win=Window(...), wrapWidth=1)
12.6893 EXP Created Vid1Text = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='Vid1Text', opacity=1.0, ori=0, pos=array([0. , 0.4]), rgb=array([255., 255., 255.]), text='Test SampVidsGAB_GCU', units='height', win=Window(...), wrapWidth=1)
13.0590 EXP Created Vid1Movie = MovieStim3(__class__=<class 'psychopy.visual.movie3.MovieStim3'>, autoLog=True, color=UNKNOWN, colorSpace=UNKNOWN, depth=-1.0, filename='SampVidsGAB_GCU.mp4', flipHoriz=False, flipVert=False, fps=UNKNOWN, interpolate=True, loop=True, name='Vid1Movie', noAudio=True, opacity=1.0, ori=0, pos=array([0., 0.]), size=array([0.5, 0.5]), units='norm', vframe_callback=UNKNOWN, volume=UNKNOWN, win=Window(...))
13.0633 EXP Created ContText1 = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-2.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='ContText1', opacity=1.0, ori=0, pos=array([ 0. , -0.4]), rgb=array([255., 255., 255.]), text="Press 'space bar'", units='height', win=Window(...), wrapWidth=1)
13.0701 EXP Created Vid2Text = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='Vid2Text', opacity=1.0, ori=0, pos=array([0. , 0.4]), rgb=array([255., 255., 255.]), text='Test CAB_31.mp4', units='height', win=Window(...), wrapWidth=1)
13.0738 EXP Created ContText2 = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='ContText2', opacity=1.0, ori=0, pos=array([ 0. , -0.4]), rgb=array([255., 255., 255.]), text="Press 'space bar'", units='height', win=Window(...), wrapWidth=1)
13.2354 EXP Created Vid2Movie = MovieStim3(__class__=<class 'psychopy.visual.movie3.MovieStim3'>, autoLog=True, color=UNKNOWN, colorSpace=UNKNOWN, depth=-2.0, filename='CAB_31.mp4', flipHoriz=False, flipVert=False, fps=UNKNOWN, interpolate=True, loop=True, name='Vid2Movie', noAudio=True, opacity=1.0, ori=0, pos=array([0., 0.]), size=array([0.5, 0.5]), units='norm', vframe_callback=UNKNOWN, volume=UNKNOWN, win=Window(...))
13.2418 EXP Created VideoLoopText = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='VideoLoopText', opacity=1.0, ori=0, pos=array([0. , 0.4]), rgb=array([255., 255., 255.]), text='Loop Test', units='height', win=Window(...), wrapWidth=1)
13.2452 EXP Created ContText3 = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=-1.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='ContText3', opacity=1.0, ori=0, pos=array([ 0. , -0.4]), rgb=array([255., 255., 255.]), text="Press 'space bar'", units='height', win=Window(...), wrapWidth=1)
13.2484 EXP Created FinishText = TextStim(__class__=<class 'psychopy.visual.text.TextStim'>, alignHoriz=method-wrapper(...), alignText='center', alignVert=method-wrapper(...), anchorHoriz='center', anchorVert='center', antialias=True, autoLog=True, bold=False, color='white', colorSpace='named', contrast=1.0, depth=0.0, flipHoriz=False, flipVert=False, font='Arial', fontFiles=[], height=0.05, italic=False, languageStyle='LTR', name='FinishText', opacity=1.0, ori=0, pos=array([0., 0.]), rgb=array([255., 255., 255.]), text='Test completed', units='height', win=Window(...), wrapWidth=1)
13.2794 EXP Vid1Movie: movie = 'SampVidsGAB_GCU.mp4'
13.2794 EXP Vid1Movie: autoLog = True
13.2794 EXP Vid2Movie: movie = 'CAB_31.mp4'
13.2794 EXP Vid2Movie: autoLog = True
13.2794 EXP OpeningText: autoDraw = True
16.0295 DATA Keypress: space
16.0331 EXP OpeningText: autoDraw = False
16.0331 EXP Vid1Text: autoDraw = True
16.0331 EXP Vid1Movie: autoDraw = True
16.0331 EXP ContText1: autoDraw = True
17.0416 EXP ContText1: autoDraw = False
19.1961 EXP Set Vid1Movie finished
22.2407 EXP Set Vid1Movie finished
25.2656 EXP Set Vid1Movie finished
26.2345 EXP Vid1Text: autoDraw = False
26.2345 EXP Vid1Movie: autoDraw = False
26.2345 EXP ContText1: autoDraw = False
26.2345 EXP Vid2Text: autoDraw = True
26.2345 EXP ContText2: autoDraw = True
26.2345 EXP Vid2Movie: autoDraw = True
27.5011 EXP window1: mouseVisible = True
Vids,CorrAns,trialsloop.thisRepN,trialsloop.thisTrialN,trialsloop.thisN,trialsloop.thisIndex,OpeningText.started,OpeningText.stopped,Vid1Text.started,Vid1Text.stopped,Vid1Movie.started,Vid1Movie.stopped,ContText1.started,ContText1.stopped,Vid2Text.started,Vid2Text.stopped,ContText2.started,ContText2.stopped,Vid2Movie.started,Vid2Movie.stopped,VideoLoopText.started,VideoLoopText.stopped,ContText3.started,ContText3.stopped,VideoLoopMovie.started,VideoLoopMovie.stopped,participant,session,date,expName,psychopyVersion,frameRate,
GCD_37.mp4,a,0,0,0,1,13.235111499999675,None,15.3605763999999,None,15.3605763999999,None,15.3605763999999,16.37253099999998,19.25665479999998,None,19.25665479999998,None,19.25665479999998,None,22.24339740000005,None,22.24339740000005,None,22.24339740000005,None,test1108,001,2020_Mar_24_1108,VideoTest,2020.1.3,None,
KCU_39.mp4,a,0,1,1,2,,,,,,,,,,,,,,,27.90792250000004,None,27.90792250000004,None,27.90792250000004,None,test1108,001,2020_Mar_24_1108,VideoTest,2020.1.3,None,
CAH_30.mp4,l,0,2,2,0,,,,,,,,,,,,,,,30.9684371999997,None,30.9684371999997,None,30.9684371999997,None,test1108,001,2020_Mar_24_1108,VideoTest,2020.1.3,None,
WAB_49.mp4,l,0,3,3,3,,,,,,,,,,,,,,,33.69720839999991,None,33.69720839999991,None,33.69720839999991,None,test1108,001,2020_Mar_24_1108,VideoTest,2020.1.3,None,
This diff is collapsed.
......@@ -41,6 +41,10 @@ flowScheduler.add(Video1RoutineEnd());
flowScheduler.add(Video2RoutineBegin());
flowScheduler.add(Video2RoutineEachFrame());
flowScheduler.add(Video2RoutineEnd());
const trialsloopLoopScheduler = new Scheduler(psychoJS);
flowScheduler.add(trialsloopLoopBegin, trialsloopLoopScheduler);
flowScheduler.add(trialsloopLoopScheduler);
flowScheduler.add(trialsloopLoopEnd);
flowScheduler.add(FinishRoutineBegin());
flowScheduler.add(FinishRoutineEachFrame());
flowScheduler.add(FinishRoutineEnd());
......@@ -91,6 +95,10 @@ var ContText2;
var Vid2MovieClock;
var Vid2Movie;
var Vid2keyresp;
var VideoLoopClock;
var VideoLoopText;
var ContText3;
var VideoLoopKeyResp;
var FinishClock;
var FinishText;
var globalClock;
......@@ -131,7 +139,7 @@ function experimentInit() {
units: 'norm',
movie: 'SampVidsGAB_GCU.mp4',
pos: [0, 0],
size: undefined,
size: 0.5,
ori: 0,
opacity: 1,
loop: true,
......@@ -181,7 +189,7 @@ function experimentInit() {
units: 'norm',
movie: 'CAB_31.mp4',
pos: [0, 0],
size: undefined,
size: 0.5,
ori: 0,
opacity: 1,
loop: true,
......@@ -189,6 +197,32 @@ function experimentInit() {
});
Vid2keyresp = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
// Initialize components for Routine "VideoLoop"
VideoLoopClock = new util.Clock();
VideoLoopText = new visual.TextStim({
win: psychoJS.window,
name: 'VideoLoopText',
text: 'Loop Test',
font: 'Arial',
units: undefined,
pos: [0, 0.4], height: 0.05, wrapWidth: undefined, ori: 0,
color: new util.Color('white'), opacity: 1,
depth: 0.0
});
ContText3 = new visual.TextStim({
win: psychoJS.window,
name: 'ContText3',
text: "Press 'space bar'",
font: 'Arial',
units: undefined,
pos: [0, (- 0.4)], height: 0.05, wrapWidth: undefined, ori: 0,
color: new util.Color('white'), opacity: 1,
depth: -1.0
});
VideoLoopKeyResp = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
// Initialize components for Routine "Finish"
FinishClock = new util.Clock();
FinishText = new visual.TextStim({
......@@ -597,6 +631,196 @@ function Video2RoutineEnd(trials) {
}
var trialsloop;
var currentLoop;
function trialsloopLoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
trialsloop = new TrialHandler({
psychoJS: psychoJS,
nReps: 1, method: TrialHandler.Method.RANDOM,
extraInfo: expInfo, originPath: undefined,
trialList: 'TestConditions.xlsx',
seed: undefined, name: 'trialsloop'
});
psychoJS.experiment.addLoop(trialsloop); // add the loop to the experiment
currentLoop = trialsloop; // we're now the current loop
// Schedule all the trials in the trialList:
trialsloop.forEach(function() {
const snapshot = trialsloop.getSnapshot();
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(VideoLoopRoutineBegin(snapshot));
thisScheduler.add(VideoLoopRoutineEachFrame(snapshot));
thisScheduler.add(VideoLoopRoutineEnd(snapshot));
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
});
return Scheduler.Event.NEXT;
}
function trialsloopLoopEnd() {
psychoJS.experiment.removeLoop(trialsloop);
return Scheduler.Event.NEXT;
}
var _VideoLoopKeyResp_allKeys;
var VideoLoopMovieClock;
var VideoLoopMovie;
var VideoLoopComponents;
function VideoLoopRoutineBegin(trials) {
return function () {
//------Prepare to start Routine 'VideoLoop'-------
t = 0;
VideoLoopClock.reset(); // clock
frameN = -1;
// update component parameters for each repeat
VideoLoopKeyResp.keys = undefined;
VideoLoopKeyResp.rt = undefined;
_VideoLoopKeyResp_allKeys = [];
VideoLoopMovieClock = new util.Clock();
VideoLoopMovie = new visual.MovieStim({
win: psychoJS.window,
name: 'VideoLoopMovie',
units: 'norm',
movie: Vids,
pos: [0, 0],
size: 0.5,
ori: 0,
opacity: 1,
loop: true,
noAudio: true,
});
// keep track of which components have finished
VideoLoopComponents = [];
VideoLoopComponents.push(VideoLoopText);
VideoLoopComponents.push(ContText3);
VideoLoopComponents.push(VideoLoopKeyResp);
VideoLoopComponents.push(VideoLoopMovie);
VideoLoopComponents.forEach( function(thisComponent) {
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
});
return Scheduler.Event.NEXT;
};
}
function VideoLoopRoutineEachFrame(trials) {
return function () {
//------Loop for each frame of Routine 'VideoLoop'-------
let continueRoutine = true; // until we're told otherwise
// get current time
t = VideoLoopClock.getTime();
frameN = frameN + 1;// number of completed frames (so 0 is the first frame)
// update/draw components on each frame
// *VideoLoopText* updates
if (t >= 0.0 && VideoLoopText.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
VideoLoopText.tStart = t; // (not accounting for frame time here)
VideoLoopText.frameNStart = frameN; // exact frame index
VideoLoopText.setAutoDraw(true);
}
// *ContText3* updates
if (t >= 0.0 && ContText3.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
ContText3.tStart = t; // (not accounting for frame time here)
ContText3.frameNStart = frameN; // exact frame index
ContText3.setAutoDraw(true);
}
// *VideoLoopKeyResp* updates
if (t >= 0.0 && VideoLoopKeyResp.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
VideoLoopKeyResp.tStart = t; // (not accounting for frame time here)
VideoLoopKeyResp.frameNStart = frameN; // exact frame index
// keyboard checking is just starting
psychoJS.window.callOnFlip(function() { VideoLoopKeyResp.clock.reset(); }); // t=0 on next screen flip
psychoJS.window.callOnFlip(function() { VideoLoopKeyResp.start(); }); // start on screen flip
psychoJS.window.callOnFlip(function() { VideoLoopKeyResp.clearEvents(); });
}
if (VideoLoopKeyResp.status === PsychoJS.Status.STARTED) {
let theseKeys = VideoLoopKeyResp.getKeys({keyList: ['space'], waitRelease: false});
_VideoLoopKeyResp_allKeys = _VideoLoopKeyResp_allKeys.concat(theseKeys);
if (_VideoLoopKeyResp_allKeys.length > 0) {
VideoLoopKeyResp.keys = _VideoLoopKeyResp_allKeys[_VideoLoopKeyResp_allKeys.length - 1].name; // just the last key pressed
VideoLoopKeyResp.rt = _VideoLoopKeyResp_allKeys[_VideoLoopKeyResp_allKeys.length - 1].rt;
// a response ends the routine
continueRoutine = false;
}
}
// *VideoLoopMovie* updates
if (t >= 0.0 && VideoLoopMovie.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
VideoLoopMovie.tStart = t; // (not accounting for frame time here)
VideoLoopMovie.frameNStart = frameN; // exact frame index
VideoLoopMovie.setAutoDraw(true);
}
frameRemains = 0.0 + undefined - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (VideoLoopMovie.status === PsychoJS.Status.STARTED && t >= frameRemains) {
VideoLoopMovie.setAutoDraw(false);
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return quitPsychoJS('The [Escape] key was pressed. Goodbye!', false);
}
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
continueRoutine = false; // reverts to True if at least one component still running
VideoLoopComponents.forEach( function(thisComponent) {
if ('status' in thisComponent && thisComponent.status !== PsychoJS.Status.FINISHED) {
continueRoutine = true;
}
});
// refresh the screen if continuing
if (continueRoutine) {
return Scheduler.Event.FLIP_REPEAT;
} else {
return Scheduler.Event.NEXT;
}
};
}
function VideoLoopRoutineEnd(trials) {
return function () {
//------Ending Routine 'VideoLoop'-------
VideoLoopComponents.forEach( function(thisComponent) {
if (typeof thisComponent.setAutoDraw === 'function') {
thisComponent.setAutoDraw(false);
}
});
// the Routine "VideoLoop" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
return Scheduler.Event.NEXT;
};
}
var FinishComponents;
function FinishRoutineBegin(trials) {
return function () {
......
......@@ -49,6 +49,10 @@ flowScheduler.add(Video1RoutineEnd());
flowScheduler.add(Video2RoutineBegin());
flowScheduler.add(Video2RoutineEachFrame());
flowScheduler.add(Video2RoutineEnd());
const trialsloopLoopScheduler = new Scheduler(psychoJS);
flowScheduler.add(trialsloopLoopBegin, trialsloopLoopScheduler);
flowScheduler.add(trialsloopLoopScheduler);
flowScheduler.add(trialsloopLoopEnd);
flowScheduler.add(FinishRoutineBegin());
flowScheduler.add(FinishRoutineEachFrame());
flowScheduler.add(FinishRoutineEnd());
......@@ -99,6 +103,10 @@ var ContText2;
var Vid2MovieClock;
var Vid2Movie;
var Vid2keyresp;
var VideoLoopClock;
var VideoLoopText;
var ContText3;
var VideoLoopKeyResp;
var FinishClock;
var FinishText;
var globalClock;
......@@ -139,7 +147,7 @@ function experimentInit() {
units: 'norm',
movie: 'SampVidsGAB_GCU.mp4',
pos: [0, 0],
size: undefined,
size: 0.5,
ori: 0,
opacity: 1,
loop: true,
......@@ -189,7 +197,7 @@ function experimentInit() {
units: 'norm',
movie: 'CAB_31.mp4',
pos: [0, 0],
size: undefined,
size: 0.5,
ori: 0,
opacity: 1,
loop: true,
......@@ -197,6 +205,32 @@ function experimentInit() {
});
Vid2keyresp = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
// Initialize components for Routine "VideoLoop"
VideoLoopClock = new util.Clock();
VideoLoopText = new visual.TextStim({
win: psychoJS.window,
name: 'VideoLoopText',
text: 'Loop Test',
font: 'Arial',
units: undefined,
pos: [0, 0.4], height: 0.05, wrapWidth: undefined, ori: 0,
color: new util.Color('white'), opacity: 1,
depth: 0.0
});
ContText3 = new visual.TextStim({
win: psychoJS.window,
name: 'ContText3',
text: "Press 'space bar'",
font: 'Arial',
units: undefined,
pos: [0, (- 0.4)], height: 0.05, wrapWidth: undefined, ori: 0,
color: new util.Color('white'), opacity: 1,
depth: -1.0
});
VideoLoopKeyResp = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
// Initialize components for Routine "Finish"
FinishClock = new util.Clock();
FinishText = new visual.TextStim({
......@@ -602,6 +636,194 @@ function Video2RoutineEnd(trials) {
}
var trialsloop;
var currentLoop;
function trialsloopLoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
trialsloop = new TrialHandler({
psychoJS: psychoJS,
nReps: 1, method: TrialHandler.Method.RANDOM,
extraInfo: expInfo, originPath: undefined,
trialList: 'TestConditions.xlsx',
seed: undefined, name: 'trialsloop'
});
psychoJS.experiment.addLoop(trialsloop); // add the loop to the experiment
currentLoop = trialsloop; // we're now the current loop
// Schedule all the trials in the trialList:
for (const thisTrialsloop of trialsloop) {
const snapshot = trialsloop.getSnapshot();
thisScheduler.add(importConditions(snapshot));
thisScheduler.add(VideoLoopRoutineBegin(snapshot));
thisScheduler.add(VideoLoopRoutineEachFrame(snapshot));
thisScheduler.add(VideoLoopRoutineEnd(snapshot));
thisScheduler.add(endLoopIteration(thisScheduler, snapshot));
}
return Scheduler.Event.NEXT;
}
function trialsloopLoopEnd() {
psychoJS.experiment.removeLoop(trialsloop);
return Scheduler.Event.NEXT;
}
var _VideoLoopKeyResp_allKeys;
var VideoLoopMovieClock;
var VideoLoopMovie;
var VideoLoopComponents;
function VideoLoopRoutineBegin(trials) {
return function () {
//------Prepare to start Routine 'VideoLoop'-------
t = 0;
VideoLoopClock.reset(); // clock
frameN = -1;
// update component parameters for each repeat
VideoLoopKeyResp.keys = undefined;
VideoLoopKeyResp.rt = undefined;
_VideoLoopKeyResp_allKeys = [];
VideoLoopMovieClock = new util.Clock();
VideoLoopMovie = new visual.MovieStim({
win: psychoJS.window,
name: 'VideoLoopMovie',
units: 'norm',
movie: Vids,
pos: [0, 0],
size: 0.5,
ori: 0,
opacity: 1,
loop: true,
noAudio: true,
});
// keep track of which components have finished
VideoLoopComponents = [];
VideoLoopComponents.push(VideoLoopText);
VideoLoopComponents.push(ContText3);
VideoLoopComponents.push(VideoLoopKeyResp);
VideoLoopComponents.push(VideoLoopMovie);
for (const thisComponent of VideoLoopComponents)
if ('status' in thisComponent)
thisComponent.status = PsychoJS.Status.NOT_STARTED;
return Scheduler.Event.NEXT;
};
}
function VideoLoopRoutineEachFrame(trials) {
return function () {
//------Loop for each frame of Routine 'VideoLoop'-------
let continueRoutine = true; // until we're told otherwise
// get current time
t = VideoLoopClock.getTime();
frameN = frameN + 1;// number of completed frames (so 0 is the first frame)
// update/draw components on each frame
// *VideoLoopText* updates
if (t >= 0.0 && VideoLoopText.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
VideoLoopText.tStart = t; // (not accounting for frame time here)
VideoLoopText.frameNStart = frameN; // exact frame index
VideoLoopText.setAutoDraw(true);
}
// *ContText3* updates
if (t >= 0.0 && ContText3.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
ContText3.tStart = t; // (not accounting for frame time here)
ContText3.frameNStart = frameN; // exact frame index
ContText3.setAutoDraw(true);
}
// *VideoLoopKeyResp* updates
if (t >= 0.0 && VideoLoopKeyResp.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
VideoLoopKeyResp.tStart = t; // (not accounting for frame time here)
VideoLoopKeyResp.frameNStart = frameN; // exact frame index
// keyboard checking is just starting
psychoJS.window.callOnFlip(function() { VideoLoopKeyResp.clock.reset(); }); // t=0 on next screen flip
psychoJS.window.callOnFlip(function() { VideoLoopKeyResp.start(); }); // start on screen flip
psychoJS.window.callOnFlip(function() { VideoLoopKeyResp.clearEvents(); });
}
if (VideoLoopKeyResp.status === PsychoJS.Status.STARTED) {
let theseKeys = VideoLoopKeyResp.getKeys({keyList: ['space'], waitRelease: false});
_VideoLoopKeyResp_allKeys = _VideoLoopKeyResp_allKeys.concat(theseKeys);
if (_VideoLoopKeyResp_allKeys.length > 0) {
VideoLoopKeyResp.keys = _VideoLoopKeyResp_allKeys[_VideoLoopKeyResp_allKeys.length - 1].name; // just the last key pressed
VideoLoopKeyResp.rt = _VideoLoopKeyResp_allKeys[_VideoLoopKeyResp_allKeys.length - 1].rt;
// a response ends the routine
continueRoutine = false;
}
}
// *VideoLoopMovie* updates
if (t >= 0.0 && VideoLoopMovie.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
VideoLoopMovie.tStart = t; // (not accounting for frame time here)
VideoLoopMovie.frameNStart = frameN; // exact frame index
VideoLoopMovie.setAutoDraw(true);
}
frameRemains = 0.0 + undefined - psychoJS.window.monitorFramePeriod * 0.75; // most of one frame period left
if (VideoLoopMovie.status === PsychoJS.Status.STARTED && t >= frameRemains) {
VideoLoopMovie.setAutoDraw(false);
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return quitPsychoJS('The [Escape] key was pressed. Goodbye!', false);
}
// check if the Routine should terminate
if (!continueRoutine) { // a component has requested a forced-end of Routine
return Scheduler.Event.NEXT;
}
continueRoutine = false; // reverts to True if at least one component still running
for (const thisComponent of VideoLoopComponents)
if ('status' in thisComponent && thisComponent.status !== PsychoJS.Status.FINISHED) {
continueRoutine = true;
break;
}
// refresh the screen if continuing
if (continueRoutine) {
return Scheduler.Event.FLIP_REPEAT;
} else {
return Scheduler.Event.NEXT;
}
};
}
function VideoLoopRoutineEnd(trials) {
return function () {
//------Ending Routine 'VideoLoop'-------
for (const thisComponent of VideoLoopComponents) {
if (typeof thisComponent.setAutoDraw === 'function') {
thisComponent.setAutoDraw(false);
}
}
// the Routine "VideoLoop" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
return Scheduler.Event.NEXT;
};
}
var FinishComponents;
function FinishRoutineBegin(trials) {
return function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment