tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_MidiPatchBay.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
15{
16public:
18 ~MidiPatchBayPlugin() override;
19
20 static const char* getPluginName() { return NEEDS_TRANS("MIDI Patch Bay"); }
21 static juce::ValueTree create();
22
23 //==============================================================================
24 static const char* xmlTypeName;
25
26 juce::String getName() const override { return TRANS("Patch Bay Plugin"); }
27 juce::String getPluginType() override { return xmlTypeName; }
28 juce::String getShortName (int) override { return TRANS("MIDIPatch"); }
29 bool canBeAddedToClip() override { return false; }
30 bool canBeAddedToRack() override { return true; }
31 bool needsConstantBufferSize() override { return false; }
32 void initialise (const PluginInitialisationInfo&) override;
33 void deinitialise() override;
34 void applyToBuffer (const PluginRenderContext&) override;
35 juce::String getSelectableDescription() override { return TRANS("MIDI Patch Bay Plugin"); }
36 bool takesAudioInput() override { return false; }
37 int getNumOutputChannelsGivenInputs (int) override { return 0; }
38 void getChannelNames (juce::StringArray*, juce::StringArray*) override {}
39
40 //==============================================================================
41 struct Mappings
42 {
43 char map[17] = {};
44 };
45
46 Mappings getMappings() const;
47 void setMappings (const Mappings&);
48
49 void resetMappings();
50 void makeConnection (int srcChannel, int dstChannel);
51 void sanityCheckMappings();
52 void blockAllMappings();
53 std::pair<int, int> getFirstMapping();
54
55private:
56 //==============================================================================
57 enum { blockChannel = 0 };
58
59 juce::CriticalSection mappingsLock;
60 Mappings currentMappings;
61
62 void valueTreeChanged() override;
63
65};
66
67}} // namespace tracktion { inline namespace engine
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
void deinitialise() override
Called after play stops to release resources.
juce::String getName() const override
The name of the type, e.g.
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
void initialise(const PluginInitialisationInfo &) override
Gives the plugin a chance to set itself up before being played.
int getNumOutputChannelsGivenInputs(int) override
This must return the number of output channels that the plugin will produce, given a number of input ...
#define TRANS(stringLiteral)
#define NEEDS_TRANS(stringLiteral)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)