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 <switchboard/export.h>
8
#include <switchboard_core/SwitchboardObject.hpp>
9
10
#include <map>
11
#include <any>
12
13
namespace
switchboard {
14
15
class
SWITCHBOARDSDK_EXPORT
Node
:
public
SwitchboardObject
{
16
public
:
17
24
static
SBAnyMap
getObjectTypeInfo
() {
25
return
SBAnyMap({
26
{ OBJECT_TYPE_FIELD_PROPERTIES,
27
SBAnyMap({
28
{
"numberOfInputs"
,
29
SBAnyMap({
30
{ PROPERTY_FIELD_TYPE, PROPERTY_TYPE_INT },
31
{ PROPERTY_FIELD_READ_ONLY,
true
},
32
{ PROPERTY_FIELD_DESCRIPTION,
"The number of inputs of the node."
},
33
}) },
34
{
"numberOfOutputs"
,
35
SBAnyMap({
36
{ PROPERTY_FIELD_TYPE, PROPERTY_TYPE_INT },
37
{ PROPERTY_FIELD_READ_ONLY,
true
},
38
{ PROPERTY_FIELD_DESCRIPTION,
"The number of outputs of the node."
},
39
}) },
40
{
"title"
,
41
SBAnyMap({
42
{ PROPERTY_FIELD_TYPE, PROPERTY_TYPE_STRING },
43
{ PROPERTY_FIELD_READ_ONLY,
false
},
44
{ PROPERTY_FIELD_DESCRIPTION,
"The title of the node."
},
45
{ PROPERTY_FIELD_DEFAULT_VALUE, std::string(
""
) },
46
}) },
47
}) },
48
});
49
}
50
57
Node
(uint
numberOfInputs
, uint
numberOfOutputs
);
58
66
std::string
getType
()
const
;
67
73
unsigned
int
getNumberOfInputs
()
const
;
74
80
unsigned
int
getNumberOfOutputs
()
const
;
81
82
// MARK: Overridden methods
83
84
Result<SBAny>
getValue
(
const
std::string &key)
override
;
85
Result<SBAny>
callAction
(
const
std::string& actionName,
const
SBAnyMap& params)
override
;
86
87
protected
:
89
unsigned
int
numberOfInputs
;
90
92
unsigned
int
numberOfOutputs
;
93
95
std::string
title
;
96
};
97
98
}
switchboard::Node::numberOfOutputs
unsigned int numberOfOutputs
The number of outputs (audio buses) for the node.
Definition
Node.hpp:92
switchboard::Node::numberOfInputs
unsigned int numberOfInputs
The number of inputs (audio buses) for the node.
Definition
Node.hpp:89
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:24
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:95
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.17.0