Skip to content
Snippets Groups Projects
Commit 336cc396 authored by Septen's avatar Septen
Browse files

PluginGenerator: some cleanup.

parent cb853efb
Branches
Tags
No related merge requests found
......@@ -339,7 +339,6 @@ public:
void resized() override
{
updateOpenEphysWizardComboBoxBounds (*this);
}
void buttonClicked (Button* b) override
......@@ -431,15 +430,7 @@ public:
void comboBoxChanged (ComboBox* comboBoxThatHasChanged) override
{
if (comboBoxThatHasChanged->getComponentID() == OpenEphysPluginAppWizard::COMBOBOX_ID_PLUGIN_TYPE)
{
const auto selectedIndex = comboBoxThatHasChanged->getSelectedItemIndex() + 1;
updateOpenEphysWizardComboBoxBounds (*this);
}
else
{
updateCustomItems();
}
updateCustomItems();
}
void textEditorTextChanged (TextEditor&) override
......
......@@ -24,99 +24,6 @@
#include <iostream>
// =================================================================================
static ComboBox& createPluginTypeOptionComboBox (Component& setupComp,
OwnedArray<Component>& itemsCreated,
const StringArray& fileOptions)
{
//ComboBox* pluginTypeComboBox = new ComboBox;
//itemsCreated.add (pluginTypeComboBox);
//setupComp.addChildAndSetID (pluginTypeComboBox, OpenEphysPluginAppWizard::COMBOBOX_ID_PLUGIN_TYPE);
//pluginTypeComboBox->addItemList (fileOptions, 1);
//pluginTypeComboBox->setSelectedId (1, dontSendNotification);
//Label* l = new Label (String::empty, TRANS("Plugin type") + ":");
//l->attachToComponent (pluginTypeComboBox, true);
//itemsCreated.add (l);
//return *pluginTypeComboBox;
}
static ComboBox& createProcessorTypeOptionComboBox (Component& setupComp,
OwnedArray<Component>& itemsCreated,
const StringArray& fileOptions)
{
//ComboBox* processorTypeComboBox = new ComboBox;
//itemsCreated.add (processorTypeComboBox);
//setupComp.addChildAndSetID (processorTypeComboBox, OpenEphysPluginAppWizard::COMBOBOX_ID_PROCESSOR_TYPE);
//processorTypeComboBox->addItemList (fileOptions, 1);
//processorTypeComboBox->setSelectedId (1, dontSendNotification);
//Label* l = new Label (String::empty, TRANS("Processor type") + ":");
//l->attachToComponent (processorTypeComboBox, true);
//itemsCreated.add (l);
//processorTypeComboBox->setVisible (false);
////c->setBounds ("parent.width / 2 + 160, 30, parent.width - 30, top + 22");
//return *processorTypeComboBox;
}
static int getComboResult (WizardComp& setupComp, const String& comboBoxID)
{
if (ComboBox* cb = dynamic_cast<ComboBox*> (setupComp.findChildWithID (comboBoxID)))
return cb->getSelectedItemIndex();
jassertfalse;
return 0;
}
static void updateOpenEphysWizardComboBoxBounds (const Component& parent)
{
//auto pluginTypeComboBox = dynamic_cast<ComboBox*> (parent
// .findChildWithID (OpenEphysPluginAppWizard::COMBOBOX_ID_PLUGIN_TYPE));
//auto processorTypeComboBox = dynamic_cast<ComboBox*> (parent
// .findChildWithID (OpenEphysPluginAppWizard::COMBOBOX_ID_PROCESSOR_TYPE));
//if (pluginTypeComboBox == nullptr
// || processorTypeComboBox == nullptr)
//{
// return;
//}
//const auto parentBounds = parent.getLocalBounds();
////auto rightSideOfComponent = parent.getLocalBounds().removeFromRight (parent.getWidth() / 2).withHeight (22);
//auto comboBoxBounds = juce::Rectangle<int> (parent.getWidth() / 2 + 95,
// 30,
// parent.getWidth() / 2 - 127,
// parent.getY() + 22);
//const int marginBetweenComboBoxes = 140;
//const int comboBoxMinWidth = (comboBoxBounds.getWidth() - marginBetweenComboBoxes) / 2;
//if (pluginTypeComboBox->getSelectedItemIndex() + 1 == (int)PLUGIN_TYPE_PROCESSOR)
//{
// pluginTypeComboBox->setBounds (comboBoxBounds.removeFromLeft (comboBoxMinWidth));
// comboBoxBounds.removeFromLeft (marginBetweenComboBoxes - 10);
// processorTypeComboBox->setBounds (comboBoxBounds);
// processorTypeComboBox->setVisible (true);
//}
//else
//{
// pluginTypeComboBox->setBounds (comboBoxBounds);
// processorTypeComboBox->setVisible (false);
//}
}
// ============================================================================
// ============================================================================
// ============================================================================
......@@ -146,67 +53,8 @@ struct OpenEphysPluginAppWizard : public NewProjectWizard
}
void addSetupItems (Component& setupComp, OwnedArray<Component>& itemsCreated) override
{
//const String pluginTypeOptions[] =
//{
// TRANS("Processor"),
// TRANS("Record engine"),
// TRANS("Data thread"),
// TRANS("File source")
//};
//auto& pluginTypeComboBox = createPluginTypeOptionComboBox (setupComp, itemsCreated,
// StringArray (pluginTypeOptions,
// numElementsInArray (pluginTypeOptions)));
//auto parentComboBoxListener = dynamic_cast<ComboBox::Listener*> (&setupComp);
//jassert (parentComboBoxListener != nullptr);
//pluginTypeComboBox.addListener (parentComboBoxListener);
//const String processorTypeOptions[] =
//{
// TRANS("Filter"),
// TRANS("Source"),
// TRANS("Sink"),
// //TRANS("Splitter"),
// //TRANS("Merger"),
// TRANS("Utility"),
//};
//auto& processorTypeComboBox = createProcessorTypeOptionComboBox (setupComp, itemsCreated,
// StringArray (processorTypeOptions,
// numElementsInArray (processorTypeOptions)));
//updateOpenEphysWizardComboBoxBounds (setupComp);
}
/** Gets the currently selected processor type and applies appropriate action */
Result processResultsFromSetupItems (WizardComp& setupComp) override
{
//// TODO <Kirill A>
//const int pluginTypeSelectedComboboxId = getComboResult (setupComp, COMBOBOX_ID_PLUGIN_TYPE) + 1;
//jassert (pluginTypeSelectedComboboxId != 0);
//m_pluginType = static_cast<PluginType> (pluginTypeSelectedComboboxId);
//// Get processor type only if was selected "Processor" type of the plugin
//if (pluginTypeSelectedComboboxId == (int)PLUGIN_TYPE_PROCESSOR)
//{
// const int processorTypeSelectedComboboxId = getComboResult (setupComp, COMBOBOX_ID_PROCESSOR_TYPE) + 1;
// jassert (processorTypeSelectedComboboxId != 0);
// m_processorType = static_cast<PluginProcessorType> (processorTypeSelectedComboboxId);
//}
return Result::ok();
}
Result getResultsFromConfigPage (const PluginTemplatesPageComponent* configPage)
{
// TODO
m_pluginType = configPage->getSelectedPluginType();
m_processorType = configPage->getSelectedProcessorType();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment