LMMS
Loading...
Searching...
No Matches
MidiController.h
Go to the documentation of this file.
1/*
2 * MidiController.h - A controller to receive MIDI control-changes
3 *
4 * Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
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_CONTROLLER_H
26#define LMMS_MIDI_CONTROLLER_H
27
28#include <QWidget>
29
30#include "AutomatableModel.h"
31#include "Controller.h"
32#include "MidiEventProcessor.h"
33#include "MidiPort.h"
34
35
36namespace lmms
37{
38
39class MidiPort;
40
41namespace gui
42{
44}
45
46
48{
49 Q_OBJECT
50public:
51 static constexpr int NONE = -1;
52 MidiController( Model * _parent );
53 ~MidiController() override = default;
54
55 void processInEvent( const MidiEvent & _me,
56 const TimePos & _time, f_cnt_t offset = 0 ) override;
57
58 void processOutEvent( const MidiEvent& _me,
59 const TimePos & _time, f_cnt_t offset = 0 ) override
60 {
61 // No output yet
62 }
63
64 void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
65 void loadSettings( const QDomElement & _this ) override;
66 QString nodeName() const override;
67
68 // Used by controllerConnectionDialog to copy
69 void subscribeReadablePorts( const MidiPort::Map & _map );
70
71
72public slots:
73 gui::ControllerDialog* createDialog( QWidget * _parent ) override;
74 void updateName();
75
76
77protected:
78 // The internal per-controller get-value function
79 void updateValueBuffer() override;
80
81
83
84
87
90
91} ;
92
93
94} // namespace lmms
95
96#endif // LMMS_MIDI_CONTROLLER_H
Controller(ControllerType _type, Model *_parent, const QString &_display_name)
Definition Controller.cpp:47
QString nodeName() const override
Definition MidiController.cpp:135
void processOutEvent(const MidiEvent &_me, const TimePos &_time, f_cnt_t offset=0) override
Definition MidiController.h:58
MidiPort m_midiPort
Definition MidiController.h:82
static constexpr int NONE
Definition MidiController.h:51
void loadSettings(const QDomElement &_this) override
Definition MidiController.cpp:123
friend class AutoDetectMidiController
Definition MidiController.h:89
~MidiController() override=default
void updateName()
Definition MidiController.cpp:64
void processInEvent(const MidiEvent &_me, const TimePos &_time, f_cnt_t offset=0) override
Definition MidiController.cpp:74
void updateValueBuffer() override
Definition MidiController.cpp:49
gui::ControllerDialog * createDialog(QWidget *_parent) override
Definition MidiController.cpp:143
void subscribeReadablePorts(const MidiPort::Map &_map)
Definition MidiController.cpp:101
float m_lastValue
Definition MidiController.h:85
MidiController(Model *_parent)
Definition MidiController.cpp:34
float m_previousValue
Definition MidiController.h:86
void saveSettings(QDomDocument &_doc, QDomElement &_this) override
Definition MidiController.cpp:113
Definition MidiEvent.h:37
Definition MidiPort.h:56
QMap< QString, bool > Map
Definition MidiPort.h:70
Definition Model.h:37
Definition TimePos.h:68
Definition ControllerConnectionDialog.h:58
Definition ControllerDialog.h:42
Definition AudioPortAudio.cpp:223
Definition AudioAlsa.cpp:35
std::uint64_t f_cnt_t
Definition LmmsTypes.h:43