Comments (1)
UPDATE: I SOLVED IT (but it wasn't easy and I still don't know exactly why this works)
Since Links don't display for Values, I needed to create another value type node called a "Relay" whose sole is to allow me to call push() multiple times in a node.
I am able to create multiple outputs by calling process() on a Node in a circular way.
ADDITIONALLY
another edge needs to be created from the output to the node id. It is backwards from the inputs.
e.g.
else if (ImGui::IsKeyReleased((ImGuiKey)SDL_SCANCODE_M)) {
auto node = std::make_shared<MIDI>();
auto extra = std::make_shared<Relay>();
auto id = m_graph.insert_node(node);
auto extraId = m_graph.insert_node(extra);
m_graph.insert_edge(extraId, id);
node->params[MIDI::NODE_ID] = id;
node->params[MIDI::EXTRA_OUT_ID] = extraId;
m_nodes.push_back(node);
// outputs have to be inserted after the process node
const ImVec2 click_pos = ImGui::GetMousePosOnOpeningCurrentPopup();
ImNodes::SetNodeScreenSpacePos(id, click_pos);
}
MIDI::process()
{
// fill voices etc.
...
// N calls to process will return N voices
// this module should push N values to the stack
float val = m_voices[m_cycle];
m_cycle++;
if (m_cycle >= m_voices.size()) {
m_cycle = 0;
}
return m_voices[m_cycle];
}
from imnodes.
Related Issues (20)
- Callback on node translation HOT 2
- Mis-Entering BoxSelection Interaction. HOT 2
- phantom TitleBar rect glitch when conditionnal call to BeginNodeTitleBar
- [Feature Request] Vertical Pins HOT 3
- Node id's are overlapped when we have many attributes and nodes. HOT 1
- emscripten + Saving editor state
- Canvas on nodes HOT 3
- Overlapping nodes aren't compatible with ImGui::BeginDragDropTarget() HOT 1
- Style
- Popup over Grid/Node? HOT 1
- Doesn't work with BeginChild HOT 2
- NodeAnimation HOT 2
- node double click event HOT 1
- Isn't this maintained anymore? HOT 2
- IM_OFFSETOF deprecation
- Question: Creating a NESTED canvas?
- Make node, pins and links work with BeginPopupContextItem
- IsEditorHovered only works between Begin/EndNodeEditor
- Cmake cannot find imgui config ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imnodes.