LMMS
Loading...
Searching...
No Matches
MidiAlsaRaw.h
Go to the documentation of this file.
1/*
2 * MidiAlsaRaw.h - MIDI client for RawMIDI via ALSA
3 *
4 * Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (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 GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_MIDI_ALSA_RAW_H
26#define LMMS_MIDI_ALSA_RAW_H
27
28#include "lmmsconfig.h"
29
30#ifdef LMMS_HAVE_ALSA
31
32#include <alsa/asoundlib.h>
33
34#include <QThread>
35
36#include "MidiClient.h"
37
38
39struct pollfd;
40
41
42namespace lmms
43{
44
45class MidiAlsaRaw : public QThread, public MidiClientRaw
46{
47 Q_OBJECT
48public:
50 ~MidiAlsaRaw() override;
51
52 static QString probeDevice();
53
54
55 inline static QString name()
56 {
57 return QT_TRANSLATE_NOOP( "MidiSetupWidget",
58 "ALSA Raw-MIDI (Advanced Linux Sound Architecture)" );
59 }
60
61 inline static QString configSection()
62 {
63 return "MidiAlsaRaw";
64 }
65
66
67protected:
68 void sendByte( const unsigned char c ) override;
69 void run() override;
70
71
72private:
73 snd_rawmidi_t * m_input, * * m_inputp;
74 snd_rawmidi_t * m_output, * * m_outputp;
76 pollfd * m_pfds;
77
78 volatile bool m_quit;
79
80} ;
81
82
83} // namespace lmms
84
85#endif // LMMS_HAVE_ALSA
86
87#endif // LMMS_MIDI_ALSA_RAW_H
static QString name()
Definition MidiAlsaRaw.h:55
snd_rawmidi_t ** m_outputp
Definition MidiAlsaRaw.h:74
static QString probeDevice()
Definition MidiAlsaRaw.cpp:78
void sendByte(const unsigned char c) override
Definition MidiAlsaRaw.cpp:95
~MidiAlsaRaw() override
Definition MidiAlsaRaw.cpp:61
snd_rawmidi_t ** m_inputp
Definition MidiAlsaRaw.h:73
snd_rawmidi_t * m_input
Definition MidiAlsaRaw.h:73
pollfd * m_pfds
Definition MidiAlsaRaw.h:76
static QString configSection()
Definition MidiAlsaRaw.h:61
int m_npfds
Definition MidiAlsaRaw.h:75
void run() override
Definition MidiAlsaRaw.cpp:103
volatile bool m_quit
Definition MidiAlsaRaw.h:78
snd_rawmidi_t * m_output
Definition MidiAlsaRaw.h:74
MidiAlsaRaw()
Definition MidiAlsaRaw.cpp:36
MidiClientRaw()=default
Definition AudioAlsa.cpp:35
return c
Definition crypt.c:175