Skip to content
Snippets Groups Projects
Commit cc7ee26b authored by jsiegle's avatar jsiegle
Browse files

Rudimentary code for writing headers to data files

parent 5e7aa87b
No related branches found
No related tags found
No related merge requests found
......@@ -141,6 +141,8 @@ void RecordNode::addInputChannel(GenericProcessor* sourceNode, int chan)
std::pair<int, Channel> newPair (getNextChannel(false), newChannel);
//std::cout << "adding channel " << getNextChannel(false) << std::endl;
continuousChannels.insert(newPair);
......@@ -230,7 +232,25 @@ void RecordNode::setParameter (int parameterIndex, float newValue)
if (continuousChannels[i].isRecording)
{
std::cout << "OPENING FILE: " << continuousChannels[i].filename << std::endl;
File f = File(continuousChannels.filename);
bool fileExists = false;
if (f.exists())
{
fileExists = true;
}
continuousChannels[i].file = fopen(continuousChannels[i].filename.toUTF8(), "a");
if (!fileExists)
{
// create header (needs more details, obviously)
String header = "THIS IS A HEADER.";
fwrite(header.toUTF8(), 1, header.getNumBytesAsUTF8(), continuousChannels[i].file);
}
}
}
......
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