hydrogen 1.2.6
PortMidiDriver.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 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#ifndef PORT_MIDI_DRIVER_H
24#define PORT_MIDI_DRIVER_H
25
26#include <core/IO/MidiInput.h>
27#include <core/IO/MidiOutput.h>
28
29#if defined(H2CORE_HAVE_PORTMIDI) || _DOXYGEN_
30#include <portmidi.h>
31
32namespace H2Core
33{
34
36class PortMidiDriver : public Object<PortMidiDriver>, public virtual MidiInput, public virtual MidiOutput
37{
39public:
40 PmStream *m_pMidiIn;
41 PmStream *m_pMidiOut;
43
45 virtual ~PortMidiDriver();
46
47 virtual void open() override;
48 virtual void close() override;
49 virtual std::vector<QString> getInputPortList() override;
50 virtual std::vector<QString> getOutputPortList() override;
51
52 virtual void handleQueueNote(Note* pNote) override;
53 virtual void handleQueueNoteOff( int channel, int key, int velocity ) override;
54 virtual void handleQueueAllNoteOff() override;
55 virtual void handleOutgoingControlChange( int param, int value, int channel ) override;
56
57 static QString translatePmError( PmError err );
67 static bool appendSysExData( MidiMessage* pMidiMessage, PmMessage msg );
68
69private:
70
71};
72
73};
74
75#endif
76
77#endif
78
#define H2_OBJECT(name)
Definition Object.h:227
A note plays an associated instrument with a velocity left and right pan.
Definition Note.h:101
static bool appendSysExData(MidiMessage *pMidiMessage, PmMessage msg)
Appends the content of msg to MidiMessage::m_sysexData of pMidiMessage till 247 (EOX - end of exclusi...
virtual void open() override
static QString translatePmError(PmError err)
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
virtual void handleQueueNote(Note *pNote) override