Skip to content

Commit c627ae2

Browse files
committed
Disable recording toggle buttons during acquisition
1 parent 41161a2 commit c627ae2

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

Source/Processors/RecordNode/RecordNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ void RecordNode::registerParameters()
114114
recordEngines.add (engines[i]->getName());
115115
addCategoricalParameter (Parameter::PROCESSOR_SCOPE, "engine", "Engine", "Recording data format", recordEngines, engineIndex, true);
116116

117-
addBooleanParameter (Parameter::PROCESSOR_SCOPE, "events", "Record Events", "Toggle saving events coming into this node", true);
118-
addBooleanParameter (Parameter::PROCESSOR_SCOPE, "spikes", "Record Spikes", "Toggle saving spikes coming into this node", true);
117+
addBooleanParameter (Parameter::PROCESSOR_SCOPE, "events", "Record Events", "Toggle saving events coming into this node", true, true);
118+
addBooleanParameter (Parameter::PROCESSOR_SCOPE, "spikes", "Record Spikes", "Toggle saving spikes coming into this node", true, true);
119119

120120
addMaskChannelsParameter (Parameter::STREAM_SCOPE, "channels", "Channels", "Channels to record from", true);
121121
addTtlLineParameter (Parameter::STREAM_SCOPE, "sync_line", "Sync Line", "Event line to use for sync signal", 8, true, false, true);

Source/Processors/RecordNode/RecordNodeEditor.cpp

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,30 @@ RecordToggleButton::~RecordToggleButton() {}
325325

326326
void RecordToggleButton::paintButton (Graphics& g, bool isMouseOver, bool isButtonDown)
327327
{
328-
g.setColour (Colour (0, 0, 0));
329-
g.fillRoundedRectangle (0, 0, getWidth(), getHeight(), 0.2 * getWidth());
328+
329+
float alpha = 1.0f;
330+
331+
if (!isEnabled())
332+
{
333+
alpha = 0.5f;
334+
}
335+
336+
g.setColour (Colour (0, 0, 0).withAlpha(alpha));
337+
g.fillRoundedRectangle (0, 0, getWidth(), getHeight(), 4);
330338

331339
if (! getToggleState())
332-
g.setColour (findColour (ThemeColours::widgetBackground));
340+
{
341+
g.setColour (findColour (ThemeColours::widgetBackground).withAlpha(alpha));
342+
}
333343
else
334-
g.setColour (Colour (255, 0, 0));
344+
{
345+
g.setColour (Colour (255, 0, 0).withAlpha(alpha));
346+
}
347+
335348

336-
g.fillRoundedRectangle (1, 1, getWidth() - 2, getHeight() - 2, 0.2 * getWidth());
349+
g.fillRoundedRectangle (1, 1, getWidth() - 2, getHeight() - 2, 3);
337350

338-
g.setColour (Colour (0, 0, 0));
351+
g.setColour (Colour (0, 0, 0).withAlpha(alpha));
339352
g.fillEllipse (0.35 * getWidth(), 0.35 * getHeight(), 0.3 * getWidth(), 0.3 * getHeight());
340353
}
341354

0 commit comments

Comments
 (0)