Files
lmms/plugins/vst_base/VstPlugin.h
Tobias Doerffel 4cee046909 Added initial Qt5 support
LMMS now properly builds and runs with Qt5. Various deprecated functions
had to be replaced like QString::toAscii()/fromAscii(). Also occurences
of FALSE/TRUE have been replaced with false/true.

LmmsStyle now derives from QProxyStyle and sets a style instance as base
style (Plastique for Qt4, Fusion for Qt5).

MOC files are not included anymore but added as regular source files.

What's missing is support for embedding VST plugins into a subwindow
inside LMMS on Linux/X11 due to missing QX11EmbedContainer class in Qt5.

Build instructions can be found in INSTALL.Qt5

Minimum version requirement for Qt4 has been raised to 4.6.0 for best
API compatibility between Qt4 and Qt5.
2014-08-14 17:34:49 +02:00

159 lines
3.3 KiB
C++

/*
* VstPlugin.h - declaration of VstPlugin class
*
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 _VST_PLUGIN_H
#define _VST_PLUGIN_H
#include <QMap>
#include <QMutex>
#include <QPointer>
#include <QString>
#include <QTimer>
#include <QWidget>
#include "Mixer.h"
#include "JournallingObject.h"
#include "communication.h"
class PLUGIN_EXPORT VstPlugin : public QObject, public JournallingObject,
public RemotePlugin
{
Q_OBJECT
public:
VstPlugin( const QString & _plugin );
virtual ~VstPlugin();
void tryLoad( const QString &remoteVstPluginExecutable );
virtual bool processMessage( const message & _m );
inline bool hasEditor() const
{
return m_pluginWindowID != 0;
}
void showEditor( QWidget * _parent = NULL, bool isEffect = false );
void hideEditor();
inline const QString & name() const
{
return m_name;
}
inline int version() const
{
return m_version;
}
inline const QString & vendorString() const
{
return m_vendorString;
}
inline const QString & productString() const
{
return m_productString;
}
inline const QString& currentProgramName() const
{
return m_currentProgramName;
}
inline const QString& allProgramNames() const
{
return m_allProgramNames;
}
int currentProgram();
const QMap<QString, QString> & parameterDump();
void setParameterDump( const QMap<QString, QString> & _pdump );
inline QWidget * pluginWidget( bool _top_widget = true )
{
if( _top_widget && m_pluginWidget )
{
if( m_pluginWidget->parentWidget() )
{
return m_pluginWidget->parentWidget();
}
}
return m_pluginWidget;
}
virtual void loadSettings( const QDomElement & _this );
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
inline virtual QString nodeName() const
{
return "vstplugin";
}
public slots:
void setTempo( bpm_t _bpm );
void updateSampleRate();
void openPreset( void );
void setProgram( int index );
void rotateProgram( int offset );
void loadProgramNames();
void savePreset( void );
void setParam( int i, float f );
void idleUpdate();
private:
void loadChunk( const QByteArray & _chunk );
QByteArray saveChunk();
QString m_plugin;
QPointer<QWidget> m_pluginWidget;
int m_pluginWindowID;
QSize m_pluginGeometry;
bool m_badDllFormat;
QString m_name;
int m_version;
QString m_vendorString;
QString m_productString;
QString m_currentProgramName;
QString m_allProgramNames;
QString p_name;
QMap<QString, QString> m_parameterDump;
int m_currentProgram;
QTimer m_idleTimer;
} ;
#endif