diff --git a/Source/Processors/RecordNode.cpp b/Source/Processors/RecordNode.cpp index 09580899e6701800f0fa2a0dde510b462d8e0b55..0a3bf8619a58f2767775cf2508714d47730b7900 100755 --- a/Source/Processors/RecordNode.cpp +++ b/Source/Processors/RecordNode.cpp @@ -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); + } + } }