RavEngine
Loading...
Searching...
No Matches
wwise_room_effects_fx.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_WWISE_WWISE_ROOM_EFFECTS_FX_H_
18#define RESONANCE_AUDIO_PLATFORM_WWISE_WWISE_ROOM_EFFECTS_FX_H_
19
20#include "AK/SoundEngine/Common/AkTypes.h"
21#include "AK/SoundEngine/Common/IAkMixerPlugin.h"
22#include "AK/SoundEngine/Common/IAkPlugin.h"
23#include "api/resonance_audio_api.h"
24
25namespace vraudio {
26namespace wwise {
27
28class WwiseRoomEffectsFx : public AK::IAkMixerEffectPlugin {
29 public:
31
32 ~WwiseRoomEffectsFx() override = default;
33
34 // Initializes the effect plugin.
35 AKRESULT Init(AK::IAkPluginMemAlloc* memory_allocator,
36 AK::IAkMixerPluginContext* plugin_context,
37 AK::IAkPluginParam* plugin_params,
38 AkAudioFormat& audio_format) override;
39
40 // Terminates the effect plugin.
41 AKRESULT Term(AK::IAkPluginMemAlloc* memory_allocator) override;
42
43 // Resets the effect plugin.
44 AKRESULT Reset() override;
45
46 // Returns the plugin info.
47 AKRESULT GetPluginInfo(AkPluginInfo& plugin_info) override;
48
49 // Callback function for when an input gets connected to the mixer.
50 void OnInputConnected(AK::IAkMixerInputContext* input_context) override;
51
52 // Callback function for when an input gets disconnected from the mixer.
53 void OnInputDisconnected(AK::IAkMixerInputContext* input_context) override;
54
55 // Processes the next buffer of given input to fill the output mix buffer.
56 void ConsumeInput(AK::IAkMixerInputContext* input_context, AkRamp base_volume,
57 AkRamp emitter_listener_volume, AkAudioBuffer* input,
58 AkAudioBuffer* mix) override;
59
60 // Processes the accumulated output mix buffer *before* effects processing.
61 void OnMixDone(AkAudioBuffer* mix) override;
62
63 // Processes the accumulated output mix buffer *after* effects processing.
64 void OnEffectsProcessed(AkAudioBuffer* mix) override;
65
66 // Processes the accumulated output mix buffer *after* all processing
67 // including metering has been completed.
68 void OnFrameEnd(AkAudioBuffer* mix, AK::IAkMetering* metering) override;
69
70 private:
71 // Memory allocator interface.
72 AK::IAkPluginMemAlloc* memory_allocator_;
73
74 // Room effects mixer plugin context.
75 AK::IAkMixerPluginContext* plugin_context_;
76
77 // Current world transform of the listener.
78 AkTransform listener_transform_;
79
80 // Default room properties, which effectively disable the room effects.
81 const ReflectionProperties null_reflection_properties_;
82 const ReverbProperties null_reverb_properties_;
83
84 // Plugin instance id.
85 int instance_id_;
86};
87
88} // namespace wwise
89} // namespace vraudio
90
91#endif // RESONANCE_AUDIO_PLATFORM_WWISE_WWISE_ROOM_EFFECTS_FX_H_
Definition wwise_room_effects_fx.h:28
Definition resonance_audio_api.h:73
Definition resonance_audio_api.h:111