Skip to content

Commit

Permalink
Fix parameter order. Data first, params last.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuscu committed Sep 4, 2024
1 parent bd9e25b commit 622f512
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/nodegraph/include/nodegraph/NodeGraphOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ namespace l::nodegraph {
/*********************************************************************/
class GraphFilterLowpass : public NodeGraphOp {
public:
std::string defaultInStrings[3] = { "Cutoff", "Resonance", "Data"};
std::string defaultInStrings[3] = { "Data", "Cutoff", "Resonance"};
std::string defaultOutStrings[1] = { "Out" };

GraphFilterLowpass(NodeGraphBase* node) :
Expand Down
23 changes: 12 additions & 11 deletions packages/nodegraph/tests/common/NodeGraphSchemaTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ TEST(NodeGraph, FilterLowpass) {
float resonance = 0.9f;
float input = 1.3f;

nodeLowpass.SetInput(0, &cutoff);
nodeLowpass.SetInput(1, &resonance);
nodeLowpass.SetInput(2, &input);
nodeLowpass.SetInput(0, &input);
nodeLowpass.SetInput(1, &cutoff);
nodeLowpass.SetInput(2, &resonance);

float oneRev = 2.0f * 3.14f / 30.0f;
for (int i = 0; i < 30; i++) {
Expand Down Expand Up @@ -135,17 +135,18 @@ TEST(NodeGraph, GraphGroups) {

auto nodeLowpass1 = group.NewNode<GraphFilterLowpass>(OutputType::Default);
auto nodeLowpass2 = group.NewNode<GraphFilterLowpass>(OutputType::Default);

// left, right
nodeLowpass1->SetInput(0, group, 2);
nodeLowpass2->SetInput(0, group, 3);

// cutoff
nodeLowpass1->SetInput(0, group, 0);
nodeLowpass2->SetInput(0, group, 0);
nodeLowpass1->SetInput(1, group, 0);
nodeLowpass2->SetInput(1, group, 0);

// resonance
nodeLowpass1->SetInput(1, group, 1);
nodeLowpass2->SetInput(1, group, 1);

// left, right
nodeLowpass1->SetInput(2, group, 2);
nodeLowpass2->SetInput(2, group, 3);
nodeLowpass1->SetInput(2, group, 1);
nodeLowpass2->SetInput(2, group, 1);

group.SetOutput(0, *nodeLowpass1, 0);
group.SetOutput(1, *nodeLowpass2, 0);
Expand Down

0 comments on commit 622f512

Please sign in to comment.