Skip to content
Snippets Groups Projects
Commit 6ef46803 authored by Yogi's avatar Yogi
Browse files

added function for inserting plugin-loaded items to processor list

parent 4f026f55
Branches
Tags
No related merge requests found
......@@ -67,7 +67,6 @@ do
echo "-----> Plugin compile failed."
exit
fi
make install
cd ..
fi
done
......
......@@ -42,8 +42,7 @@ ArduinoOutput::ArduinoOutput()
{
info.version = 0.1;
info.name = "Arduino Output";
info.type = 0x2;
printf("Created processor %s\n", info.name.toStdString().c_str());
info.type = 0x3;
}
ArduinoOutput::~ArduinoOutput()
......
TYPE = sinks
ifeq ($(TARGET_ARCH),)
TARGET_ARCH := -march=native
endif
......@@ -7,7 +5,6 @@ endif
# (this disables dependency generation if multiple architectures are set)
DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD)
PLUGINDIR := /usr/local/lib/GUI
BINDIR := build
LIBDIR := build
OBJDIR := build/intermediate/Debug
......@@ -37,14 +34,12 @@ $(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES)
install:
@echo ${TARGET} installed.
-@sudo mv $(BINDIR)/$(TARGET) $(PLUGINDIR)/$(TYPE)/$(TARGET)
clean:
@echo Plugin cleaned.
-@rm -f $(OUTDIR)/$(TARGET)
-@rm -rf $(OBJDIR)/*
-@rm -rf $(OBJDIR)
-@sudo rm -rf $(PLUGINDIR)/$(TYPE)/$(TARGET)
strip:
@echo Plugin stripped.
......
......@@ -159,6 +159,7 @@ void PluginManager::Manager::insertListPlugin(PluginManager::Plugin *processor)
return;
}
pluginList.push_back(processor);
AccessClass::getProcessorList()->addPluginItem(String("test"), size_t(0x1));
std::cout << "Size of list after is: " << pluginList.size() << std::endl;
}
......
......@@ -77,19 +77,13 @@ enum colorIds
for (int n = 0; n < baseItem->getNumSubItems(); n++)
{
const String category = baseItem->getSubItem(n)->getName();
baseItem->getSubItem(n)->setParentName(category);
for (int m = 0; m < baseItem->getSubItem(n)->getNumSubItems(); m++)
{
baseItem->getSubItem(n)->getSubItem(m)->setParentName(category);// = category;
}
}
}
ProcessorList::~ProcessorList()
......@@ -614,8 +608,23 @@ void ProcessorList::setColours(Array<Colour> c)
;// do nothing
}
}
}
void ProcessorList::addPluginItem(String name, size_t type) {
switch(type) {
case 0x1:
sources->addSubItem(new ProcessorListItem(name));
break;
case 0x2:
filters->addSubItem(new ProcessorListItem(name));
break;
case 0x3:
sinks->addSubItem(new ProcessorListItem(name));
break;
case 0x4:
utilities->addSubItem(new ProcessorListItem(name));
break;
}
}
// ===================================================================
......@@ -711,14 +720,3 @@ void ProcessorListItem::setParentName(const String& name)
colorId = UTILITY_COLOR;
}
}
/*
Insert selected plugin into the processor list
*/
void ProcessorList::sortAndInsertProcessor(const String& processorPath, const String& processorName)
{
std::cout << "In ProcessorList " << processorPath << " " << processorName << std::endl;;
PluginManager::Manager::getInstance()->loadPlugin(processorPath);
sources->addSubItem(new ProcessorListItem(processorName));
repaint();
}
......@@ -79,10 +79,10 @@ public:
/** Loads the ProcessorList state. */
void loadStateFromXml(XmlElement*);
void resized();
/** Add item loaded as plugin **/
void addPluginItem(String, size_t);
/** Sort and add processor to list */
void sortAndInsertProcessor(const String& processorPath, const String& processorName);
void resized();
/** Returns the height requested by the ProcessorList. Determines whether or not
to draw scroll bars.*/
......@@ -110,8 +110,6 @@ private:
int currentColor;
/** Deselects all items within the ProcessorList.*/
void clearSelectionState();
......
......@@ -559,7 +559,11 @@ bool UIComponent::perform(const InvocationInfo& info)
error += pluginFile.getFileName();
// Add to processor list
getProcessorList()->sortAndInsertProcessor(pluginFile.getFullPathName(), pluginFile.getFileName());
if(!PluginManager::Manager::getInstance()->loadPlugin(pluginFile.getFullPathName()))
{
CoreServices::sendStatusMessage(("Failed to load: " + pluginFile.getFileName()).toUTF8());
break;
}
CoreServices::sendStatusMessage(("Loaded: " + pluginFile.getFileName()).toUTF8());
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment