1 #pragma once
2 #include "util/memory.h"
3 #include "engine/channelhandle.h"
4 #include <array>
5 #include <QSharedPointer>
6
7 enum class EffectEnableState {
8 Disabled,
9 Enabled,
10 Disabling,
11 Enabling
12 };
13
14 enum class EffectBackendType {
15 BuiltIn,
16 LV2,
17 Unknown
18 };
19
20 enum class SignalProcessingStage {
21 Prefader,
22 Postfader
23 };
24
qHash(SignalProcessingStage stage)25 inline uint qHash(SignalProcessingStage stage) {
26 return static_cast<uint>(stage);
27 };
28
29 enum class EffectChainMixMode {
30 DrySlashWet = 0, // Crossfade between dry and wet
31 DryPlusWet, // Add wet to dry
32 NumMixModes // The number of mix modes. Also used to represent "unknown".
33 };
34
35 constexpr int kNumEffectsPerUnit = 4;
36
37 // NOTE: Setting this to true will enable string manipulation and calls to
38 // qDebug() in the audio engine thread. That may cause audio dropouts, so only
39 // enable this when debugging the effects system.
40 constexpr bool kEffectDebugOutput = false;
41
42 class EffectState;
43 // For sending EffectStates along the MessagePipe
44 typedef ChannelHandleMap<EffectState*> EffectStatesMap;
45 typedef std::array<EffectStatesMap, kNumEffectsPerUnit> EffectStatesMapArray;
46
47 class EffectRack;
48 typedef QSharedPointer<EffectRack> EffectRackPointer;
49
50 class StandardEffectRack;
51 typedef QSharedPointer<StandardEffectRack> StandardEffectRackPointer;
52
53 class EqualizerRack;
54 typedef QSharedPointer<EqualizerRack> EqualizerRackPointer;
55
56 class QuickEffectRack;
57 typedef QSharedPointer<QuickEffectRack> QuickEffectRackPointer;
58
59 class OutputEffectRack;
60 typedef QSharedPointer<OutputEffectRack> OutputEffectRackPointer;
61
62 class EffectSlot;
63 typedef QSharedPointer<EffectSlot> EffectSlotPointer;
64
65 class EffectParameterSlot;
66 typedef QSharedPointer<EffectParameterSlot> EffectParameterSlotPointer;
67
68 class EffectButtonParameterSlot;
69 typedef QSharedPointer<EffectButtonParameterSlot> EffectButtonParameterSlotPointer;
70
71 class EffectManifest;
72 typedef QSharedPointer<EffectManifest> EffectManifestPointer;
73
74 class Effect;
75 typedef QSharedPointer<Effect> EffectPointer;
76
77 class EffectParameterSlotBase;
78 typedef QSharedPointer<EffectParameterSlotBase> EffectParameterSlotBasePointer;
79
80 class EffectChainSlot;
81 typedef QSharedPointer<EffectChainSlot> EffectChainSlotPointer;
82