| @@ -52,7 +52,7 @@ FilterGraph::~FilterGraph() | |||
| FilterGraph::NodeID FilterGraph::getNextUID() noexcept | |||
| { | |||
| return ++lastUID; | |||
| return FilterGraph::NodeID (++(lastUID.uid)); | |||
| } | |||
| //============================================================================== | |||
| @@ -326,7 +326,7 @@ static XmlElement* createNodeXml (AudioProcessorGraph::Node* const node) noexcep | |||
| if (auto* plugin = dynamic_cast<AudioPluginInstance*> (node->getProcessor())) | |||
| { | |||
| auto e = new XmlElement ("FILTER"); | |||
| e->setAttribute ("uid", (int) node->nodeID); | |||
| e->setAttribute ("uid", (int) node->nodeID.uid); | |||
| e->setAttribute ("x", node->properties ["x"].toString()); | |||
| e->setAttribute ("y", node->properties ["y"].toString()); | |||
| @@ -392,7 +392,7 @@ void FilterGraph::createNodeFromXml (const XmlElement& xml) | |||
| instance->setBusesLayout (layout); | |||
| } | |||
| if (auto node = graph.addNode (instance, (NodeID) xml.getIntAttribute ("uid"))) | |||
| if (auto node = graph.addNode (instance, NodeID ((uint32) xml.getIntAttribute ("uid")))) | |||
| { | |||
| if (auto* state = xml.getChildByName ("STATE")) | |||
| { | |||
| @@ -439,9 +439,9 @@ XmlElement* FilterGraph::createXml() const | |||
| { | |||
| auto e = xml->createNewChildElement ("CONNECTION"); | |||
| e->setAttribute ("srcFilter", (int) connection.source.nodeID); | |||
| e->setAttribute ("srcFilter", (int) connection.source.nodeID.uid); | |||
| e->setAttribute ("srcChannel", connection.source.channelIndex); | |||
| e->setAttribute ("dstFilter", (int) connection.destination.nodeID); | |||
| e->setAttribute ("dstFilter", (int) connection.destination.nodeID.uid); | |||
| e->setAttribute ("dstChannel", connection.destination.channelIndex); | |||
| } | |||
| @@ -460,8 +460,8 @@ void FilterGraph::restoreFromXml (const XmlElement& xml) | |||
| forEachXmlChildElementWithTagName (xml, e, "CONNECTION") | |||
| { | |||
| graph.addConnection ({ { (NodeID) e->getIntAttribute ("srcFilter"), e->getIntAttribute ("srcChannel") }, | |||
| { (NodeID) e->getIntAttribute ("dstFilter"), e->getIntAttribute ("dstChannel") } }); | |||
| graph.addConnection ({ { NodeID ((uint32) e->getIntAttribute ("srcFilter")), e->getIntAttribute ("srcChannel") }, | |||
| { NodeID ((uint32) e->getIntAttribute ("dstFilter")), e->getIntAttribute ("dstChannel") } }); | |||
| } | |||
| graph.removeIllegalConnections(); | |||
| @@ -43,7 +43,7 @@ public: | |||
| ~FilterGraph(); | |||
| //============================================================================== | |||
| typedef AudioProcessorGraph::NodeID NodeID; | |||
| using NodeID = AudioProcessorGraph::NodeID; | |||
| void addPlugin (const PluginDescription&, Point<double>); | |||
| @@ -88,7 +88,7 @@ private: | |||
| AudioPluginFormatManager& formatManager; | |||
| OwnedArray<PluginWindow> activePluginWindows; | |||
| NodeID lastUID = 0; | |||
| NodeID lastUID; | |||
| NodeID getNextUID() noexcept; | |||
| void createNodeFromXml (const XmlElement& xml); | |||
| @@ -507,7 +507,7 @@ void FilterIOConfigurationWindow::update() | |||
| auto nodeID = getNodeID(); | |||
| if (auto* graph = getGraph()) | |||
| if (nodeID != 0) | |||
| if (nodeID != AudioProcessorGraph::NodeID()) | |||
| graph->disconnectNode (nodeID); | |||
| if (auto* graphEditor = getGraphEditor()) | |||
| @@ -522,7 +522,7 @@ AudioProcessorGraph::NodeID FilterIOConfigurationWindow::getNodeID() const | |||
| if (node->getProcessor() == getAudioProcessor()) | |||
| return node->nodeID; | |||
| return 0; | |||
| return {}; | |||
| } | |||
| MainHostWindow* FilterIOConfigurationWindow::getMainWindow() const | |||
| @@ -146,7 +146,7 @@ struct GraphEditorPanel::PinComponent : public Component, | |||
| void mouseDown (const MouseEvent& e) override | |||
| { | |||
| AudioProcessorGraph::NodeAndChannel dummy { 0, 0 }; | |||
| AudioProcessorGraph::NodeAndChannel dummy { {}, 0 }; | |||
| panel.beginConnectorDrag (isInput ? dummy : pin, | |||
| isInput ? pin : dummy, | |||
| @@ -177,7 +177,7 @@ struct GraphEditorPanel::FilterComponent : public Component, | |||
| public Timer, | |||
| private AudioProcessorParameter::Listener | |||
| { | |||
| FilterComponent (GraphEditorPanel& p, uint32 id) : panel (p), graph (p.graph), pluginID (id) | |||
| FilterComponent (GraphEditorPanel& p, AudioProcessorGraph::NodeID id) : panel (p), graph (p.graph), pluginID (id) | |||
| { | |||
| shadow.setShadowProperties (DropShadow (Colours::black.withAlpha (0.5f), 3, { 0, 1 })); | |||
| setComponentEffect (&shadow); | |||
| @@ -611,7 +611,7 @@ struct GraphEditorPanel::ConnectorComponent : public Component, | |||
| getDistancesFromEnds (getPosition().toFloat() + e.position, distanceFromStart, distanceFromEnd); | |||
| const bool isNearerSource = (distanceFromStart < distanceFromEnd); | |||
| AudioProcessorGraph::NodeAndChannel dummy { 0, 0 }; | |||
| AudioProcessorGraph::NodeAndChannel dummy { {}, 0 }; | |||
| panel.beginConnectorDrag (isNearerSource ? dummy : connection.source, | |||
| isNearerSource ? connection.destination : dummy, | |||
| @@ -675,7 +675,7 @@ struct GraphEditorPanel::ConnectorComponent : public Component, | |||
| GraphEditorPanel& panel; | |||
| FilterGraph& graph; | |||
| AudioProcessorGraph::Connection connection { { 0, 0 }, { 0, 0 } }; | |||
| AudioProcessorGraph::Connection connection { { {}, 0 }, { {}, 0 } }; | |||
| Point<float> lastInputPos, lastOutputPos; | |||
| Path linePath, hitPath; | |||
| bool dragging = false; | |||
| @@ -736,10 +736,10 @@ void GraphEditorPanel::createNewPlugin (const PluginDescription& desc, Point<int | |||
| graph.addPlugin (desc, position.toDouble() / Point<double> ((double) getWidth(), (double) getHeight())); | |||
| } | |||
| GraphEditorPanel::FilterComponent* GraphEditorPanel::getComponentForFilter (const uint32 filterID) const | |||
| GraphEditorPanel::FilterComponent* GraphEditorPanel::getComponentForFilter (AudioProcessorGraph::NodeID nodeID) const | |||
| { | |||
| for (auto* fc : nodes) | |||
| if (fc->pluginID == filterID) | |||
| if (fc->pluginID == nodeID) | |||
| return fc; | |||
| return nullptr; | |||
| @@ -870,11 +870,11 @@ void GraphEditorPanel::dragConnector (const MouseEvent& e) | |||
| { | |||
| auto connection = draggingConnector->connection; | |||
| if (connection.source.nodeID == 0 && ! pin->isInput) | |||
| if (connection.source.nodeID == AudioProcessorGraph::NodeID() && ! pin->isInput) | |||
| { | |||
| connection.source = pin->pin; | |||
| } | |||
| else if (connection.destination.nodeID == 0 && pin->isInput) | |||
| else if (connection.destination.nodeID == AudioProcessorGraph::NodeID() && pin->isInput) | |||
| { | |||
| connection.destination = pin->pin; | |||
| } | |||
| @@ -886,7 +886,7 @@ void GraphEditorPanel::dragConnector (const MouseEvent& e) | |||
| } | |||
| } | |||
| if (draggingConnector->connection.source.nodeID == 0) | |||
| if (draggingConnector->connection.source.nodeID == AudioProcessorGraph::NodeID()) | |||
| draggingConnector->dragStart (pos); | |||
| else | |||
| draggingConnector->dragEnd (pos); | |||
| @@ -907,7 +907,7 @@ void GraphEditorPanel::endDraggingConnector (const MouseEvent& e) | |||
| if (auto* pin = findPinAt (e2.position)) | |||
| { | |||
| if (connection.source.nodeID == 0) | |||
| if (connection.source.nodeID == AudioProcessorGraph::NodeID()) | |||
| { | |||
| if (pin->isInput) | |||
| return; | |||
| @@ -399,7 +399,7 @@ struct RenderSequenceBuilder | |||
| for (auto&& c : graph.getConnections()) | |||
| if (c.destination.nodeID == nodeID) | |||
| maxLatency = jmax (maxLatency, getNodeDelay (c.source.nodeID.uid)); | |||
| maxLatency = jmax (maxLatency, getNodeDelay (c.source.nodeID)); | |||
| return maxLatency; | |||
| } | |||
| @@ -61,7 +61,7 @@ public: | |||
| struct NodeID | |||
| { | |||
| constexpr NodeID() {} | |||
| constexpr NodeID (uint32 i) : uid (i) {} | |||
| constexpr explicit NodeID (uint32 i) : uid (i) {} | |||
| uint32 uid = 0; | |||