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

Merge branch 'master' of https://github.com/open-ephys/GUI

parents 79319f37 004683a9
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
SpikeDetector::SpikeDetector() SpikeDetector::SpikeDetector()
: GenericProcessor("Spike Detector"), : GenericProcessor("Spike Detector"),
overflowBuffer(2,100), dataBuffer(overflowBuffer), overflowBuffer(2,100), dataBuffer(nullptr),
overflowBufferSize(100), currentElectrode(-1) overflowBufferSize(100), currentElectrode(-1)
{ {
//// the standard form: //// the standard form:
...@@ -412,7 +412,7 @@ void SpikeDetector::process(AudioSampleBuffer& buffer, ...@@ -412,7 +412,7 @@ void SpikeDetector::process(AudioSampleBuffer& buffer,
// cycle through electrodes // cycle through electrodes
Electrode* electrode; Electrode* electrode;
dataBuffer = buffer; dataBuffer = &buffer;
checkForEvents(events); // need to find any timestamp events before extracting spikes checkForEvents(events); // need to find any timestamp events before extracting spikes
...@@ -571,8 +571,8 @@ float SpikeDetector::getNextSample(int& chan) ...@@ -571,8 +571,8 @@ float SpikeDetector::getNextSample(int& chan)
// useOverflowBuffer = false; // useOverflowBuffer = false;
// std::cout << " sample index " << sampleIndex << "from regular buffer" << std::endl; // std::cout << " sample index " << sampleIndex << "from regular buffer" << std::endl;
if (sampleIndex < dataBuffer.getNumSamples()) if (sampleIndex < dataBuffer->getNumSamples())
return *dataBuffer.getSampleData(chan, sampleIndex); return *dataBuffer->getSampleData(chan, sampleIndex);
else else
return 0; return 0;
} }
...@@ -602,7 +602,7 @@ float SpikeDetector::getCurrentSample(int& chan) ...@@ -602,7 +602,7 @@ float SpikeDetector::getCurrentSample(int& chan)
{ {
// useOverflowBuffer = false; // useOverflowBuffer = false;
// std::cout << " sample index " << sampleIndex << "from regular buffer" << std::endl; // std::cout << " sample index " << sampleIndex << "from regular buffer" << std::endl;
return *dataBuffer.getSampleData(chan, sampleIndex - 1); return *dataBuffer->getSampleData(chan, sampleIndex - 1);
} }
//} else { //} else {
......
...@@ -155,8 +155,8 @@ public: ...@@ -155,8 +155,8 @@ public:
void loadCustomParametersFromXml(); void loadCustomParametersFromXml();
private: private:
/** Reference to a continuous buffer. */ /** Pointer to a continuous buffer. */
AudioSampleBuffer& dataBuffer; AudioSampleBuffer* dataBuffer;
float getDefaultThreshold(); float getDefaultThreshold();
......
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