RavEngine
Loading...
Searching...
No Matches
binaural_renderer_vst.h
1/*
2Copyright 2018 Google Inc. All Rights Reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS-IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#ifndef RESONANCE_AUDIO_PLATFORM_VST_BINAURAL_RENDERER_VST_H_
18#define RESONANCE_AUDIO_PLATFORM_VST_BINAURAL_RENDERER_VST_H_
19
20#include <memory>
21
22#include "api/binaural_surround_renderer.h"
23#include "public.sdk/source/vst2.x/audioeffectx.h"
24#include "binaural_renderer_gui.h"
25
26class BinauralRendererVst : public AudioEffectX {
27 public:
28 explicit BinauralRendererVst(audioMasterCallback audioMaster);
29 ~BinauralRendererVst() override;
30
31 // Processing.
32 void processReplacing(float** inputs, float** outputs,
33 VstInt32 sampleFrames) override;
34
35 // Program.
36 void setProgramName(char* name) override;
37 void getProgramName(char* name) override;
38
39 bool getEffectName(char* name) override;
40 bool getVendorString(char* text) override;
41 bool getProductString(char* text) override;
42 VstInt32 getVendorVersion() override;
43
44 VstPlugCategory getPlugCategory() override { return kPlugCategEffect; }
45
46 protected:
47 // Creates |BinauralSurroundRenderer| instances.
48 bool initBinauralSurroundRenderer(VstInt32 framesPerBuffer,
49 VstInt32 numInputChannels,
50 int sampleRateHz);
51
52 // VST program name.
53 char programName[kVstMaxProgNameLen + 1];
54
55 // Buffer size |binauralSurroundRenderer_| has been initialized with.
56 VstInt32 framesPerBuffer_;
57
58 // Buffer size |binauralSurroundRenderer_| has been initialized with.
59 VstInt32 numInputChannels_;
60
61 // Sample rate |binauralSurroundRenderer_| has been initialized with.
62 int sampleRateHz_;
63
64 // |BinauralSurroundRenderer| instance.
65 std::unique_ptr<vraudio::BinauralSurroundRenderer> binauralSurroundRenderer_;
66};
67
68#endif // RESONANCE_AUDIO_PLATFORM_VST_BINAURAL_RENDERER_VST_H_
Definition binaural_renderer_vst.h:26