Skip to content

Commit 580ed84

Browse files
authored
Update SpikeSorter.h
1 parent 1eb27aa commit 580ed84

1 file changed

Lines changed: 19 additions & 22 deletions

File tree

Source/Plugins/SpikeSorter/SpikeSorter.h

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#define __SPIKESORTER_H_3F920F95__
2626

2727
#include <ProcessorHeaders.h>
28-
#include <SpikeLib.h>
2928
#include "SpikeSorterEditor.h"
3029
#include "SpikeSortBoxes.h"
3130
#include <algorithm> // std::sort
@@ -149,7 +148,7 @@ class RunningStat
149148
class Electrode
150149
{
151150
public:
152-
Electrode(int electrodeID, UniqueIDgenerator* uniqueIDgenerator_, PCAcomputingThread* pth,String _name, int _numChannels, int* _channels, float default_threshold, int pre, int post, float samplingRate , int sourceNodeId);
151+
Electrode(int electrodeID, UniqueIDgenerator* uniqueIDgenerator_, PCAcomputingThread* pth,String _name, int _numChannels, int* _channels, float default_threshold, int pre, int post, float samplingRate , int sourceNodeId, int sourceSubIdx);
153152
~Electrode();
154153

155154
void resizeWaveform(int numPre, int numPost);
@@ -164,7 +163,8 @@ class Electrode
164163
float depthOffsetMM;
165164

166165
int electrodeID;
167-
int sourceNodeId;
166+
int sourceNodeId_;
167+
int sourceSubIdx;
168168
int* channels;
169169
double* thresholds;
170170
bool* isActive;
@@ -179,7 +179,6 @@ class Electrode
179179
bool isMonitored;
180180
};
181181

182-
183182
class ContinuousCircularBuffer
184183
{
185184
public:
@@ -228,24 +227,24 @@ class SpikeSorter : public GenericProcessor
228227

229228
/** Processes an incoming continuous buffer and places new
230229
spikes into the event buffer. */
231-
void process(AudioSampleBuffer& buffer, MidiBuffer& events);
230+
void process(AudioSampleBuffer& buffer) override;
232231

233232
/** Used to alter parameters of data acquisition. */
234-
void setParameter(int parameterIndex, float newValue);
233+
void setParameter(int parameterIndex, float newValue) override;
235234

236235
/** Called whenever the signal chain is altered. */
237-
void updateSettings();
236+
void updateSettings() override;
238237

239238
/** Called prior to start of acquisition. */
240-
bool enable();
239+
bool enable() override;
241240

242241
/** Called after acquisition is finished. */
243-
bool disable();
242+
bool disable() override;
244243

245244

246-
bool isReady();
245+
bool isReady() override;
247246
/** Creates the SpikeSorterEditor. */
248-
AudioProcessorEditor* createEditor();
247+
AudioProcessorEditor* createEditor() override;
249248

250249
float getSelectedElectrodeNoise();
251250
void clearRunningStatForSelectedElectrode();
@@ -365,7 +364,10 @@ class SpikeSorter : public GenericProcessor
365364
Array<Electrode*> getElectrodes();
366365

367366
std::vector<String> electrodeTypes;
368-
367+
368+
void setEditAllState(bool val);
369+
bool getEditAllState();
370+
369371
#if 0
370372
/** sync PSTH : inform of a new electrode added */
371373
void updateSinks(Electrode* newElectrode);
@@ -385,7 +387,7 @@ class SpikeSorter : public GenericProcessor
385387
private:
386388
UniqueIDgenerator uniqueIDgenerator;
387389
long uniqueSpikeID;
388-
SpikeObject prevSpike;
390+
SorterSpikePtr prevSpike;
389391

390392
void addElectrode(Electrode* newElectrode);
391393
void increaseUniqueProbeID(String type);
@@ -416,18 +418,11 @@ class SpikeSorter : public GenericProcessor
416418

417419

418420
int numPreSamples,numPostSamples;
419-
uint8_t* spikeBuffer;///[256];
420-
//int64 timestamp;
421-
int64 hardware_timestamp;
422-
int64 software_timestamp;
421+
423422

424423
bool PCAbeforeBoxes;
425424
ContinuousCircularBuffer* channelBuffers; // used to compute auto threshold
426425

427-
void handleEvent(int eventType, MidiMessage& event, int sampleNum);
428-
429-
void addSpikeEvent(SpikeObject* s, MidiBuffer& eventBuffer, int peakIndex);
430-
431426
void resetElectrode(Electrode*);
432427
CriticalSection mut;
433428
bool autoDACassignment;
@@ -437,14 +432,16 @@ class SpikeSorter : public GenericProcessor
437432

438433
Time timer;
439434

440-
void addWaveformToSpikeObject(SpikeObject* s,
435+
void addWaveformToSpikeObject(SpikeEvent::SpikeBuffer& s,
441436
int& peakIndex,
442437
int& electrodeNumber,
443438
int& currentChannel);
444439

445440

446441
Array<Electrode*> electrodes;
447442
PCAcomputingThread computingThread;
443+
444+
bool editAll = false;
448445
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SpikeSorter);
449446

450447
};

0 commit comments

Comments
 (0)