hydrogen 1.2.3
AlsaMidiDriver.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-2024 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 ALSA_MIDI_DRIVER_H
24#define ALSA_MIDI_DRIVER_H
25
26#include <core/IO/MidiInput.h>
27#include <core/IO/MidiOutput.h>
28
29#if defined(H2CORE_HAVE_ALSA) || _DOXYGEN_
30
31#include <alsa/asoundlib.h>
32#include <string>
33#include <vector>
34
35namespace H2Core
36{
37
42
43class AlsaMidiDriver : public Object<AlsaMidiDriver>, public virtual MidiInput, public virtual MidiOutput
44{
46public:
48 virtual ~AlsaMidiDriver();
49
50 virtual void open() override;
51 virtual void close() override;
52 virtual std::vector<QString> getInputPortList() override;
53 virtual std::vector<QString> getOutputPortList() override;
54
55 void midi_action( snd_seq_t *seq_handle );
56 void getPortInfo( const QString& sPortName, int& nClient, int& nPort );
57 virtual void handleQueueNote(Note* pNote) override;
58
59 virtual void handleQueueNoteOff( int channel, int key, int velocity ) override;
60 virtual void handleQueueAllNoteOff() override;
61 virtual void handleOutgoingControlChange( int param, int value, int channel ) override;
62
63private:
64};
65
66};
67
68#endif // H2CORE_HAVE_ALSA
69
70#endif
#define H2_OBJECT(name)
Definition Object.h:224
Alsa Midi Driver Based on Matthias Nagorni alsa sequencer example.
void getPortInfo(const QString &sPortName, int &nClient, int &nPort)
virtual void open() override
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
void midi_action(snd_seq_t *seq_handle)
virtual void handleOutgoingControlChange(int param, int value, int channel) override
virtual void handleQueueNote(Note *pNote) override
MIDI input base class.
Definition MidiInput.h:39
MIDI input base class.
Definition MidiOutput.h:41
A note plays an associated instrument with a velocity left and right pan.
Definition Note.h:102
snd_seq_t * seq_handle