diff --git a/Source/OpenEphysFileSource.cpp b/Source/OpenEphysFileSource.cpp index 2e6f25b..22ad373 100644 --- a/Source/OpenEphysFileSource.cpp +++ b/Source/OpenEphysFileSource.cpp @@ -68,6 +68,7 @@ bool OpenEphysFileSource::open (File file) { info.name = channel->getStringAttribute ("name"); info.bitVolts = channel->getStringAttribute ("bitVolts").getDoubleValue(); + info.type = channel->getIntAttribute ("type"); info.startPos = channel->getIntAttribute ("position"); if (! recording.streams.count (streamName)) @@ -241,6 +242,7 @@ void OpenEphysFileSource::fillRecordInfo() cInfo.name = recordings[recordingNum].streams[streamName].channels[i].name; cInfo.bitVolts = recordings[recordingNum].streams[streamName].channels[i].bitVolts; + cInfo.type = recordings[recordingNum].streams[streamName].channels[i].type; info.channels.add (cInfo); } diff --git a/Source/OpenEphysFileSource.h b/Source/OpenEphysFileSource.h index f9dae16..73c151a 100644 --- a/Source/OpenEphysFileSource.h +++ b/Source/OpenEphysFileSource.h @@ -71,6 +71,7 @@ class OpenEphysFileSource : public FileSource int id; String name; double bitVolts; + uint8 type; String filename; long int startPos; }; diff --git a/Source/OpenEphysFormat.cpp b/Source/OpenEphysFormat.cpp index 3e94b96..eb783c1 100644 --- a/Source/OpenEphysFormat.cpp +++ b/Source/OpenEphysFormat.cpp @@ -810,6 +810,7 @@ void OpenEphysFormat::writeXml() XmlElement* channelXml = new XmlElement ("CHANNEL"); channelXml->setAttribute ("name", channelInfo->name); channelXml->setAttribute ("bitVolts", channelInfo->bitVolts); + channelXml->setAttribute ("type", static_cast(channelInfo->type)); channelXml->setAttribute ("filename", channelInfo->filename); channelXml->setAttribute ("position", (double) (channelInfo->startPos)); // As long as the file doesnt exceed 2^53 bytes, this will have integer precission. Better than limiting to 32bits. streamXml->addChildElement (channelXml); diff --git a/Source/OpenEphysFormat.h b/Source/OpenEphysFormat.h index 604aa10..fb003fa 100644 --- a/Source/OpenEphysFormat.h +++ b/Source/OpenEphysFormat.h @@ -176,6 +176,7 @@ class OpenEphysFormat : public RecordEngine String name; String filename; float bitVolts; + uint8 type; long int startPos; };