hydrogen 1.2.6
CoreMidiDriver.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2025 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * CoreMidi driver for Hydrogen
9 * Copyright(c) 2005-2006 by Jonathan Dempsey
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY, without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see https://www.gnu.org/licenses
23 *
24 * Some cleanup . . . (20060222 Jonathan Dempsey)
25 * Removed some unused code (20060514 Jonathan Dempsey)
26 */
27
28#ifndef CORE_MIDI_DRIVER_H
29#define CORE_MIDI_DRIVER_H
30
31#include <core/IO/MidiInput.h>
32#include <core/IO/MidiOutput.h>
33
34#if defined(H2CORE_HAVE_COREMIDI) || _DOXYGEN_
35
36#include <CoreMIDI/CoreMIDI.h>
37
38namespace H2Core
39{
40
42class CoreMidiDriver : public Object<CoreMidiDriver>, public virtual MidiInput, public virtual MidiOutput
43{
45public:
48
50
51 virtual void open() override;
52 virtual void close() override;
53 virtual std::vector<QString> getInputPortList() override;
54 virtual std::vector<QString> getOutputPortList() override;
55
56 virtual void handleQueueNote(Note* pNote) override;
57 virtual void handleQueueNoteOff( int channel, int key, int velocity ) override;
58 virtual void handleQueueAllNoteOff() override;
59 virtual void handleOutgoingControlChange( int param, int value, int channel ) override;
60
61 MIDIClientRef h2MIDIClient;
62 ItemCount cmSources;
63 MIDIEndpointRef cmH2Src;
64
65 MIDIPortRef h2InputRef;
66 MIDIPortRef h2OutputRef;
67 MIDIEndpointRef cmH2Dst;
68
69 MIDIEndpointRef h2VirtualOut;
70
71private:
72 void sendMidiPacket (MIDIPacketList *packetList);
73};
74
75}
76; // namespace
77
78#endif // H2CORE_HAVE_COREMIDI
79
80
81#endif
82
#define H2_OBJECT(name)
Definition Object.h:227
MIDIClientRef h2MIDIClient
virtual void open() override
MIDIEndpointRef h2VirtualOut
MIDIEndpointRef cmH2Dst
virtual std::vector< QString > getInputPortList() override
virtual void close() override
virtual void handleQueueNoteOff(int channel, int key, int velocity) override
virtual std::vector< QString > getOutputPortList() override
virtual void handleQueueAllNoteOff() override
virtual void handleOutgoingControlChange(int param, int value, int channel) override
void sendMidiPacket(MIDIPacketList *packetList)
MIDIEndpointRef cmH2Src
virtual void handleQueueNote(Note *pNote) override
A note plays an associated instrument with a velocity left and right pan.
Definition Note.h:101