Skip to content

Commit 472e72c

Browse files
committed
Merge branch development-juce8 into testing-juce8
2 parents 10b9c57 + 7b90be1 commit 472e72c

32 files changed

Lines changed: 554 additions & 260 deletions

Plugins/SpikeDetector/PopupConfigurationWindow.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,23 @@ void PopupThresholdComponent::createSliders()
147147

148148
for (int i = 0; i < abs_thresholds.size(); i++)
149149
{
150-
Slider* slider = new Slider ("SLIDER" + String (i + 1));
150+
Slider* slider = nullptr;
151+
152+
if (thresholdType == ABS)
153+
slider = new SliderReverse ("SLIDER" + String (i + 1));
154+
else
155+
slider = new Slider ("SLIDER" + String (i + 1));
156+
151157
slider->setSliderStyle (Slider::LinearBarVertical);
152158
slider->setTextBoxStyle (Slider::NoTextBox, false, sliderWidth, 10);
153159
slider->setChangeNotificationOnlyOnRelease (true);
160+
slider->setPopupDisplayEnabled (true, false, this);
154161

155162
switch (thresholdType)
156163
{
157164
case ABS:
158-
slider->setRange (25, 200, 1);
159-
slider->setValue (std::abs (abs_thresholds[i]->getFloatValue()), dontSendNotification);
165+
slider->setRange (-200, -25, 1);
166+
slider->setValue (abs_thresholds[i]->getFloatValue(), dontSendNotification);
160167
break;
161168

162169
case STD:
@@ -608,7 +615,7 @@ void SpikeDetectorTableModel::broadcastThresholdToSelectedRows (int rowThatWasCl
608615
{
609616
case ABS:
610617
parameterString = "abs_threshold";
611-
actualValue = -value;
618+
actualValue = value;
612619
break;
613620
case STD:
614621
parameterString = "std_threshold";

Plugins/SpikeDetector/PopupConfigurationWindow.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ class PopupThresholdComponent : public PopupComponent,
174174
void updatePopup() override { repaint(); }
175175

176176
private:
177+
/** Slider that reverses the fill direction */
178+
class SliderReverse : public Slider
179+
{
180+
public:
181+
SliderReverse (const String& componentName) : Slider (componentName) {};
182+
~SliderReverse() {};
183+
double proportionOfLengthToValue (double proportion) override { return Slider::proportionOfLengthToValue (1.0f - proportion); };
184+
double valueToProportionOfLength (double value) override { return 1.0f - (Slider::valueToProportionOfLength (value)); };
185+
};
186+
177187
std::unique_ptr<UtilityButton> lockButton;
178188
std::unique_ptr<UtilityButton> absButton;
179189
std::unique_ptr<UtilityButton> stdButton;

Plugins/SpikeDetector/SpikeDetector.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ bool SpikeDetector::stopAcquisition()
685685
spikeChannel->reset();
686686
}
687687

688-
LOGC("SpikeDetector detected ", spikeCount, " spikes in ", totalCallbacks, " callbacks.");
688+
LOGC ("SpikeDetector detected ", spikeCount, " spikes in ", totalCallbacks, " callbacks.");
689689

690690
return true;
691691
}
@@ -921,12 +921,11 @@ void SpikeDetector::loadCustomParametersFromXml (XmlElement* xml)
921921

922922
SpikeChannel* spikeChannel = addSpikeChannel (type, streamId, -1, name);
923923

924-
spikeChannel->getParameter ("local_channels")->fromXml (spikeParamsXml);
924+
auto* localChansParam = (SelectedChannelsParameter*) spikeChannel->getParameter ("local_channels");
925+
localChansParam->setChannelCount (getDataStream (streamId)->getChannelCount());
926+
localChansParam->fromXml (spikeParamsXml);
925927

926-
SelectedChannelsParameter* param = (SelectedChannelsParameter*) spikeChannel->getParameter ("local_channels");
927-
((SpikeChannel*) param->getOwner())->localChannelIndexes = param->getArrayValue();
928-
929-
spikeChannel->getParameter ("thrshlder_type")->fromXml (spikeParamsXml);
928+
((SpikeChannel*) localChansParam->getOwner())->localChannelIndexes = localChansParam->getArrayValue();
930929

931930
for (int ch = 0; ch < SpikeChannel::getNumChannels (type); ch++)
932931
{
@@ -935,7 +934,10 @@ void SpikeDetector::loadCustomParametersFromXml (XmlElement* xml)
935934
spikeChannel->getParameter ("dyn_threshold" + String (ch + 1))->fromXml (spikeParamsXml);
936935
}
937936

937+
spikeChannel->getParameter ("thrshlder_type")->fromXml (spikeParamsXml);
938+
parameterValueChanged (spikeChannel->getParameter ("thrshlder_type"));
938939
spikeChannel->getParameter ("waveform_type")->fromXml (spikeParamsXml);
940+
parameterValueChanged (spikeChannel->getParameter ("waveform_type"));
939941
}
940942
}
941943
}

Plugins/SpikeDetector/SpikeDetectorEditor.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ SpikeDetectorEditor::SpikeDetectorEditor (GenericProcessor* parentNode)
4343
addAndMakeVisible (configureButton.get());
4444
}
4545

46+
SpikeDetectorEditor::~SpikeDetectorEditor()
47+
{
48+
if (currentConfigWindow != nullptr)
49+
{
50+
currentConfigWindow->removeComponentListener (this);
51+
currentConfigWindow->tableModel->update (Array<SpikeChannel*> ());
52+
}
53+
}
54+
4655
void SpikeDetectorEditor::selectedStreamHasChanged()
4756
{
4857
SpikeDetector* processor = (SpikeDetector*) getProcessor();
@@ -64,6 +73,8 @@ void SpikeDetectorEditor::buttonClicked (Button* button)
6473
acquisitionIsActive);
6574

6675
CoreServices::getPopupManager()->showPopup (std::unique_ptr<PopupComponent> (currentConfigWindow), button);
76+
77+
currentConfigWindow->addComponentListener (this);
6778
}
6879
}
6980

@@ -126,3 +137,12 @@ int SpikeDetectorEditor::getNumChannelsForCurrentStream()
126137
else
127138
return 0;
128139
}
140+
141+
void SpikeDetectorEditor::componentBeingDeleted (Component& component)
142+
{
143+
if (currentConfigWindow != nullptr)
144+
{
145+
currentConfigWindow->removeComponentListener (this);
146+
currentConfigWindow = nullptr;
147+
}
148+
}

Plugins/SpikeDetector/SpikeDetectorEditor.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ class PopupConfigurationWindow;
4444
*/
4545

4646
class SpikeDetectorEditor : public GenericEditor,
47-
public Button::Listener
47+
public Button::Listener,
48+
public ComponentListener
4849
{
4950
public:
5051
/** Constructor*/
5152
SpikeDetectorEditor (GenericProcessor* parentNode);
5253

5354
/** Destructor */
54-
virtual ~SpikeDetectorEditor() {}
55+
~SpikeDetectorEditor();
5556

5657
/** Called when configure button is clicked */
5758
void buttonClicked (Button* button) override;
@@ -71,6 +72,8 @@ class SpikeDetectorEditor : public GenericEditor,
7172
/** Update configuration window */
7273
void updateConfigurationWindow();
7374

75+
void componentBeingDeleted (Component& component) override;
76+
7477
private:
7578
std::unique_ptr<UtilityButton> configureButton;
7679
PopupConfigurationWindow* currentConfigWindow;

Resources/Configs/acq_board_config.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<EDITOR isCollapsed="0" isDrawerOpen="0" displayName="Record Node" activeStream="0"/>
5252
</PROCESSOR>
5353
<PROCESSOR name="LFP Viewer" insertionPoint="1" pluginName="LFP Viewer"
54-
type="1" index="8" libraryName="LFP viewer" libraryVersion="0.1.0"
54+
type="1" index="8" libraryName="LFP viewer" libraryVersion=""
5555
processorType="3" nodeId="103">
5656
<PROCESSOR_PARAMETERS/>
5757
<STREAM name="Rhythm Data" description="Continuous and event data from a device running Rhythm FPGA firmware"
@@ -91,7 +91,7 @@
9191
</EDITOR>
9292
</PROCESSOR>
9393
<PROCESSOR name="Bandpass Filter" insertionPoint="1" pluginName="Bandpass Filter"
94-
type="1" index="6" libraryName="Bandpass Filter" libraryVersion="0.1.0"
94+
type="1" index="6" libraryName="Bandpass Filter" libraryVersion=""
9595
processorType="1" nodeId="104">
9696
<PROCESSOR_PARAMETERS/>
9797
<STREAM name="Rhythm Data" description="Continuous and event data from a device running Rhythm FPGA firmware"
@@ -103,7 +103,7 @@
103103
activeStream="0"/>
104104
</PROCESSOR>
105105
<PROCESSOR name="Spike Detector" insertionPoint="1" pluginName="Spike Detector"
106-
type="1" index="2" libraryName="Spike Detector" libraryVersion="0.1.0"
106+
type="1" index="2" libraryName="Spike Detector" libraryVersion=""
107107
processorType="1" nodeId="105">
108108
<PROCESSOR_PARAMETERS/>
109109
<STREAM name="Rhythm Data" description="Continuous and event data from a device running Rhythm FPGA firmware"
@@ -171,7 +171,7 @@
171171
<EDITOR isCollapsed="0" isDrawerOpen="0" displayName="Record Node" activeStream="0"/>
172172
</PROCESSOR>
173173
<PROCESSOR name="Spike Viewer" insertionPoint="1" pluginName="Spike Viewer"
174-
type="1" index="3" libraryName="Spike Viewer" libraryVersion="0.1.0"
174+
type="1" index="3" libraryName="Spike Viewer" libraryVersion=""
175175
processorType="3" nodeId="107">
176176
<PROCESSOR_PARAMETERS/>
177177
<STREAM name="Rhythm Data" description="Continuous and event data from a device running Rhythm FPGA firmware"
@@ -232,11 +232,6 @@
232232
<TAB nodeId="107"/>
233233
</TABBEDCOMPONENT>
234234
</DATAVIEWPORT>
235-
<AUDIO sampleRate="48000.0" bufferSize="1024" deviceType="Windows Audio">
236-
<DEVICESETUP deviceType="Windows Audio" audioOutputDeviceName="Speaker/HP (Realtek High Definition Audio)"
237-
audioInputDeviceName="" audioDeviceRate="48000.0" audioDeviceBufferSize="1024"
238-
audioDeviceInChans="0" audioDeviceOutChans="11"/>
239-
</AUDIO>
240235
<CONTROLPANEL isOpen="1" recordPath="default" recordEngine="BINARY"/>
241236
<AUDIOEDITOR isMuted="0" volume="42.0" noiseGate="10.0"/>
242237
<FILENAMECONFIG>

Resources/Configs/file_reader_config.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<EDITOR isCollapsed="0" isDrawerOpen="0" displayName="Record Node" activeStream="0"/>
3838
</PROCESSOR>
3939
<PROCESSOR name="LFP Viewer" insertionPoint="1" pluginName="LFP Viewer"
40-
type="1" index="7" libraryName="LFP viewer" libraryVersion="0.1.0"
40+
type="1" index="7" libraryName="LFP viewer" libraryVersion=""
4141
processorType="3" nodeId="102">
4242
<PROCESSOR_PARAMETERS/>
4343
<STREAM name="example_data" description="A description of the File Reader Stream"
@@ -77,7 +77,7 @@
7777
</EDITOR>
7878
</PROCESSOR>
7979
<PROCESSOR name="Bandpass Filter" insertionPoint="1" pluginName="Bandpass Filter"
80-
type="1" index="6" libraryName="Bandpass Filter" libraryVersion="0.1.0"
80+
type="1" index="6" libraryName="Bandpass Filter" libraryVersion=""
8181
processorType="1" nodeId="103">
8282
<PROCESSOR_PARAMETERS threads="1"/>
8383
<STREAM name="example_data" description="A description of the File Reader Stream"
@@ -89,7 +89,7 @@
8989
activeStream="0"/>
9090
</PROCESSOR>
9191
<PROCESSOR name="Spike Detector" insertionPoint="1" pluginName="Spike Detector"
92-
type="1" index="4" libraryName="Spike Detector" libraryVersion="0.1.0"
92+
type="1" index="4" libraryName="Spike Detector" libraryVersion=""
9393
processorType="1" nodeId="104">
9494
<PROCESSOR_PARAMETERS/>
9595
<STREAM name="example_data" description="A description of the File Reader Stream"
@@ -170,7 +170,7 @@
170170
activeStream="0"/>
171171
</PROCESSOR>
172172
<PROCESSOR name="Spike Viewer" insertionPoint="1" pluginName="Spike Viewer"
173-
type="1" index="5" libraryName="Spike Viewer" libraryVersion="0.1.0"
173+
type="1" index="5" libraryName="Spike Viewer" libraryVersion=""
174174
processorType="3" nodeId="107">
175175
<PROCESSOR_PARAMETERS/>
176176
<STREAM name="example_data" description="A description of the File Reader Stream"
@@ -259,8 +259,4 @@
259259
<COLOR ID="807" R="0" G="0" B="0"/>
260260
</PROCESSORLIST>
261261
<UICOMPONENT isProcessorListOpen="1" isEditorViewportOpen="1" colorTheme="0"/>
262-
<AUDIO sampleRate="44100.0" bufferSize="1024" deviceType="CoreAudio">
263-
<DEVICESETUP deviceType="CoreAudio" audioOutputDeviceName="MacBook Pro Speakers"
264-
audioInputDeviceName="" audioDeviceRate="44100.0" audioDeviceBufferSize="1024"/>
265-
</AUDIO>
266262
</SETTINGS>

Resources/Configs/neuropixels_pxi_config.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
<EDITOR isCollapsed="0" isDrawerOpen="0" displayName="Record Node" activeStream="0"/>
256256
</PROCESSOR>
257257
<PROCESSOR name="LFP Viewer" insertionPoint="1" pluginName="LFP Viewer"
258-
type="1" index="6" libraryName="LFP viewer" libraryVersion="0.1.0"
258+
type="1" index="6" libraryName="LFP viewer" libraryVersion=""
259259
processorType="3" nodeId="102">
260260
<PROCESSOR_PARAMETERS/>
261261
<STREAM name="ProbeA-AP" description="description" sample_rate="30000.0"
@@ -299,7 +299,7 @@
299299
</EDITOR>
300300
</PROCESSOR>
301301
<PROCESSOR name="Bandpass Filter" insertionPoint="1" pluginName="Bandpass Filter"
302-
type="1" index="1" libraryName="Bandpass Filter" libraryVersion="1.0.0-dev"
302+
type="1" index="1" libraryName="Bandpass Filter" libraryVersion=""
303303
processorType="1" nodeId="103">
304304
<PROCESSOR_PARAMETERS threads="1"/>
305305
<STREAM name="ProbeA-AP" description="description" sample_rate="30000.0"
@@ -315,7 +315,7 @@
315315
activeStream="0"/>
316316
</PROCESSOR>
317317
<PROCESSOR name="Neuropixels CAR" insertionPoint="1" pluginName="Neuropixels CAR"
318-
type="1" index="5" libraryName="Neuropixels CAR" libraryVersion="0.1.0"
318+
type="1" index="5" libraryName="Neuropixels CAR" libraryVersion=""
319319
processorType="1" nodeId="104">
320320
<PROCESSOR_PARAMETERS/>
321321
<STREAM name="ProbeA-AP" description="description" sample_rate="30000.0"
@@ -331,7 +331,7 @@
331331
activeStream="0"/>
332332
</PROCESSOR>
333333
<PROCESSOR name="Probe Viewer" insertionPoint="1" pluginName="Probe Viewer"
334-
type="1" index="7" libraryName="Probe Viewer" libraryVersion="0.4.0"
334+
type="1" index="7" libraryName="Probe Viewer" libraryVersion=""
335335
processorType="3" nodeId="105">
336336
<PROCESSOR_PARAMETERS trigger_line="-1" display_stream="0"/>
337337
<STREAM name="ProbeA-AP" description="description" sample_rate="30000.0"
@@ -376,10 +376,6 @@
376376
<TAB nodeId="105"/>
377377
</TABBEDCOMPONENT>
378378
</DATAVIEWPORT>
379-
<AUDIO sampleRate="48000.0" bufferSize="1024" deviceType="Windows Audio">
380-
<DEVICESETUP deviceType="Windows Audio" audioOutputDeviceName="LG HDR WQHD (NVIDIA High Definition Audio)"
381-
audioInputDeviceName="" audioDeviceRate="48000.0" audioDeviceBufferSize="1024"/>
382-
</AUDIO>
383379
<CONTROLPANEL isOpen="1" recordPath="default" recordEngine="BINARY"/>
384380
<AUDIOEDITOR isMuted="0" volume="50.0" noiseGate="10.0"/>
385381
<FILENAMECONFIG>

Resources/Configs/onebox_config.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
<EDITOR isCollapsed="0" isDrawerOpen="0" displayName="Record Node" activeStream="0"/>
256256
</PROCESSOR>
257257
<PROCESSOR name="LFP Viewer" insertionPoint="1" pluginName="LFP Viewer"
258-
type="1" index="6" libraryName="LFP viewer" libraryVersion="0.1.0"
258+
type="1" index="6" libraryName="LFP viewer" libraryVersion=""
259259
processorType="3" nodeId="102">
260260
<PROCESSOR_PARAMETERS/>
261261
<STREAM name="ProbeA-AP" description="description" sample_rate="30000.0"
@@ -299,7 +299,7 @@
299299
</EDITOR>
300300
</PROCESSOR>
301301
<PROCESSOR name="Bandpass Filter" insertionPoint="1" pluginName="Bandpass Filter"
302-
type="1" index="1" libraryName="Bandpass Filter" libraryVersion="1.0.0-dev"
302+
type="1" index="1" libraryName="Bandpass Filter" libraryVersion=""
303303
processorType="1" nodeId="103">
304304
<PROCESSOR_PARAMETERS threads="1"/>
305305
<STREAM name="ProbeA-AP" description="description" sample_rate="30000.0"
@@ -315,7 +315,7 @@
315315
activeStream="0"/>
316316
</PROCESSOR>
317317
<PROCESSOR name="Neuropixels CAR" insertionPoint="1" pluginName="Neuropixels CAR"
318-
type="1" index="5" libraryName="Neuropixels CAR" libraryVersion="0.1.0"
318+
type="1" index="5" libraryName="Neuropixels CAR" libraryVersion=""
319319
processorType="1" nodeId="104">
320320
<PROCESSOR_PARAMETERS/>
321321
<STREAM name="ProbeA-AP" description="description" sample_rate="30000.0"
@@ -331,7 +331,7 @@
331331
activeStream="0"/>
332332
</PROCESSOR>
333333
<PROCESSOR name="Probe Viewer" insertionPoint="1" pluginName="Probe Viewer"
334-
type="1" index="7" libraryName="Probe Viewer" libraryVersion="0.4.0"
334+
type="1" index="7" libraryName="Probe Viewer" libraryVersion=""
335335
processorType="3" nodeId="105">
336336
<PROCESSOR_PARAMETERS trigger_line="-1" display_stream="0"/>
337337
<STREAM name="ProbeA-AP" description="description" sample_rate="30000.0"
@@ -376,10 +376,6 @@
376376
<TAB nodeId="105"/>
377377
</TABBEDCOMPONENT>
378378
</DATAVIEWPORT>
379-
<AUDIO sampleRate="48000.0" bufferSize="1024" deviceType="Windows Audio">
380-
<DEVICESETUP deviceType="Windows Audio" audioOutputDeviceName="LG HDR WQHD (NVIDIA High Definition Audio)"
381-
audioInputDeviceName="" audioDeviceRate="48000.0" audioDeviceBufferSize="1024"/>
382-
</AUDIO>
383379
<CONTROLPANEL isOpen="1" recordPath="default" recordEngine="BINARY"/>
384380
<AUDIOEDITOR isMuted="0" volume="50.0" noiseGate="10.0"/>
385381
<FILENAMECONFIG>

0 commit comments

Comments
 (0)