mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Sorted out a few pedantic warnings thrown up in the audio host demo
This commit is contained in:
parent
9510c16665
commit
0eac373893
5 changed files with 15 additions and 22 deletions
|
|
@ -120,28 +120,22 @@ void FilterGraph::removeIllegalConnections()
|
|||
changed();
|
||||
}
|
||||
|
||||
void FilterGraph::setNodePosition (const int nodeId, double x, double y)
|
||||
void FilterGraph::setNodePosition (const uint32 nodeId, double x, double y)
|
||||
{
|
||||
const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId));
|
||||
|
||||
if (n != nullptr)
|
||||
if (AudioProcessorGraph::Node::Ptr n = graph.getNodeForId (nodeId))
|
||||
{
|
||||
n->properties.set ("x", jlimit (0.0, 1.0, x));
|
||||
n->properties.set ("y", jlimit (0.0, 1.0, y));
|
||||
}
|
||||
}
|
||||
|
||||
void FilterGraph::getNodePosition (const int nodeId, double& x, double& y) const
|
||||
Point<double> FilterGraph::getNodePosition (const uint32 nodeId) const
|
||||
{
|
||||
x = y = 0;
|
||||
if (AudioProcessorGraph::Node::Ptr n = graph.getNodeForId (nodeId))
|
||||
return Point<double> (static_cast<double> (n->properties ["x"]),
|
||||
static_cast<double> (n->properties ["y"]));
|
||||
|
||||
const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId));
|
||||
|
||||
if (n != nullptr)
|
||||
{
|
||||
x = (double) n->properties ["x"];
|
||||
y = (double) n->properties ["y"];
|
||||
}
|
||||
return Point<double>();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ public:
|
|||
|
||||
void removeIllegalConnections();
|
||||
|
||||
void setNodePosition (const int nodeId, double x, double y);
|
||||
void getNodePosition (const int nodeId, double& x, double& y) const;
|
||||
void setNodePosition (uint32 nodeId, double x, double y);
|
||||
Point<double> getNodePosition (uint32 nodeId) const;
|
||||
|
||||
//==============================================================================
|
||||
int getNumConnections() const noexcept;
|
||||
|
|
|
|||
|
|
@ -508,9 +508,8 @@ public:
|
|||
setName (f->getProcessor()->getName());
|
||||
|
||||
{
|
||||
double x, y;
|
||||
graph.getNodePosition (filterID, x, y);
|
||||
setCentreRelative ((float) x, (float) y);
|
||||
Point<double> p = graph.getNodePosition (filterID);
|
||||
setCentreRelative ((float) p.x, (float) p.y);
|
||||
}
|
||||
|
||||
if (numIns != numInputs || numOuts != numOutputs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue