Skip to content

Commit

Permalink
graph editor bubble
Browse files Browse the repository at this point in the history
  • Loading branch information
olilarkin committed Dec 7, 2016
1 parent 4332dff commit a2a062d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 11 additions & 5 deletions Source/pMixGraphEditorParts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ NodeComponent::NodeComponent (PMixAudioEngine& audioEngine, const uint32 nodeId_
, editor(nullptr)
, nodeName(nullptr)
, highlight(false)
, bbl(5000)
{
setSize (100, 50);
}
Expand Down Expand Up @@ -388,6 +389,7 @@ void NodeComponent::resized()

if (editor != nullptr)
editor->setBounds(10, pinSize + nodeName->getHeight(), getWidth()-20, getHeight() - pinSize - pinSize - 10 - nodeName->getHeight());

}

void NodeComponent::getPinPos (const int index, const bool isInput, float& x, float& y)
Expand Down Expand Up @@ -493,6 +495,11 @@ void NodeComponent::update()
audioEngine.getDoc().getNodePosition (nodeId, x, y);
setCentreRelative ((float) x, (float) y);
}

if(faustProc != nullptr) {
if(faustProc->getCompilerMessage() != String::empty)
bubbleMessage(faustProc->getCompilerMessage());
}
}

GraphEditor* NodeComponent::getGraphEditor() const noexcept
Expand All @@ -513,13 +520,12 @@ void NodeComponent::changeListenerCallback (ChangeBroadcaster* source)

void NodeComponent::bubbleMessage(String msg)
{
BubbleMessageComponent* bbl = new BubbleMessageComponent(5000);
AttributedString text (msg);
text.setJustification (Justification::centred);
bbl->setAlwaysOnTop (true);
bbl->addToDesktop (0);
bbl.setAlwaysOnTop (true);
bbl.addToDesktop (0);

bbl->showAt(this, text, 2000., true, true);
bbl.showAt(this, text, 5000., true, false);
}


Expand Down Expand Up @@ -746,4 +752,4 @@ void ConnectorComponent::getDistancesFromEnds (int x, int y, double& distanceFro

distanceFromStart = juce_hypot (x - (x1 - getX()), y - (y1 - getY()));
distanceFromEnd = juce_hypot (x - (x2 - getX()), y - (y2 - getY()));
}
}
4 changes: 3 additions & 1 deletion Source/pMixGraphEditorParts.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class PinComponent : public Component
const int index;
const bool isInput;
bool mouseOver;

int busIdx;

private:
PMixAudioEngine& audioEngine;

Expand Down Expand Up @@ -90,6 +91,7 @@ class NodeComponent : public Component

NodeComponent (const NodeComponent&);
NodeComponent& operator= (const NodeComponent&);
BubbleMessageComponent bbl;
};

#pragma mark -
Expand Down

0 comments on commit a2a062d

Please sign in to comment.