Switchboard Extension SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
Node.hpp
1
//
2
// Created by Balazs Kiss on 2025. 02. 23..
3
//
4
5
#pragma once
6
7
#include <any>
8
#include <map>
9
#include <switchboard/export.h>
10
#include <switchboard_core/SwitchboardObject.hpp>
11
12
namespace
switchboard {
13
14
class
SWITCHBOARDSDK_EXPORT
Node
:
public
SwitchboardObject
{
15
public
:
22
static
SBAnyMap
getObjectTypeInfo
() {
23
return
SBAnyMap(
24
{
25
{ OBJECT_TYPE_FIELD_PROPERTIES,
26
SBAnyMap(
27
{
28
{
"numberOfInputs"
,
29
SBAnyMap(
30
{
31
{ PROPERTY_FIELD_TYPE, PROPERTY_TYPE_INT },
32
{ PROPERTY_FIELD_READ_ONLY,
true
},
33
{ PROPERTY_FIELD_DESCRIPTION,
34
"Number of audio input buses. Fixed when the node is created; 0 for source nodes and for nodes that do not process audio."
},
35
}
36
) },
37
{
"numberOfOutputs"
,
38
SBAnyMap(
39
{
40
{ PROPERTY_FIELD_TYPE, PROPERTY_TYPE_INT },
41
{ PROPERTY_FIELD_READ_ONLY,
true
},
42
{ PROPERTY_FIELD_DESCRIPTION,
43
"Number of audio output buses. Fixed when the node is created; 0 for sink nodes and for nodes that do not process audio."
},
44
}
45
) },
46
{
"title"
,
47
SBAnyMap(
48
{
49
{ PROPERTY_FIELD_TYPE, PROPERTY_TYPE_STRING },
50
{ PROPERTY_FIELD_READ_ONLY,
false
},
51
{ PROPERTY_FIELD_DESCRIPTION,
52
"Free-form display name that a user interface can show for the node. Does not affect processing."
},
53
{ PROPERTY_FIELD_DEFAULT_VALUE, std::string(
""
) },
54
}
55
) },
56
{
"type"
,
57
SBAnyMap(
58
{
59
{ PROPERTY_FIELD_TYPE, PROPERTY_TYPE_STRING },
60
{ PROPERTY_FIELD_READ_ONLY,
true
},
61
{ PROPERTY_FIELD_DESCRIPTION,
62
"The node type the node was created with, for example `Switchboard.Gain`."
},
63
}
64
) },
65
}
66
) },
67
}
68
);
69
}
70
77
Node
(uint
numberOfInputs
, uint
numberOfOutputs
);
78
86
std::string
getType
()
const
;
87
93
unsigned
int
getNumberOfInputs
()
const
;
94
100
unsigned
int
getNumberOfOutputs
()
const
;
101
102
// MARK: Overridden methods
103
104
Result<SBAny>
getValue
(
const
std::string& key)
override
;
105
Result<SBAny>
callAction
(
const
std::string& actionName,
const
SBAnyMap& params)
override
;
106
107
protected
:
109
unsigned
int
numberOfInputs
;
110
112
unsigned
int
numberOfOutputs
;
113
115
std::string
title
;
116
};
117
118
}
switchboard::Node::numberOfOutputs
unsigned int numberOfOutputs
The number of outputs (audio buses) for the node.
Definition
Node.hpp:112
switchboard::Node::numberOfInputs
unsigned int numberOfInputs
The number of inputs (audio buses) for the node.
Definition
Node.hpp:109
switchboard::Node::getType
std::string getType() const
Gets the type of the node.
switchboard::Node::callAction
Result< SBAny > callAction(const std::string &actionName, const SBAnyMap ¶ms) override
Calls an action on the object.
switchboard::Node::Node
Node(uint numberOfInputs, uint numberOfOutputs)
Node constructor.
switchboard::Node::getObjectTypeInfo
static SBAnyMap getObjectTypeInfo()
Static type-info fragment for the abstract Node base. Concrete node subtypes should merge this with t...
Definition
Node.hpp:22
switchboard::Node::getValue
Result< SBAny > getValue(const std::string &key) override
Gets a value from the object.
switchboard::Node::getNumberOfInputs
unsigned int getNumberOfInputs() const
Gets the number of inputs for the node.
switchboard::Node::title
std::string title
The title of the node that can be displayed in the UI.
Definition
Node.hpp:115
switchboard::Node::getNumberOfOutputs
unsigned int getNumberOfOutputs() const
Gets the number of outputs for the node.
switchboard::SwitchboardObject::SwitchboardObject
SwitchboardObject(const std::string &objectType)
SwitchboardObject constructor.
SwitchboardSDK
include
switchboard_core
Node.hpp
Generated by
1.18.0