mirror of
https://github.com/LMMS/lmms.git
synced 2026-02-19 07:34:50 -05:00
* Update ringbuffer submodule to fix includes
* Remove cyclic includes
* Remove Qt include prefixes
* Include C++ versions of C headers
E.g.: assert.h -> cassert
* Move CLIP_BORDER_WIDTH into ClipView
This allows to remove includes to TrackView.h in ClipView cpp files.
* Elliminate useless includes
This improves the include structure by elliminating includes that are
not used. Most of this was done by using `include-what-you-use` with
`CMAKE_C_INCLUDE_WHAT_YOU_USE` and `CMAKE_CXX_INCLUDE_WHAT_YOU_USE`
set to (broken down here):
```
include-what-you-use;
-Xiwyu;--mapping_file=/usr/share/include-what-you-use/qt5_11.imp;
-Xiwyu;--keep=*/xmmintrin.h;
-Xiwyu;--keep=*/lmmsconfig.h;
-Xiwyu;--keep=*/weak_libjack.h;
-Xiwyu;--keep=*/sys/*;
-Xiwyu;--keep=*/debug.h;
-Xiwyu;--keep=*/SDL/*;
-Xiwyu;--keep=*/alsa/*;
-Xiwyu;--keep=*/FL/x.h;
-Xiwyu;--keep=*/MidiApple.h;
-Xiwyu;--keep=*/MidiWinMM.h;
-Xiwyu;--keep=*/AudioSoundIo.h
```
* Fixup: Remove empty #if-#ifdef pairs
* Remove LMMS_HAVE_STD(LIB|INT)_H
123 lines
2.9 KiB
C++
123 lines
2.9 KiB
C++
/*
|
|
* ControllerConnection.h - declaration of a controller connect, which
|
|
* provides a definition of the link between a controller and
|
|
* model, also handles deferred creation of links while
|
|
* loading project
|
|
*
|
|
* Copyright (c) 2008 Paul Giblock <pgllama/at/gmail.com>
|
|
* Copyright (c) 2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
|
*
|
|
* This file is part of LMMS - https://lmms.io
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public
|
|
* License along with this program (see COPYING); if not, write to the
|
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301 USA.
|
|
*
|
|
*/
|
|
|
|
|
|
#ifndef CONTROLLER_CONNECTION_H
|
|
#define CONTROLLER_CONNECTION_H
|
|
|
|
#include <QObject>
|
|
#include <QVector>
|
|
|
|
#include "Controller.h"
|
|
#include "JournallingObject.h"
|
|
#include "ValueBuffer.h"
|
|
|
|
class ControllerConnection;
|
|
|
|
typedef QVector<ControllerConnection *> ControllerConnectionVector;
|
|
|
|
|
|
class LMMS_EXPORT ControllerConnection : public QObject, public JournallingObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
|
|
ControllerConnection(Controller * _controller);
|
|
ControllerConnection( int _controllerId );
|
|
|
|
virtual ~ControllerConnection();
|
|
|
|
inline Controller * getController()
|
|
{
|
|
return m_controller;
|
|
}
|
|
|
|
void setController( Controller * _controller );
|
|
|
|
inline void setController( int _controllerId );
|
|
|
|
float currentValue( int _offset )
|
|
{
|
|
return m_controller->currentValue( _offset );
|
|
}
|
|
|
|
ValueBuffer * valueBuffer()
|
|
{
|
|
return m_controller->valueBuffer();
|
|
}
|
|
|
|
inline void setTargetName( const QString & _name );
|
|
|
|
inline QString targetName() const
|
|
{
|
|
return m_targetName;
|
|
}
|
|
|
|
inline bool isFinalized()
|
|
{
|
|
return m_controllerId < 0;
|
|
}
|
|
|
|
static void finalizeConnections();
|
|
|
|
void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
|
|
void loadSettings( const QDomElement & _this ) override;
|
|
|
|
static inline const QString classNodeName()
|
|
{
|
|
return "connection";
|
|
}
|
|
|
|
QString nodeName() const override
|
|
{
|
|
return classNodeName();
|
|
}
|
|
|
|
public slots:
|
|
void deleteConnection();
|
|
|
|
protected:
|
|
//virtual controllerDialog * createDialog( QWidget * _parent );
|
|
Controller * m_controller;
|
|
QString m_targetName;
|
|
int m_controllerId;
|
|
|
|
bool m_ownsController;
|
|
|
|
static ControllerConnectionVector s_connections;
|
|
|
|
signals:
|
|
// The value changed while the audio engine isn't running (i.e: MIDI CC)
|
|
void valueChanged();
|
|
|
|
friend class ControllerConnectionDialog;
|
|
};
|
|
|
|
#endif
|
|
|