Skip to content

Commit

Permalink
In node groups add the output node to the list of group content becau…
Browse files Browse the repository at this point in the history
…se it will fix the issue when the group has output nodes as well as when the group has nodes that use an external output for example speakers or debug print.
  • Loading branch information
linuscu committed Sep 2, 2024
1 parent 3f8fd53 commit d60971a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/nodegraph/include/nodegraph/NodeGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ namespace l::nodegraph {
NodeGraphGroup() {
SetNumInputs(1);
SetNumOutputs(1);
mOutputNodes.push_back(&mOutputNode);
}
~NodeGraphGroup() = default;

Expand Down
6 changes: 6 additions & 0 deletions packages/nodegraph/include/nodegraph/NodeGraphOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ namespace l::nodegraph {

class GraphOutputSpeaker : public NodeGraphOp {
public:
std::string defaultOutStrings[2] = { "Left", "Right"};

GraphOutputSpeaker(NodeGraphBase* node, l::audio::AudioStream* stream = nullptr) :
NodeGraphOp(node, 2, 0, 0),
mAudioStream(stream),
Expand All @@ -301,6 +303,10 @@ namespace l::nodegraph {
void ProcessSubGraph(std::vector<NodeGraphInput>& inputs, std::vector<NodeGraphOutput>& outputs) override;
virtual void Tick(float time, float elapsed) override;

std::string_view GetOutputName(int8_t outputChannel) {
return defaultOutStrings[outputChannel];
}

std::string_view GetName() override {
return "Speaker";
}
Expand Down

0 comments on commit d60971a

Please sign in to comment.