lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
ControllerConnection.h
Go to the documentation of this file.
1
/*
2
* ControllerConnection.h - declaration of a controller connect, which
3
* provides a definition of the link between a controller and
4
* model, also handles deferred creation of links while
5
* loading project
6
*
7
* Copyright (c) 2008 Paul Giblock <pgllama/at/gmail.com>
8
* Copyright (c) 2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
9
*
10
* This file is part of LMMS - https://lmms.io
11
*
12
* This program is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public
14
* License as published by the Free Software Foundation; either
15
* version 2 of the License, or (at your option) any later version.
16
*
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
* General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public
23
* License along with this program (see COPYING); if not, write to the
24
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25
* Boston, MA 02110-1301 USA.
26
*
27
*/
28
29
#ifndef LMMS_CONTROLLER_CONNECTION_H
30
#define LMMS_CONTROLLER_CONNECTION_H
31
32
#include <QObject>
33
34
#include "
Controller.h
"
35
#include "
JournallingObject.h
"
36
#include "
ValueBuffer.h
"
37
38
#include <vector>
39
40
namespace
lmms
41
{
42
43
class
ControllerConnection
;
44
45
namespace
gui
46
{
47
class
ControllerConnectionDialog
;
48
}
49
50
using
ControllerConnectionVector
= std::vector<ControllerConnection*>;
51
52
class
LMMS_EXPORT
ControllerConnection
:
public
QObject,
public
JournallingObject
53
{
54
Q_OBJECT
55
public
:
56
57
ControllerConnection
(
Controller
* _controller);
58
ControllerConnection
(
int
_controllerId );
59
60
~ControllerConnection
()
override
;
61
62
inline
Controller
*
getController
()
63
{
64
return
m_controller
;
65
}
66
67
void
setController(
Controller
* _controller );
68
69
inline
void
setController(
int
_controllerId );
70
71
float
currentValue
(
int
_offset )
72
{
73
return
m_controller
->currentValue( _offset );
74
}
75
76
ValueBuffer
*
valueBuffer
()
77
{
78
return
m_controller
->valueBuffer();
79
}
80
81
inline
void
setTargetName(
const
QString & _name );
82
83
inline
QString
targetName
()
const
84
{
85
return
m_targetName
;
86
}
87
88
inline
bool
isFinalized
()
89
{
90
return
m_controllerId
< 0;
91
}
92
93
static
void
finalizeConnections();
94
95
void
saveSettings( QDomDocument & _doc, QDomElement & _this )
override
;
96
void
loadSettings(
const
QDomElement & _this )
override
;
97
98
static
inline
const
QString
classNodeName
()
99
{
100
return
"connection"
;
101
}
102
103
QString
nodeName
()
const override
104
{
105
return
classNodeName
();
106
}
107
108
public
slots:
109
void
deleteConnection();
110
111
protected
:
112
//virtual controllerDialog * createDialog( QWidget * _parent );
113
Controller
*
m_controller
;
114
QString
m_targetName
;
115
int
m_controllerId
;
116
117
bool
m_ownsController
;
118
119
static
ControllerConnectionVector
s_connections
;
120
121
signals:
122
// The value changed while the audio engine isn't running (i.e: MIDI CC)
123
void
valueChanged
();
124
125
friend
class
gui::ControllerConnectionDialog
;
126
};
127
128
129
}
// namespace lmms
130
131
#endif
// LMMS_CONTROLLER_CONNECTION_H
Controller.h
JournallingObject.h
ValueBuffer.h
lmms::ControllerConnection
Definition
ControllerConnection.h:53
lmms::ControllerConnection::currentValue
float currentValue(int _offset)
Definition
ControllerConnection.h:71
lmms::ControllerConnection::nodeName
QString nodeName() const override
Definition
ControllerConnection.h:103
lmms::ControllerConnection::classNodeName
static const QString classNodeName()
Definition
ControllerConnection.h:98
lmms::ControllerConnection::valueChanged
void valueChanged()
lmms::ControllerConnection::valueBuffer
ValueBuffer * valueBuffer()
Definition
ControllerConnection.h:76
lmms::ControllerConnection::m_controllerId
int m_controllerId
Definition
ControllerConnection.h:115
lmms::ControllerConnection::s_connections
static ControllerConnectionVector s_connections
Definition
ControllerConnection.h:119
lmms::ControllerConnection::isFinalized
bool isFinalized()
Definition
ControllerConnection.h:88
lmms::ControllerConnection::m_ownsController
bool m_ownsController
Definition
ControllerConnection.h:117
lmms::ControllerConnection::ControllerConnection
ControllerConnection(Controller *_controller)
Definition
ControllerConnection.cpp:42
lmms::ControllerConnection::m_targetName
QString m_targetName
Definition
ControllerConnection.h:114
lmms::ControllerConnection::targetName
QString targetName() const
Definition
ControllerConnection.h:83
lmms::ControllerConnection::m_controller
Controller * m_controller
Definition
ControllerConnection.h:113
lmms::ControllerConnection::getController
Controller * getController()
Definition
ControllerConnection.h:62
lmms::Controller
Definition
Controller.h:51
lmms::JournallingObject::JournallingObject
JournallingObject()
Definition
JournallingObject.cpp:36
lmms::ValueBuffer
Definition
ValueBuffer.h:38
lmms::gui::ControllerConnectionDialog
Definition
ControllerConnectionDialog.h:58
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms
Definition
RemotePluginBase.cpp:34
lmms::ControllerConnectionVector
std::vector< ControllerConnection * > ControllerConnectionVector
Definition
ControllerConnection.h:50
Generated on
for lmms by
1.18.0