OpenShot Audio Library | OpenShotAudio 0.3.2
Loading...
Searching...
No Matches
juce_MidiRPN.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2017 - ROLI Ltd.
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
33{
36
39
44 int value;
45
47 bool isNRPN;
48
53};
54
55//==============================================================================
67class JUCE_API MidiRPNDetector
68{
69public:
71 MidiRPNDetector() noexcept;
72
74 ~MidiRPNDetector() noexcept;
75
79 void reset() noexcept;
80
81 //==============================================================================
89 bool parseControllerMessage (int midiChannel,
92 MidiRPNMessage& result) noexcept;
93
94private:
95 //==============================================================================
96 struct ChannelState
97 {
98 ChannelState() noexcept;
99 bool handleController (int channel, int controllerNumber,
100 int value, MidiRPNMessage&) noexcept;
101 void resetValue() noexcept;
102 bool sendIfReady (int channel, MidiRPNMessage&) noexcept;
103
104 uint8 parameterMSB, parameterLSB, valueMSB, valueLSB;
105 bool isNRPN;
106 };
107
108 //==============================================================================
109 ChannelState states[16];
110
111 JUCE_LEAK_DETECTOR (MidiRPNDetector)
112};
113
114//==============================================================================
123class JUCE_API MidiRPNGenerator
124{
125public:
126 //==============================================================================
128 static MidiBuffer generate (MidiRPNMessage message);
129
130 //==============================================================================
147 static MidiBuffer generate (int channel,
148 int parameterNumber,
149 int value,
150 bool isNRPN = false,
151 bool use14BitValue = true);
152};
153
154} // namespace juce