JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
vstbus.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2// Project : VST SDK
3//
4// Category : Helpers
5// Filename : public.sdk/source/vst/vstbus.h
6// Created by : Steinberg, 03/2008
7// Description : VST Bus Implementation
8//
9//-----------------------------------------------------------------------------
10// LICENSE
11// (c) 2023, Steinberg Media Technologies GmbH, All Rights Reserved
12//-----------------------------------------------------------------------------
13// Redistribution and use in source and binary forms, with or without modification,
14// are permitted provided that the following conditions are met:
15//
16// * Redistributions of source code must retain the above copyright notice,
17// this list of conditions and the following disclaimer.
18// * Redistributions in binary form must reproduce the above copyright notice,
19// this list of conditions and the following disclaimer in the documentation
20// and/or other materials provided with the distribution.
21// * Neither the name of the Steinberg Media Technologies nor the names of its
22// contributors may be used to endorse or promote products derived from this
23// software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34// OF THE POSSIBILITY OF SUCH DAMAGE.
35//-----------------------------------------------------------------------------
36
37#pragma once
38
39#include "base/source/fobject.h"
42
43#include <string>
44#if SMTG_CPP_17
45#include <string_view>
46#endif
47#include <vector>
48
49//------------------------------------------------------------------------
50namespace Steinberg {
51namespace Vst {
52
53//------------------------------------------------------------------------
57class Bus: public FObject
58{
59public:
60//------------------------------------------------------------------------
62 Bus (const TChar* name, BusType busType, int32 flags);
63
65 TBool isActive () const { return active; }
66
68 void setActive (TBool state) { active = state; }
69
70#if SMTG_CPP_17
72 void setName (std::u16string_view newName) { name = newName; }
73#else
75 void setName (const std::u16string& newName) { name = newName; }
76#endif
77
79 void setBusType (BusType newBusType) { busType = newBusType; }
80
82 void setFlags (uint32 newFlags) { flags = newFlags; }
83
85 virtual bool getInfo (BusInfo&);
86
87 OBJ_METHODS (Vst::Bus, FObject)
88//------------------------------------------------------------------------
89protected:
92 int32 flags;
93 TBool active;
94};
95
96//------------------------------------------------------------------------
100class EventBus: public Bus
101{
102public:
103//------------------------------------------------------------------------
105 EventBus (const TChar* name, BusType busType, int32 flags, int32 channelCount);
106
107 //---from Bus-------
109 bool getInfo (BusInfo& info) SMTG_OVERRIDE;
110
111 OBJ_METHODS (Vst::EventBus, Vst::Bus);
112
113//------------------------------------------------------------------------
114protected:
115 int32 channelCount;
116};
117
118//------------------------------------------------------------------------
122class AudioBus: public Bus
123{
124public:
125//------------------------------------------------------------------------
127
129 SpeakerArrangement getArrangement () const { return speakerArr; }
130
132 void setArrangement (const SpeakerArrangement& arr) { speakerArr = arr; }
133
134 //---from Bus---------------------
136 bool getInfo (BusInfo& info) SMTG_OVERRIDE;
137
138 OBJ_METHODS (Vst::AudioBus, Vst::Bus)
139
140//------------------------------------------------------------------------
141protected:
142 SpeakerArrangement speakerArr;
143};
144
145//------------------------------------------------------------------------
149class BusList: public FObject, public std::vector<IPtr<Vst::Bus> >
150{
151public:
152//------------------------------------------------------------------------
154 BusList (MediaType type, BusDirection dir);
155
157 MediaType getType () const { return type; }
158
160 BusDirection getDirection () const { return direction; }
161
162 OBJ_METHODS (Vst::BusList, FObject);
163
164//------------------------------------------------------------------------
165protected:
166 MediaType type;
167 BusDirection direction;
168};
169
170//------------------------------------------------------------------------
171} // namespace Vst
172} // namespace Steinberg
Implements FUnknown and IDependent.
Definition fobject.h:84
Description of an Audio Bus.
Definition vstbus.h:123
void setArrangement(const SpeakerArrangement &arr)
Sets the speaker arrangement defining this Audio bus.
Definition vstbus.h:132
SpeakerArrangement getArrangement() const
Gets the speaker arrangement defining this Audio bus.
Definition vstbus.h:129
bool getInfo(BusInfo &info) SMTG_OVERRIDE
Gets the BusInfo associated to this Audio bus.
Definition vstbus.cpp:84
List of Busses.
Definition vstbus.h:150
BusDirection getDirection() const
Returns the BusList direction.
Definition vstbus.h:160
MediaType getType() const
Returns the BusList Type.
Definition vstbus.h:157
Basic Bus object.
Definition vstbus.h:58
std::u16string name
name
Definition vstbus.h:90
void setBusType(BusType newBusType)
Sets a new busType for this bus.
Definition vstbus.h:79
void setActive(TBool state)
Activates the bus.
Definition vstbus.h:68
int32 flags
flags, see BusInfo::BusFlags
Definition vstbus.h:92
BusType busType
kMain or kAux, see BusTypes
Definition vstbus.h:91
void setName(const std::u16string &newName)
Sets a new name for this bus.
Definition vstbus.h:75
TBool isActive() const
Returns true if the bus is active.
Definition vstbus.h:65
virtual bool getInfo(BusInfo &)
Gets the BusInfo of this bus.
Definition vstbus.cpp:51
void setFlags(uint32 newFlags)
Sets a new flags for this bus.
Definition vstbus.h:82
TBool active
activation state
Definition vstbus.h:93
Description of an Event Bus.
Definition vstbus.h:101
bool getInfo(BusInfo &info) SMTG_OVERRIDE
Gets the BusInfo associated to this Event bus.
Definition vstbus.cpp:69
Basic Object implementing FUnknown.
int32 BusType
bus type (main/aux)
Definition vsttypes.h:77
char16 TChar
UTF-16 character.
Definition vsttypes.h:68
int32 BusDirection
bus direction (in/out)
Definition vsttypes.h:76
uint64 SpeakerArrangement
Bitset of speakers.
Definition vsttypes.h:104
int32 MediaType
media type (audio/event)
Definition vsttypes.h:75
BusInfo: This is the structure used with getBusInfo, informing the host about what is a specific give...