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.cpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2// Project : VST SDK
3//
4// Category : Helpers
5// Filename : public.sdk/source/vst/vstbus.cpp
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#include "vstbus.h"
38
39namespace Steinberg {
40namespace Vst {
41
42//------------------------------------------------------------------------
43// Bus Implementation
44//------------------------------------------------------------------------
45Bus::Bus (const TChar* _name, BusType _busType, int32 _flags)
46: name (_name), busType (_busType), flags (_flags), active (false)
47{
48}
49
50//------------------------------------------------------------------------
52{
53 memset (info.name, 0, sizeof (String128));
54 name.copy (info.name, 128);
55 info.busType = busType;
56 info.flags = flags;
57 return true;
58}
59
60//------------------------------------------------------------------------
61// EventBus Implementation
62//------------------------------------------------------------------------
63EventBus::EventBus (const TChar* name, BusType busType, int32 flags, int32 channelCount)
64: Bus (name, busType, flags), channelCount (channelCount)
65{
66}
67
68//------------------------------------------------------------------------
70{
71 info.channelCount = channelCount;
72 return Bus::getInfo (info);
73}
74
75//------------------------------------------------------------------------
76// AudioBus Implementation
77//------------------------------------------------------------------------
78AudioBus::AudioBus (const TChar* name, BusType busType, int32 flags, SpeakerArrangement arr)
79: Bus (name, busType, flags), speakerArr (arr)
80{
81}
82
83//------------------------------------------------------------------------
85{
86 info.channelCount = SpeakerArr::getChannelCount (speakerArr);
87 return Bus::getInfo (info);
88}
89
90//------------------------------------------------------------------------
91// BusList Implementation
92//------------------------------------------------------------------------
93BusList::BusList (MediaType type, BusDirection dir) : type (type), direction (dir)
94{
95}
96
97//------------------------------------------------------------------------
98} // namespace Vst
99} // namespace Steinberg
bool getInfo(BusInfo &info) SMTG_OVERRIDE
Gets the BusInfo associated to this Audio bus.
Definition vstbus.cpp:84
BusList(MediaType type, BusDirection dir)
Constructor.
Definition vstbus.cpp:93
Basic Bus object.
Definition vstbus.h:58
std::u16string name
name
Definition vstbus.h:90
Bus(const TChar *name, BusType busType, int32 flags)
Constructor.
Definition vstbus.cpp:45
int32 flags
flags, see BusInfo::BusFlags
Definition vstbus.h:92
BusType busType
kMain or kAux, see BusTypes
Definition vstbus.h:91
virtual bool getInfo(BusInfo &)
Gets the BusInfo of this bus.
Definition vstbus.cpp:51
bool getInfo(BusInfo &info) SMTG_OVERRIDE
Gets the BusInfo associated to this Event bus.
Definition vstbus.cpp:69
EventBus(const TChar *name, BusType busType, int32 flags, int32 channelCount)
Constructor of an EventBus.
Definition vstbus.cpp:63
T copy(T... args)
int32 getChannelCount(SpeakerArrangement arr)
Returns number of channels used in speaker arrangement.
Definition vstspeaker.h:630
memset
int32 BusType
bus type (main/aux)
Definition vsttypes.h:77
TChar String128[128]
128 character UTF-16 string
Definition vsttypes.h:69
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...
int32 channelCount
number of channels (if used then need to be recheck after IAudioProcessor::setBusArrangements is call...
BusType busType
main or aux - has to be a value of BusTypes
uint32 flags
flags - a combination of BusFlags
String128 name
name of the bus