Skip to content

Commit 9944d35

Browse files
committed
Merge branch development-juce8 into testing-juce8
2 parents 9306529 + ab2f3b3 commit 9944d35

19 files changed

Lines changed: 157 additions & 96 deletions

File tree

JuceLibraryCode/modules/juce_gui_basics/widgets/juce_ComboBox.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,13 +454,13 @@ void ComboBox::lookAndFeelChanged()
454454
//==============================================================================
455455
bool ComboBox::keyPressed (const KeyPress& key)
456456
{
457-
if (key == KeyPress::upKey || key == KeyPress::leftKey)
457+
if (key == KeyPress::upKey)
458458
{
459459
nudgeSelectedItem (-1);
460460
return true;
461461
}
462462

463-
if (key == KeyPress::downKey || key == KeyPress::rightKey)
463+
if (key == KeyPress::downKey)
464464
{
465465
nudgeSelectedItem (1);
466466
return true;

Plugins/LfpViewer/LfpDisplayCanvas.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,6 @@ LfpDisplaySplitter::LfpDisplaySplitter (LfpDisplayNode* node,
713713

714714
lfpDisplay->options = options.get();
715715

716-
timescale->setTimebase (timebase);
717-
718716
viewport->setViewedComponent (lfpDisplay.get(), false);
719717
viewport->setScrollBarsShown (true, false);
720718

Plugins/LfpViewer/LfpDisplayOptions.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ LfpDisplayOptions::LfpDisplayOptions (LfpDisplayCanvas* canvas_, LfpDisplaySplit
9494
timebaseSelectionLabel->setFont (labelFont);
9595
mainOptions->addAndMakeVisible (timebaseSelectionLabel.get());
9696

97+
setTimebaseAndSelectionText (selectedTimebaseValue.getFloatValue());
98+
9799
// Channel height
98100
spreads.add ("6");
99101
spreads.add ("10");
@@ -1533,7 +1535,7 @@ void LfpDisplayOptions::loadParameters (XmlElement* xml)
15331535
String rangeString = xmlNode->getStringAttribute ("Range");
15341536
ranges.addTokens (rangeString, ",", "\"");
15351537

1536-
setSelectedType( (ContinuousChannel::Type) xmlNode->getIntAttribute ("selectedChannelType", ContinuousChannel::Type::ELECTRODE));
1538+
setSelectedType ((ContinuousChannel::Type) xmlNode->getIntAttribute ("selectedChannelType", ContinuousChannel::Type::ELECTRODE));
15371539

15381540
selectedVoltageRangeValues[0] = ranges[0];
15391541
selectedVoltageRangeValues[1] = ranges[1];

Plugins/SpikeDetector/PopupConfigurationWindow.cpp

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ ThresholdSelectorCustomComponent::~ThresholdSelectorCustomComponent()
251251

252252
void ThresholdSelectorCustomComponent::mouseDown (const MouseEvent& event)
253253
{
254-
if (channel == nullptr)
254+
if (channel == nullptr || ! channel->isValid())
255255
return;
256256

257257
auto* popupComponent = new PopupThresholdComponent (table,
@@ -334,7 +334,9 @@ void ThresholdSelectorCustomComponent::paint (Graphics& g)
334334

335335
thresholdString = thresholdString.substring (0, thresholdString.length() - 1);
336336

337-
g.setColour (findColour (ThemeColours::defaultText));
337+
float alpha = getParentComponent()->isEnabled() ? 1.0f : 0.5f;
338+
339+
g.setColour (findColour (ThemeColours::defaultText).withAlpha (alpha));
338340
g.setFont (FontOptions ("Inter", "Regular", 14.0f));
339341
g.drawFittedText (thresholdString, 4, 0, getWidth() - 8, getHeight(), Justification::centredLeft, 1, 0.75f);
340342
}
@@ -380,7 +382,7 @@ void ChannelSelectorCustomComponent::showAsPopup()
380382

381383
void ChannelSelectorCustomComponent::mouseDown (const juce::MouseEvent& event)
382384
{
383-
if (acquisitionIsActive)
385+
if (acquisitionIsActive || ! getParentComponent()->isEnabled())
384386
return;
385387

386388
showAsPopup();
@@ -449,7 +451,7 @@ void WaveformSelectorCustomComponent::setRowAndColumn (const int newRow, const i
449451

450452
void DeleteButtonCustomComponent::mouseDown (const juce::MouseEvent& event)
451453
{
452-
if (acquisitionIsActive)
454+
if (acquisitionIsActive || ! getParentComponent()->isEnabled())
453455
return;
454456

455457
table->deleteSelectedRows (row);
@@ -460,7 +462,7 @@ void DeleteButtonCustomComponent::paint (Graphics& g)
460462
int width = getWidth();
461463
int height = getHeight();
462464

463-
if (acquisitionIsActive)
465+
if (acquisitionIsActive || ! getParentComponent()->isEnabled())
464466
{
465467
g.setColour (Colours::grey);
466468
}
@@ -471,7 +473,7 @@ void DeleteButtonCustomComponent::paint (Graphics& g)
471473

472474
g.fillEllipse (7, 7, width - 14, height - 14);
473475
g.setColour (Colours::white);
474-
g.fillRect (9, (height / 2) - 2, width - 19, 3);
476+
g.fillRect (9, (height / 2) - 1, width - 19, 2);
475477
}
476478

477479
void DeleteButtonCustomComponent::setRowAndColumn (const int newRow, const int newColumn)
@@ -758,6 +760,15 @@ void SpikeDetectorTableModel::update (Array<SpikeChannel*> spikeChannels_)
758760

759761
table->updateContent();
760762

763+
if (spikeChannels.size() > 0 && ! spikeChannels[0]->isValid())
764+
{
765+
table->setEnabled (false);
766+
}
767+
else
768+
{
769+
table->setEnabled (true);
770+
}
771+
761772
waveformComponents.clear();
762773
thresholdComponents.clear();
763774

@@ -781,33 +792,23 @@ void SpikeDetectorTableModel::paintRowBackground (Graphics& g, int rowNumber, in
781792
if (rowNumber >= spikeChannels.size())
782793
return;
783794

784-
if (rowIsSelected)
785-
{
786-
if (rowNumber % 2 == 0)
787-
g.fillAll (owner->findColour (ThemeColours::componentBackground));
788-
else
789-
g.fillAll (owner->findColour (ThemeColours::componentBackground).darker (0.25f));
790-
791-
g.setColour (owner->findColour (ThemeColours::highlightedFill));
792-
g.drawRoundedRectangle (2, 2, width - 4, height - 4, 5, 2);
793-
794-
return;
795-
}
795+
Colour rowColour;
796796

797797
if (spikeChannels[rowNumber]->isValid())
798-
{
799-
if (rowNumber % 2 == 0)
800-
g.fillAll (owner->findColour (ThemeColours::componentBackground));
801-
else
802-
g.fillAll (owner->findColour (ThemeColours::componentBackground).darker (0.25f));
803-
804-
return;
805-
}
798+
rowColour = owner->findColour (ThemeColours::componentBackground);
799+
else
800+
rowColour = Colour (90, 50, 50);
806801

807802
if (rowNumber % 2 == 0)
808-
g.fillAll (Colour (90, 50, 50));
803+
g.fillAll (rowColour);
809804
else
810-
g.fillAll (Colour (60, 30, 30));
805+
g.fillAll (rowColour.darker (0.25f));
806+
807+
if (rowIsSelected)
808+
{
809+
g.setColour (owner->findColour (ThemeColours::highlightedFill));
810+
g.drawRoundedRectangle (2, 2, width - 4, height - 4, 5, 2);
811+
}
811812
}
812813

813814
void SpikeDetectorTableModel::paintCell (Graphics& g, int rowNumber, int columnId, int width, int height, bool rowIsSelected)
@@ -1055,8 +1056,14 @@ PopupConfigurationWindow::PopupConfigurationWindow (SpikeDetectorEditor* editor_
10551056
addAndMakeVisible (viewport.get());
10561057
update (spikeChannels);
10571058

1058-
auto stream = editor->getProcessor()->getDataStream (editor->getCurrentStream());
1059-
popupTitle = String(stream->getSourceNodeId()) + " " + stream->getSourceNodeName() + " - " + stream->getName();
1059+
if (auto stream = editor->getProcessor()->getDataStream (editor->getCurrentStream()))
1060+
{
1061+
popupTitle = String (stream->getSourceNodeId()) + " " + stream->getSourceNodeName() + " - " + stream->getName();
1062+
}
1063+
else
1064+
{
1065+
popupTitle = "No streams available";
1066+
}
10601067
}
10611068

10621069
void PopupConfigurationWindow::scrollBarMoved (ScrollBar* scrollBar, double newRangeStart)
@@ -1128,12 +1135,13 @@ void PopupConfigurationWindow::paint (Graphics& g)
11281135
bool PopupConfigurationWindow::keyPressed (const KeyPress& key)
11291136
{
11301137
// Popup component handles globally reserved undo/redo keys
1131-
PopupComponent::keyPressed (key);
1132-
1133-
// Pressing 'a' key adds a new spike channel
1134-
if (key.getTextCharacter() == 'a')
1138+
if (! PopupComponent::keyPressed (key))
11351139
{
1136-
editor->addSpikeChannels (this, spikeChannelGenerator->getSelectedType(), 1);
1140+
// Pressing 'a' key adds a new spike channel
1141+
if (key.getTextCharacter() == 'a')
1142+
{
1143+
editor->addSpikeChannels (this, spikeChannelGenerator->getSelectedType(), 1);
1144+
}
11371145
}
11381146

11391147
return true;

Plugins/SpikeDetector/PopupConfigurationWindow.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ class ChannelSelectorCustomComponent : public PopupChannelSelector::Listener,
103103
channels->setNextValue (newArray);
104104
}
105105

106+
/** Get the number of channels */
107+
int getChannelCount() override
108+
{
109+
return channels->getChannelCount();
110+
}
111+
106112
/** Sets row and column */
107113
void setRowAndColumn (const int newRow, const int newColumn);
108114

@@ -409,6 +415,9 @@ class SpikeChannelGenerator : public Component,
409415
/** Responds to changes in the PopupChannelSelector*/
410416
void channelStateChanged (Array<int> selectedChannels);
411417

418+
/** Get the number of channels */
419+
int getChannelCount() { return channelCount; }
420+
412421
/** Responds to button clicks*/
413422
void buttonClicked (Button* button);
414423

Plugins/SpikeDetector/SpikeDetectorEditor.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,32 +80,34 @@ void SpikeDetectorEditor::addSpikeChannels (PopupConfigurationWindow* window, Sp
8080
{
8181
SpikeDetector* processor = (SpikeDetector*) getProcessor();
8282

83-
DataStream* stream = processor->getDataStream (getCurrentStream());
84-
85-
int nextAvailableChannel = processor->getNextAvailableChannelForStream (stream->getStreamId());
83+
if (auto stream = processor->getDataStream (getCurrentStream()))
84+
{
85+
int nextAvailableChannel = processor->getNextAvailableChannelForStream (stream->getStreamId());
8686

87-
AddSpikeChannels* action = new AddSpikeChannels (processor, stream, type, count, startChannels, nextAvailableChannel);
87+
AddSpikeChannels* action = new AddSpikeChannels (processor, stream, type, count, startChannels, nextAvailableChannel);
8888

89-
CoreServices::getUndoManager()->beginNewTransaction ("Disabled during acquisition");
90-
CoreServices::getUndoManager()->perform ((UndoableAction*) action);
89+
CoreServices::getUndoManager()->beginNewTransaction ("Disabled during acquisition");
90+
CoreServices::getUndoManager()->perform ((UndoableAction*) action);
9191

92-
if (window != nullptr)
93-
window->update (processor->getSpikeChannelsForStream (getCurrentStream()));
92+
if (window != nullptr)
93+
window->update (processor->getSpikeChannelsForStream (getCurrentStream()));
94+
}
9495
}
9596

9697
void SpikeDetectorEditor::removeSpikeChannels (PopupConfigurationWindow* window, Array<SpikeChannel*> spikeChannelsToRemove, Array<int> indeces)
9798
{
9899
SpikeDetector* processor = (SpikeDetector*) getProcessor();
99100

100-
DataStream* stream = processor->getDataStream (getCurrentStream());
101-
102-
RemoveSpikeChannels* action = new RemoveSpikeChannels (processor, stream, spikeChannelsToRemove, indeces);
101+
if (auto stream = processor->getDataStream (getCurrentStream()))
102+
{
103+
RemoveSpikeChannels* action = new RemoveSpikeChannels (processor, stream, spikeChannelsToRemove, indeces);
103104

104-
CoreServices::getUndoManager()->beginNewTransaction ("Disabled during acquisition");
105-
CoreServices::getUndoManager()->perform ((UndoableAction*) action);
105+
CoreServices::getUndoManager()->beginNewTransaction ("Disabled during acquisition");
106+
CoreServices::getUndoManager()->perform ((UndoableAction*) action);
106107

107-
if (window != nullptr)
108-
window->update (processor->getSpikeChannelsForStream (getCurrentStream()));
108+
if (window != nullptr)
109+
window->update (processor->getSpikeChannelsForStream (getCurrentStream()));
110+
}
109111
}
110112

111113
int SpikeDetectorEditor::getNumChannelsForCurrentStream()

Resources/Installers/Linux/Open-Ephys_Installer/DEBIAN/copyright

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2-
Upstream-Name: Open Ephys Plugin GUI
2+
Upstream-Name: Open Ephys GUI
33
Source: https://github.com/open-ephys/plugin-GUI/
44

55
Files: *
6-
Copyright: 2022 Open Ephys <info@open-ephys.com>
6+
Copyright: 2025 Open Ephys <info@open-ephys.com>
77
License: GPL-3+
88
This program is free software: you can redistribute it and/or modify
99
it under the terms of the GNU General Public License as published by

Resources/Installers/Windows/windows_installer_script.iss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AppId=Open Ephys
33
AppName=Open Ephys GUI
44
AppVersion=1.0.0-alpha.2
55
AppVerName=Open Ephys GUI 1.0.0-alpha.2
6-
AppCopyright=Copyright (C) 2010-2024, Open Ephys & Contributors
6+
AppCopyright=Copyright (C) 2010-2025, Open Ephys & Contributors
77
AppPublisher=open-ephys.org
88
AppPublisherURL=https://open-ephys.org/gui
99
DefaultDirName={autopf}\Open Ephys
@@ -220,7 +220,7 @@ function InitializeSetup: Boolean;
220220
begin
221221
222222
// https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist
223-
if not IsMsiProductInstalled('{36F68A90-239C-34DF-B58C-64B30153CE35}', PackVersionComponents(14, 40, 33810, 0)) then begin
223+
if not IsMsiProductInstalled('{36F68A90-239C-34DF-B58C-64B30153CE35}', PackVersionComponents(14, 42, 34433, 0)) then begin
224224
Dependency_Add('vcredist2022_x64.exe',
225225
'/passive /norestart',
226226
'Visual C++ 2015-2022 Redistributable (x64)',

Source/Processors/Editors/PopupChannelSelector.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ void PopupChannelSelector::paint (Graphics& g)
268268

269269
void PopupChannelSelector::updatePopup()
270270
{
271+
if (nChannels != listener->getChannelCount())
272+
{
273+
findParentComponentOfClass<CallOutBox>()->exitModalState (0);
274+
return;
275+
}
276+
271277
Array<int> selectedChannels = listener->getSelectedChannels();
272278
for (auto* btn : channelButtons)
273279
{

Source/Processors/Editors/PopupChannelSelector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class PLUGIN_API PopupChannelSelector : public PopupComponent,
127127
virtual ~Listener() {}
128128
virtual Array<int> getSelectedChannels() = 0;
129129
virtual void channelStateChanged (Array<int> selectedChannels) = 0;
130+
virtual int getChannelCount() = 0;
130131
};
131132

132133
/** Constructor */

0 commit comments

Comments
 (0)