Skip to content
Snippets Groups Projects
Commit 738b22b2 authored by Josh Siegle's avatar Josh Siegle
Browse files

Fix bug in loading saved event channel in RecordControlEditor

parent 7d8e7d25
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ RecordControlEditor::RecordControlEditor(GenericProcessor* parentNode, bool useD ...@@ -33,7 +33,7 @@ RecordControlEditor::RecordControlEditor(GenericProcessor* parentNode, bool useD
//channelSelector->eventsOnly = true; //channelSelector->eventsOnly = true;
chanSel = new Label("Chanel Text","Trigger Channel:"); chanSel = new Label("Channel Text","Trigger Channel:");
chanSel->setEditable(false); chanSel->setEditable(false);
chanSel->setJustificationType(Justification::centredLeft); chanSel->setJustificationType(Justification::centredLeft);
chanSel->setBounds(15,35,120,20); chanSel->setBounds(15,35,120,20);
...@@ -51,6 +51,14 @@ RecordControlEditor::RecordControlEditor(GenericProcessor* parentNode, bool useD ...@@ -51,6 +51,14 @@ RecordControlEditor::RecordControlEditor(GenericProcessor* parentNode, bool useD
addAndMakeVisible(availableChans); addAndMakeVisible(availableChans);
availableChans->addItem("None",1);
for (int i = 0; i < 10 ; i++)
{
String channelName = "Channel ";
channelName += i + 1;
availableChans->addItem(channelName,i+2);
}
newFileToggleButton = new UtilityButton("SPLIT FILES", Font("Small Text", 13, Font::plain)); newFileToggleButton = new UtilityButton("SPLIT FILES", Font("Small Text", 13, Font::plain));
newFileToggleButton->setRadius(3.0f); newFileToggleButton->setRadius(3.0f);
newFileToggleButton->setBounds(35, 95, 90, 18); newFileToggleButton->setBounds(35, 95, 90, 18);
...@@ -68,8 +76,8 @@ RecordControlEditor::~RecordControlEditor() ...@@ -68,8 +76,8 @@ RecordControlEditor::~RecordControlEditor()
void RecordControlEditor::comboBoxChanged(ComboBox* comboBox) void RecordControlEditor::comboBoxChanged(ComboBox* comboBox)
{ {
if (comboBox->getSelectedId() > 0) if (comboBox->getSelectedId() > 1)
getProcessor()->setParameter(0, (float) comboBox->getSelectedId()-1); getProcessor()->setParameter(0, (float) comboBox->getSelectedId()-2);
else else
getProcessor()->setParameter(0, -1); getProcessor()->setParameter(0, -1);
} }
...@@ -87,14 +95,9 @@ void RecordControlEditor::buttonEvent(Button* button) ...@@ -87,14 +95,9 @@ void RecordControlEditor::buttonEvent(Button* button)
void RecordControlEditor::updateSettings() void RecordControlEditor::updateSettings()
{ {
availableChans->clear(); //availableChans->clear();
//GenericProcessor* processor = getProcessor(); //GenericProcessor* processor = getProcessor();
for (int i = 0; i < 10 ; i++)
{
String channelName = "Channel ";
channelName += i + 1;
availableChans->addItem(channelName,i+1);
}
} }
...@@ -119,7 +122,7 @@ void RecordControlEditor::loadEditorParameters(XmlElement* xml) ...@@ -119,7 +122,7 @@ void RecordControlEditor::loadEditorParameters(XmlElement* xml)
{ {
newFileToggleButton->setToggleState(xmlNode->getBoolAttribute("FileSaveOption"), true); newFileToggleButton->setToggleState(xmlNode->getBoolAttribute("FileSaveOption"), true);
availableChans->setSelectedId(xmlNode->getIntAttribute("Channel")); availableChans->setSelectedId(xmlNode->getIntAttribute("Channel"), NotificationType::sendNotification);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment