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

Document RecordEngine header

parent 28c5a047
Branches
Tags
No related merge requests found
......@@ -45,24 +45,92 @@ class RecordEngine : public AccessClass
public:
RecordEngine();
~RecordEngine();
/** All the public methods are called by RecordNode:
When acquisition starts (in the specified order):
1-resetChannels
2-registerProcessor, addChannel, registerSpikeSource, addspikeelectrode
3-startAcquisition
When recording starts (in the specified order):
1-directoryChanged (if needed)
2-openFiles
During recording:
writeData, writeEvent, writeSpike, updateTimeStamp
When recording stops:
closeFiles
*/
/** Called when recording starts to open all needed files
*/
virtual void openFiles(File rootFolder, int experimentNumber, int recordingNumber) =0;
/** Called when recording stops to close all files
and do all the necessary cleanups
*/
virtual void closeFiles() =0;
/** Write continuous data.
This method gets the full data buffer, it must query getRecordState for
each registered channel to determine which channels to actually write to disk
*/
virtual void writeData(AudioSampleBuffer& buffer, int nSamples) =0;
/** Write a single event to disk.
*/
virtual void writeEvent(int eventType, MidiMessage& event, int samplePosition) =0;
virtual void addChannel(int index, Channel* chan) =0;
/** Called when acquisition starts once for each processor that might record continuous data
*/
virtual void registerProcessor(GenericProcessor* processor);
/** Called after registerProcessor, once for each output
channel of the processor
*/
virtual void addChannel(int index, Channel* chan) =0;
/** Called when acquisition starts once for each processor that might record spikes
*/
virtual void registerSpikeSource(GenericProcessor* processor);
/** Called after registerSpikesource, once for each channel group
*/
virtual void addSpikeElectrode(int index, SpikeRecordInfo* elec) =0;
/** Write a spike to disk
*/
virtual void writeSpike(const SpikeObject& spike, int electrodeIndex) =0;
virtual void registerProcessor(GenericProcessor* processor);
virtual void registerSpikeSource(GenericProcessor* processor);
/** Called when a new acquisition starts, to clean all channel data
before registering the processors
*/
virtual void resetChannels();
/** Called every time a new timestamp event is received
*/
virtual void updateTimeStamp(int64 timestamp);
/** Called after all channels and spike groups have been registered,
just before acquisition starts
*/
virtual void startAcquisition();
/** Called when the recording directory changes during an acquisition
*/
virtual void directoryChanged();
protected:
/** Functions to access RecordNode arrays and utilities
*/
/** Gets the specified channel from the channel array stored in RecordNode
*/
Channel* getChannel(int index);
/** Gets the specified channel group info structure from the array stored in RecordNode
*/
SpikeRecordInfo* getSpikeElectrode(int index);
/** Generate a Matlab-compatible datestring
*/
String generateDateString();
private:
......
......@@ -72,12 +72,18 @@ public:
*/
void setParameter(int parameterIndex, float newValue);
/** Called by the processor graph for each processor that could record data
*/
void registerProcessor(GenericProcessor* sourceNode);
/** Called by the processor graph for each recordable channel
*/
void addInputChannel(GenericProcessor* sourceNode, int chan);
bool enable();
bool disable();
/** Get channel stored in channelPointers array
*/
Channel* getDataChannel(int index);
/** Called by the ControlPanel to determine the amount of space
......@@ -113,14 +119,26 @@ public:
return rootFolder;
}
/** Adds a Record Engine to use
*/
void registerRecordEngine(RecordEngine* engine);
/** Clears the list of active Record Engines
*/
void clearRecordEngines();
/** Must be called by a spike recording source on the "enable" method
*/
void registerSpikeSource(GenericProcessor* processor);
/** Registers an electrode group for spike recording
Must be called by a spike recording source on the "enable" method
after the call to registerSpikeSource
*/
int addSpikeElectrode(SpikeRecordInfo* elec);
/** Called by a spike recording source to write a spike to file
*/
void writeSpike(SpikeObject& spike, int electrodeIndex);
SpikeRecordInfo* getSpikeElectrode(int index);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment