Skip to content
Snippets Groups Projects
Commit 19706f46 authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Change sync messages to plain text for easier access

parent 9d8e6be5
No related branches found
No related tags found
No related merge requests found
......@@ -346,9 +346,17 @@ void BinaryRecording::openFiles(File rootFolder, int experimentNumber, int recor
jsonFile->setProperty("channels", jsonSpikeChannels.getReference(i));
}
Array<NpyType> msgType;
msgType.add(NpyType("sync_text", BaseType::CHAR, 256));
m_syncTextFile = new NpyFile(basepath + "sync_text.npy", msgType);
File syncFile = File(basepath + "sync_messages.txt");
Result res = syncFile.create();
if (res.failed())
{
std::cerr << "Error creating sync text file:" << res.getErrorMessage() << std::endl;
}
else
{
m_syncTextFile = syncFile.createOutputStream();
}
m_recordingNum = recordingNumber;
DynamicObject::Ptr jsonSettingsFile = new DynamicObject();
......@@ -582,9 +590,9 @@ void BinaryRecording::writeEvent(int eventIndex, const MidiMessage& event)
void BinaryRecording::writeTimestampSyncText(uint16 sourceID, uint16 sourceIdx, int64 timestamp, float, String text)
{
text.paddedRight(' ', 256);
m_syncTextFile->writeData(text.toUTF8(), 256);
m_syncTextFile->increaseRecordCount();
if (!m_syncTextFile)
return;
m_syncTextFile->writeText(text + "\n", false, false);
}
......
......@@ -103,7 +103,7 @@ namespace BinaryRecordingEngine
OwnedArray<EventRecording> m_eventFiles;
OwnedArray<EventRecording> m_spikeFiles;
OwnedArray<NpyFile> m_dataTimestampFiles;
ScopedPointer<NpyFile> m_syncTextFile;
ScopedPointer<FileOutputStream> m_syncTextFile;
Array<unsigned int> m_spikeFileIndexes;
Array<uint16> m_spikeChannelIndexes;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment