Skip to content

Commit d5f9229

Browse files
committed
Merge pull request #4 from sccn/v1.12
Copied v1.12 files over from eeglab plugin download
2 parents 0238bc4 + f4b6915 commit d5f9229

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Matlab/eeg_load_xdf.m

+9-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
if args.effective_rate && isfinite(stream.info.effective_srate) && stream.info.effective_srate>0
7070
raw.srate = stream.info.effective_srate;
7171
else
72-
raw.srate = str2num(stream.info.nominal_srate);
72+
raw.srate = str2num(stream.info.nominal_srate); %#ok<ST2NM>
7373
end
7474
raw.xmin = 0;
7575
raw.xmax = (raw.pnts-1)/raw.srate;
@@ -108,19 +108,24 @@
108108

109109
% events...
110110
event = [];
111+
if isfinite(stream.info.effective_srate) && stream.info.effective_srate>0
112+
srate = stream.info.effective_srate;
113+
else
114+
srate = raw.srate;
115+
end
111116
for s=1:length(streams)
112117
if (strcmp(streams{s}.info.type,'Markers') || strcmp(streams{s}.info.type,'Events')) && ~ismember(streams{s}.info.name,args.exclude_markerstreams)
113118
try
114119
if iscell(streams{s}.time_series)
115120
for e=1:length(streams{s}.time_stamps)
116121
event(end+1).type = streams{s}.time_series{e};
117-
event(end).latency = 1+raw.srate*(streams{s}.time_stamps(e)-stream.time_stamps(1));
122+
event(end).latency = 1+srate*(streams{s}.time_stamps(e)-stream.time_stamps(1));
118123
event(end).duration = 1;
119124
end
120125
else
121126
for e=1:length(streams{s}.time_stamps)
122127
event(end+1).type = num2str(streams{s}.time_series(e));
123-
event(end).latency = 1+raw.srate*(streams{s}.time_stamps(e)-stream.time_stamps(1));
128+
event(end).latency = 1+srate*(streams{s}.time_stamps(e)-stream.time_stamps(1));
124129
event(end).duration = 1;
125130
end
126131
end
@@ -131,6 +136,7 @@
131136
end
132137
raw.event = event;
133138

139+
134140
% etc...
135141
raw.etc.desc = stream.info.desc;
136142
raw.etc.info = rmfield(stream.info,'desc');

Matlab/eegplugin_xdfimport.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
function vers = eegplugin_xdfimport(fig, trystrs, catchstrs)
4747

48-
vers = 'xdfimport1.11b';
48+
vers = 'xdfimport1.12';
4949

5050
if nargin < 3
5151
error('eegplugin_xdfimport requires 3 arguments');

Matlab/xdf/load_xdf.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@
145145
% Contains portions of xml2struct Copyright (c) 2010, Wouter Falkena,
146146
% ASTI, TUDelft, 21-08-2010
147147
%
148-
% version 1.11
149-
LIBVERSION = '1.11';
148+
% version 1.12
149+
LIBVERSION = '1.12';
150150

151151
% check inputs
152152
opts = cell2struct(varargin(2:2:end),varargin(1:2:end),2);
@@ -227,6 +227,7 @@
227227
end
228228
end
229229

230+
230231
% ======================
231232
% === parse the file ===
232233
% ======================

0 commit comments

Comments
 (0)