diff --git a/Builds/Linux/build/savedState.xml b/Builds/Linux/build/savedState.xml index 67d53f51f7f79e6a754f3ed04b0b08e5c1603ad2..f52f35a70b7a8d25c8161e120f2085adcfe8d206 100644 --- a/Builds/Linux/build/savedState.xml +++ b/Builds/Linux/build/savedState.xml @@ -2,7 +2,8 @@ <PROCESSORGRAPH> <SIGNALCHAIN> - <PROCESSOR name="Sources/Signal Generator" insertionPoint="0"/> - <PROCESSOR name="Sinks/LFP Viewer" insertionPoint="1"/> + <PROCESSOR name="Sources/Intan Demo Board" insertionPoint="0"/> + <PROCESSOR name="Filters/Bandpass Filter" insertionPoint="1"/> + <PROCESSOR name="Sinks/LFP Viewer" insertionPoint="2"/> </SIGNALCHAIN> </PROCESSORGRAPH> diff --git a/Builds/Linux/build/windowState.xml b/Builds/Linux/build/windowState.xml index 32d5f93c6fda788a0eb2938561aad55342e30f9f..15157c3b2eaefe5cdf7d394561f6d128e63635c7 100644 --- a/Builds/Linux/build/windowState.xml +++ b/Builds/Linux/build/windowState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <MAINWINDOW> - <BOUNDS x="1736" y="52" w="1293" h="968" fullscreen="0"/> + <BOUNDS x="1765" y="106" w="988" h="744" fullscreen="0"/> </MAINWINDOW> diff --git a/Source/Processors/Editors/GenericEditor.cpp b/Source/Processors/Editors/GenericEditor.cpp index 0a8e1515945104055092136e646ed52c8a1360a2..4425476e742127506e42046cbcb9c6cac20f032d 100644 --- a/Source/Processors/Editors/GenericEditor.cpp +++ b/Source/Processors/Editors/GenericEditor.cpp @@ -27,13 +27,13 @@ GenericEditor::GenericEditor (GenericProcessor* owner, FilterViewport* vp) //titleFont->setTypefaceName(T("Miso")); if (owner->isSource()) - backgroundColor = Colour(int(0.9*255.0f),int(0.019*255.0f),int(0.16*255.0f)); + backgroundColor = Colour(255, 0, 0);//Colour(int(0.9*255.0f),int(0.019*255.0f),int(0.16*255.0f)); else if (owner->isSink()) - backgroundColor = Colour(int(0.06*255.0f),int(0.46*255.0f),int(0.9*255.0f)); + backgroundColor = Colour(255, 149, 0);//Colour(int(0.06*255.0f),int(0.46*255.0f),int(0.9*255.0f)); else if (owner->isSplitter() || owner->isMerger()) - backgroundColor = Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f)); + backgroundColor = Colour(80, 80, 80);//Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f)); else - backgroundColor = Colour(int(1.0*255.0f),int(0.5*255.0f),int(0.0*255.0f)); + backgroundColor = Colour(255, 89, 0);//Colour(int(1.0*255.0f),int(0.5*255.0f),int(0.0*255.0f)); } @@ -132,39 +132,21 @@ void GenericEditor::paint (Graphics& g) GenericProcessor* p = (GenericProcessor*) getProcessor(); - //g.setColour(Colour(127,137,147)); - //g.fillAll(); - - if (isSelected) + if (isSelected) { g.setColour(Colours::yellow); - else - g.setColour(Colours::darkgrey); - - - g.fillRoundedRectangle(0,0,getWidth()-offset,getHeight(),7.0); - + g.fillRect(0,0,getWidth()-offset,getHeight()); + } if (isEnabled) g.setColour(backgroundColor); else g.setColour(Colours::lightgrey); - // if (p->isSource()) { - // g.setColour(Colours::red); - // } else if (p->isSink()) { - // g.setColour(Colours::blue); - // } else if (p->isSplitter() || p->isMerger()) - // { - // g.setColour(Colours::darkgrey); - // } else { - // g.setColour(Colours::red); - // } - - g.fillRoundedRectangle(1,1,getWidth()-(2+offset),getHeight()-2,6.0); - - g.setColour(Colours::grey); - g.fillRoundedRectangle(4,15,getWidth()-(8+offset), getHeight()-19,5.0); - g.fillRect(4,15,getWidth()-(8+offset), 20); + g.fillRect(1,1,getWidth()-(2+offset),getHeight()-2); + + g.setColour(Colour(192, 205, 209)); + g.fillRect(4,20,getWidth()-(8+offset), getHeight()-24); + //g.fillRect(4,15,getWidth()-(8+offset), 20); Font titleFont = Font(14.0, Font::plain); diff --git a/Source/UI/FilterList.cpp b/Source/UI/FilterList.cpp index f8c94ea595dff3496132ed6b661751c06346ecee..20cfcc41cd218f229aec29f376418acc6767c50b 100644 --- a/Source/UI/FilterList.cpp +++ b/Source/UI/FilterList.cpp @@ -53,6 +53,26 @@ FilterList::FilterList() : isDragging(false) baseItem->addSubItem(sinks); baseItem->addSubItem(utilities); + // set parent names / colors + + + baseItem->setParentName("Processors"); + + 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; + + } + + } + } FilterList::~FilterList() @@ -133,8 +153,6 @@ void FilterList::drawItems() hasSubItems()); drawItem(baseItem->getSubItem(n)->getSubItem(m)); - baseItem->getSubItem(n)->getSubItem(m)->parentName = category; - } } } @@ -146,30 +164,11 @@ void FilterList::drawItems() void FilterList::drawItem(FilterListItem* item) { - if (category.startsWith("P")) - { - glColor4f(0.23f, 0.23f, 0.23f, 1.0f); // [59 59 59] - item->color = Colour(int(0.23*255.0f),int(0.23*255.0f),int(0.23*255.0f)); - } else if (category.startsWith("So")) - { - glColor4f(0.9f, 0.019f, 0.16f, 1.0f); // [232 5 43] - item->color = Colour(int(0.9*255.0f),int(0.019*255.0f),int(0.16*255.0f)); - } else if (category.startsWith("F")) - { - glColor4f(1.0f, 0.5f, 0.0f, 1.0f); - item->color = Colour(int(1.0*255.0f),int(0.5*255.0f),int(0.0*255.0f)); - } else if (category.startsWith("Si")) - { - glColor4f(0.06f, 0.46f, 0.9f, 1.0f); - item->color = Colour(int(0.06*255.0f),int(0.46*255.0f),int(0.9*255.0f)); - } else if (category.startsWith("U")) - { - glColor4f(0.7f, 0.7f, 0.7f, 1.0f); - item->color = Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f)); - } else { - glColor4f(0.7f, 0.7f, 0.7f, 1.0f); - item->color = Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f)); - } + + glColor4f(item->color.getFloatRed(), + item->color.getFloatGreen(), + item->color.getFloatBlue(), + 1.0f); glBegin(GL_POLYGON); glVertex2f(0,0); @@ -178,20 +177,6 @@ void FilterList::drawItem(FilterListItem* item) glVertex2f(0,1); glEnd(); - // if (item->isSelected()) - // { - // glColor4f(1.0,1.0,1.0,1.0); - // glLineWidth(3.0); - // glBegin(GL_LINE_STRIP); - // glVertex2f(0,0); - // glVertex2f(1,0); - // glVertex2f(1,1); - // glVertex2f(0,1); - // glEnd(); - // } - - - drawItemName(item); if (item->hasSubItems()) @@ -199,13 +184,6 @@ void FilterList::drawItem(FilterListItem* item) drawButton(item->isOpen()); } - // glBegin(GL_POLYGON); - // glVertex2f(0,0); - // glVertex2f(1,0); - // glVertex2f(1,1); - // glVertex2f(0,1); - // glEnd(); - } void FilterList::drawItemName(FilterListItem* item) @@ -428,7 +406,7 @@ void FilterList::mouseDrag(const MouseEvent& e) { isDragging = true; - String b = fli->parentName; + String b = fli->getParentName(); b += "/"; b += fli->getName(); @@ -526,7 +504,54 @@ void FilterListItem::setOpen(bool t) open = t; } -const String FilterListItem::getName() +const String& FilterListItem::getName() { return name; -} \ No newline at end of file +} + + +const String& FilterListItem::getParentName() +{ + return parentName; +} + +void FilterListItem::setParentName(const String& name) +{ + parentName = name; + + if (parentName.equalsIgnoreCase("Processors")) + { + color = Colour(59, 59, 59); + + } else if (parentName.equalsIgnoreCase("Filters")) + { + color = Colour(255, 89, 0); + } else if (parentName.equalsIgnoreCase("Sinks")) + { + color = Colour(255, 149, 0); + } else if (parentName.equalsIgnoreCase("Sources")) + { + color = Colour(255, 0, 0); + + } else { + color = Colour(90, 80, 80); + } +} + + // Blue slate: + // if (parentName.equalsIgnoreCase("Processors")) + // { + // color = Colour(59, 59, 59); + // } else if (parentName.equalsIgnoreCase("Filters")) + // { + // color = Colour(82, 101, 163); + // } else if (parentName.equalsIgnoreCase("Sinks")) + // { + // color = Colour(48, 61, 102); + // } else if (parentName.equalsIgnoreCase("Sources")) + // { + // color = Colour(151, 170, 230); + + // } else { + // color = Colour(20, 37, 92); + // } \ No newline at end of file diff --git a/Source/UI/FilterList.h b/Source/UI/FilterList.h index c773588ff2685d898f599b6cd80667d41146b8bb..0cd73ab3c80760065f8b0d4fb85aca88da1778fd 100644 --- a/Source/UI/FilterList.h +++ b/Source/UI/FilterList.h @@ -32,7 +32,7 @@ public: void setUIComponent(UIComponent* ui) {UI = ui;} - + bool isOpen(); private: @@ -116,8 +116,9 @@ public: void reverseOpenState() {open = !open;} - const String getName(); - String parentName; + const String& getName(); + const String& getParentName(); + void setParentName(const String& name); Colour color; @@ -126,6 +127,7 @@ private: bool selected; bool open; const String name; + String parentName; OwnedArray<FilterListItem> subItems; };