This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPluginProcessor.h
80 lines (72 loc) · 2.01 KB
/
PluginProcessor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*****************************************************************//**
* \file PluginProcessor.h
* \brief Directly Musical Data Access library for VST3 with JUCE.
*
* \author WuChang
* \email [email protected]
* \date Jan 2024
* \version 1.2.3
* \license MIT License
*********************************************************************/
#pragma once
#include <JuceHeader.h>
#include "Context.h"
#include "PluginExtensions.h"
namespace DMDA {
/**
* The base class of DMDA Plugin.
*
* Create your plugin processor class inherit from this class
* then override the createContext() method to create your DMDA context object
* like this:
*
* @code
* class MyPluginProcessor : public DMDA::PluginProcessor {
* // ...
* public:
* DMDA::Context* createContext() const override {
* return new DMDA::MidiFileContext;
* };
* // ...
* };
* @endcode
*
* And you should call initContext() method in your constructor to
* create the context.
*/
class DMDA_API PluginProcessor : public juce::AudioProcessor {
public:
PluginProcessor();
PluginProcessor(
const juce::AudioProcessor::BusesProperties& ioLayouts);
PluginProcessor(
const std::initializer_list<const short[2]>& channelLayoutList);
virtual ~PluginProcessor() override = default;
/**
* For internal use.
*/
juce::VST3ClientExtensions* getVST3ClientExtensions() override;
protected:
friend class Vst3Extensions;
/**
* Get the DMDA context pointer.
*/
Context* getContext() const;
/**
* Create the DMDA context object.
*
* @return The pointer of the DMDA context object.
* DMDA library will manage the object automatically.
*/
virtual Context* createContext() const;
/**
* Use this to init DMDA Context. You should call this in your
* constructor.
*/
void initContext();
private:
std::unique_ptr<Context> context = nullptr;
std::unique_ptr<Vst3Extensions> vst3Extensions = nullptr;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginProcessor)
};
}