Skip to content

Commit

Permalink
Merge branch 'feature/audio-io-naming' into develop
Browse files Browse the repository at this point in the history
closes #26
  • Loading branch information
x37v committed Nov 10, 2023
2 parents 83f0079 + d25a480 commit 89770a5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Source/RNBOMetasound/Private/RNBOOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,24 @@ class FRNBOMetasoundParam
for (auto& p : desc[selector]) {
if (p.contains("type") && sig.compare(p["type"].get<std::string>()) == 0) {
std::string name = p["tag"].get<std::string>();
params.emplace_back(FString(name.c_str()), FText::AsCultureInvariant(name.c_str()), FText::AsCultureInvariant(name.c_str()), 0.0f);
std::string tooltip = name;
std::string displayName = name;

// read comment and populate displayName if it exists
if (p.contains("comment") && p["comment"].is_string()) {
displayName = p["comment"].get<std::string>();
}
if (p.contains("meta") && p["meta"].is_object()) {
const RNBO::Json& meta = p["meta"];
if (meta.contains("displayname") && meta["displayname"].is_string()) {
displayName = meta["displayname"].get<std::string>();
}
if (meta.contains("tooltip") && meta["tooltip"].is_string()) {
tooltip = meta["tooltip"].get<std::string>();
}
}

params.emplace_back(FString(name.c_str()), FText::AsCultureInvariant(tooltip.c_str()), FText::AsCultureInvariant(displayName.c_str()), 0.0f);
}
}

Expand Down
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ You can set whether a parameter of your RNBO patcher will become an input or an
* `[param foo @meta out:true]` will create both an input and an output pin
* `[param foo @meta in:false,out:true]` will only create an output pin

## Audio Pin Naming

By default a pin for `[in~ 1]` or `[out~ 2]` will be named "in1" or "out2" but you can override that in 2 ways.

* `[in~ 1 @comment envelope]` will set the pin name to "envelope"
* `[in~ 1 @meta displayname:'my name']` will set the pin name to "my name"
* `[in~ 1 @meta tooltip:'this is a tooltip']` will set the pin tooltip to "this is a tooltip"

## Generating Pin Types

*This section is a stub --*
Expand Down

0 comments on commit 89770a5

Please sign in to comment.