Umsci
Upmix Spatial Control Interface — OCA/OCP.1 spatial audio utility
Loading...
Searching...
No Matches
MidiController.h
Go to the documentation of this file.
1/* Copyright (c) 2026, Christian Ahrens
2 *
3 * This file is part of Umsci <https://github.com/ChristianAhrens/Umsci>
4 *
5 * This tool is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License version 3.0 as published
7 * by the Free Software Foundation.
8 *
9 * This tool is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this tool; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#pragma once
20
21#include <JuceHeader.h>
22
23#include <MidiCommandRangeAssignment.h>
24
26
27
43class MidiController : public juce::MidiInputCallback
44{
45public:
47 ~MidiController() override;
48
49 //==============================================================================
52 void openDevice(const juce::String& deviceIdentifier);
53
55 const juce::String& getDeviceIdentifier() const { return m_deviceIdentifier; }
56
57 //==============================================================================
60 const JUCEAppBasics::MidiCommandRangeAssignment& assi);
61
63 const JUCEAppBasics::MidiCommandRangeAssignment& getAssignment(
65
66 //==============================================================================
71
72private:
73 //==============================================================================
75 void handleIncomingMidiMessage(juce::MidiInput* source,
76 const juce::MidiMessage& message) override;
77
78 //==============================================================================
79 std::unique_ptr<juce::MidiInput> m_midiInput;
80 juce::String m_deviceIdentifier;
81 std::array<JUCEAppBasics::MidiCommandRangeAssignment,
83
84 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MidiController)
85};
Owns the MIDI input device and maps learned MIDI messages to upmix parameter domain values.
void setAssignment(UmsciExternalControlComponent::UpmixMidiParam param, const JUCEAppBasics::MidiCommandRangeAssignment &assi)
void openDevice(const juce::String &deviceIdentifier)
std::function< void(UmsciExternalControlComponent::UpmixMidiParam, float)> onParamValueChanged
const juce::String & getDeviceIdentifier() const
const JUCEAppBasics::MidiCommandRangeAssignment & getAssignment(UmsciExternalControlComponent::UpmixMidiParam param) const
~MidiController() override
UpmixMidiParam
Identifies each controllable upmix transform parameter.