@@ -50,13 +50,13 @@ OnixSourceEditor::OnixSourceEditor(GenericProcessor* parentNode, OnixSource* oni
50
50
headstageComboBoxA->setSelectedId (1 , dontSendNotification);
51
51
addAndMakeVisible (headstageComboBoxA.get ());
52
52
53
- passthroughEditorA = std::make_unique<ToggleParameterEditor>(onixSource-> getParameter ( " passthroughA " ) );
54
- passthroughEditorA-> setLayout (ParameterEditor::nameHidden );
55
- passthroughEditorA-> setBounds (headstageComboBoxA-> getX (), headstageComboBoxA-> getBottom () + 4 , 60 , headstageComboBoxA-> getHeight () );
56
- addAndMakeVisible (passthroughEditorA .get ());
53
+ portVoltageOverrideLabelA = std::make_unique<Label>( " voltageOverrideLabelA " , " Voltage " );
54
+ portVoltageOverrideLabelA-> setBounds (headstageComboBoxA-> getX (), headstageComboBoxA-> getBottom () + 4 , 50 , headstageComboBoxA-> getHeight () );
55
+ portVoltageOverrideLabelA-> setFont (fontOptionSmall );
56
+ addAndMakeVisible (portVoltageOverrideLabelA .get ());
57
57
58
58
portVoltageValueA = std::make_unique<Label>(" voltageValueA" , " " );
59
- portVoltageValueA->setBounds (passthroughEditorA ->getRight () + 10 , passthroughEditorA ->getY (), 35 , passthroughEditorA ->getHeight ());
59
+ portVoltageValueA->setBounds (portVoltageOverrideLabelA ->getRight () + 3 , portVoltageOverrideLabelA ->getY (), 25 , portVoltageOverrideLabelA ->getHeight ());
60
60
portVoltageValueA->setFont (fontOptionSmall);
61
61
portVoltageValueA->setEditable (true );
62
62
portVoltageValueA->setColour (Label::textColourId, Colours::black);
@@ -66,7 +66,7 @@ OnixSourceEditor::OnixSourceEditor(GenericProcessor* parentNode, OnixSource* oni
66
66
addAndMakeVisible (portVoltageValueA.get ());
67
67
68
68
portLabelB = std::make_unique<Label>(" portLabelB" , " Port B:" );
69
- portLabelB->setBounds (portLabelA->getX (), passthroughEditorA ->getBottom () + 5 , portLabelA->getWidth (), portLabelA->getHeight ());
69
+ portLabelB->setBounds (portLabelA->getX (), portVoltageOverrideLabelA ->getBottom () + 5 , portLabelA->getWidth (), portLabelA->getHeight ());
70
70
portLabelB->setFont (fontOptionTitle);
71
71
addAndMakeVisible (portLabelB.get ());
72
72
@@ -83,13 +83,13 @@ OnixSourceEditor::OnixSourceEditor(GenericProcessor* parentNode, OnixSource* oni
83
83
headstageComboBoxB->setSelectedId (1 , dontSendNotification);
84
84
addAndMakeVisible (headstageComboBoxB.get ());
85
85
86
- passthroughEditorB = std::make_unique<ToggleParameterEditor>(onixSource-> getParameter ( " passthroughB " ) );
87
- passthroughEditorB-> setLayout (ParameterEditor::nameHidden );
88
- passthroughEditorB-> setBounds (headstageComboBoxB-> getX (), headstageComboBoxB-> getBottom () + 4 , passthroughEditorA-> getWidth (), passthroughEditorA-> getHeight () );
89
- addAndMakeVisible (passthroughEditorB .get ());
86
+ portVoltageOverrideLabelB = std::make_unique<Label>( " voltageOverrideLabelB " , " Voltage " );
87
+ portVoltageOverrideLabelB-> setBounds (headstageComboBoxB-> getX (), headstageComboBoxB-> getBottom () + 4 , portVoltageOverrideLabelA-> getWidth (), portVoltageOverrideLabelA-> getHeight () );
88
+ portVoltageOverrideLabelB-> setFont (fontOptionSmall );
89
+ addAndMakeVisible (portVoltageOverrideLabelB .get ());
90
90
91
91
portVoltageValueB = std::make_unique<Label>(" voltageValueB" , " " );
92
- portVoltageValueB->setBounds (passthroughEditorB-> getRight () + 10 , passthroughEditorB ->getY (), portVoltageValueA->getWidth (), passthroughEditorB ->getHeight ());
92
+ portVoltageValueB->setBounds (portVoltageValueA-> getX (), portVoltageOverrideLabelB ->getY (), portVoltageValueA->getWidth (), portVoltageValueA ->getHeight ());
93
93
portVoltageValueB->setFont (fontOptionSmall);
94
94
portVoltageValueB->setEditable (true );
95
95
portVoltageValueB->setColour (Label::textColourId, Colours::black);
@@ -183,13 +183,31 @@ void OnixSourceEditor::comboBoxChanged(ComboBox* cb)
183
183
String headstage = headstageComboBoxA->getText ();
184
184
185
185
thread->updateDiscoveryParameters (PortName::PortA, PortController::getHeadstageDiscoveryParameters (headstage));
186
+
187
+ if (headstage == " Neuropixels 1.0f" )
188
+ {
189
+ thread->getParameter (" passthroughA" )->setNextValue (false );
190
+ }
191
+ else
192
+ {
193
+ thread->getParameter (" passthroughA" )->setNextValue (true );
194
+ }
186
195
}
187
196
else if (cb == headstageComboBoxB.get ())
188
197
{
189
198
// TODO: Call canvas to remove / add tabs as needed depending on what is chosen
190
199
String headstage = headstageComboBoxB->getText ();
191
200
192
201
thread->updateDiscoveryParameters (PortName::PortB, PortController::getHeadstageDiscoveryParameters (headstage));
202
+
203
+ if (headstage == " Neuropixels 1.0f" )
204
+ {
205
+ thread->getParameter (" passthroughB" )->setNextValue (false );
206
+ }
207
+ else
208
+ {
209
+ thread->getParameter (" passthroughB" )->setNextValue (true );
210
+ }
193
211
}
194
212
}
195
213
0 commit comments