-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathset_VideoParams_PsyfileName.m
36 lines (30 loc) · 1.45 KB
/
set_VideoParams_PsyfileName.m
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
function psyfname = set_VideoParams_PsyfileName()
% psyfname = set_VideoParams_PsyfileName()
%
global SYSPARAMS VideoParams; %#ok<NUSED>
%set video folder
time = fix(clock);
VideoParams.videofolder = [VideoParams.rootfolder filesep ...
VideoParams.vidprefix filesep num2str(time(2)) '_' num2str(time(3)) '_' ...
num2str(time(1)) '_' num2str(time(4)) '_' num2str(time(5)) '_' ...
num2str(time(6)) filesep ];
if SYSPARAMS.realsystem == 1 && VideoParams.vidrecord == 1
psyfname = [VideoParams.videofolder VideoParams.vidprefix '_' ...
num2str(time(2)) '_' num2str(time(3)) '_' num2str(time(1)) '_' ...
num2str(time(4)) '_' num2str(time(5)) '_' num2str(time(6)) '.psy'];
command = ['VPC#' VideoParams.vidprefix '\' num2str(time(2)) '_' ...
num2str(time(3)) '_' num2str(time(1)) '_' num2str(time(4)) '_' ...
num2str(time(5)) '_' num2str(time(6)) '\#']; %#ok<NASGU>
netcomm('write',SYSPARAMS.netcommobj,int8(command));
pause(1);
%set video duration
command = ['VL#' sprintf('%2.2f',VideoParams.videodur) '#']; %#ok<NASGU>
netcomm('write',SYSPARAMS.netcommobj,int8(command));
else
if ~exist(VideoParams.videofolder, 'dir')
mkdir(VideoParams.videofolder);
end
psyfname = [VideoParams.videofolder VideoParams.vidprefix '_' ...
num2str(time(2)) '_' num2str(time(3)) '_' num2str(time(1)) '_' ...
num2str(time(4)) '_' num2str(time(5)) '_' num2str(time(6)) '.psy'];
end