Merge branch 'qt5-vst-2-stable' into fix/qt5-vst
# Conflicts: # plugins/vst_base/RemoteVstPlugin.cpp # plugins/vst_base/VstPlugin.cpp
This commit is contained in:
@@ -28,6 +28,7 @@ SET(REMOTE_VST_PLUGIN_FILEPATH "RemoteVstPlugin" CACHE STRING "Relative file pat
|
||||
|
||||
ADD_DEFINITIONS(-DREMOTE_VST_PLUGIN_FILEPATH="${REMOTE_VST_PLUGIN_FILEPATH}")
|
||||
BUILD_PLUGIN(vstbase vst_base.cpp VstPlugin.cpp VstPlugin.h communication.h MOCFILES VstPlugin.h)
|
||||
TARGET_LINK_LIBRARIES(vstbase qx11embedcontainer)
|
||||
|
||||
IF(LMMS_BUILD_LINUX AND NOT WANT_VST_NOWINE)
|
||||
|
||||
|
||||
@@ -454,6 +454,15 @@ bool RemoteVstPlugin::processMessage( const message & _m )
|
||||
{
|
||||
switch( _m.id )
|
||||
{
|
||||
|
||||
#ifdef LMMS_EMBED_VST_X11
|
||||
case IdShowUI:
|
||||
ShowWindow( m_window, SW_SHOWNORMAL );
|
||||
UpdateWindow( m_window );
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifndef LMMS_EMBED_VST
|
||||
case IdShowUI:
|
||||
initEditor();
|
||||
break;
|
||||
@@ -477,6 +486,7 @@ bool RemoteVstPlugin::processMessage( const message & _m )
|
||||
sendMessage( message( IdIsUIVisible )
|
||||
.addInt( m_window ? 1 : 0 ) );
|
||||
break;
|
||||
#endif
|
||||
|
||||
case IdVstLoadPlugin:
|
||||
init( _m.getString() );
|
||||
@@ -667,7 +677,7 @@ void RemoteVstPlugin::initEditor()
|
||||
wc.hInstance = hInst;
|
||||
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
|
||||
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
wc.hbrBackground = (HBRUSH) GetStockObject( BLACK_BRUSH );
|
||||
wc.hbrBackground = NULL;
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = "LVSL";
|
||||
|
||||
@@ -705,7 +715,10 @@ void RemoteVstPlugin::initEditor()
|
||||
SWP_NOMOVE | SWP_NOZORDER );
|
||||
pluginDispatch( effEditTop );
|
||||
|
||||
#ifndef LMMS_EMBED_VST_X11
|
||||
ShowWindow( m_window, SW_SHOWNORMAL );
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_BUILD_LINUX
|
||||
m_windowID = (intptr_t) GetProp( m_window, "__wine_x11_whole_window" );
|
||||
#else
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <QX11EmbedContainer>
|
||||
#include <QX11Info>
|
||||
#else
|
||||
#include "X11EmbedContainer.h"
|
||||
#include <QWindow>
|
||||
#endif
|
||||
#else
|
||||
@@ -55,8 +56,7 @@
|
||||
#include "templates.h"
|
||||
#include "FileDialog.h"
|
||||
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
#ifdef LMMS_EMBED_VST
|
||||
class vstSubWin : public QMdiSubWindow
|
||||
{
|
||||
public:
|
||||
@@ -175,8 +175,6 @@ void VstPlugin::tryLoad( const QString &remoteVstPluginExecutable )
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef LMMS_EMBED_VST
|
||||
void VstPlugin::showEditor( QWidget * _parent, bool isEffect )
|
||||
{
|
||||
@@ -206,49 +204,47 @@ void VstPlugin::showEditor( QWidget * _parent, bool isEffect )
|
||||
return;
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
m_pluginWidget = new QWidget( _parent );
|
||||
m_pluginWidget->setFixedSize( m_pluginGeometry );
|
||||
m_pluginWidget->setWindowTitle( name() );
|
||||
if( _parent == NULL )
|
||||
{
|
||||
vstSubWin * sw = new vstSubWin(
|
||||
gui->mainWindow()->workspace() );
|
||||
if( isEffect )
|
||||
{
|
||||
sw->setAttribute( Qt::WA_TranslucentBackground );
|
||||
sw->setWindowFlags( Qt::FramelessWindowHint );
|
||||
sw->setWidget( m_pluginWidget );
|
||||
QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
|
||||
xe->embedClient( m_pluginWindowID );
|
||||
xe->setFixedSize( m_pluginGeometry );
|
||||
xe->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
sw->setWindowFlags( Qt::WindowCloseButtonHint );
|
||||
sw->setWidget( m_pluginWidget );
|
||||
vstSubWin * sw = new vstSubWin( gui->mainWindow()->workspace() );
|
||||
//auto sw = new SubWindow();
|
||||
|
||||
QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
|
||||
xe->embedClient( m_pluginWindowID );
|
||||
xe->setFixedSize( m_pluginGeometry );
|
||||
xe->move( 4, 24 );
|
||||
xe->show();
|
||||
}
|
||||
}
|
||||
#ifdef LMMS_EMBED_VST_X11
|
||||
QX11EmbedContainer * container = new QX11EmbedContainer( sw );
|
||||
connect(container, SIGNAL(clientIsEmbedded()), this, SLOT(showUI()));
|
||||
container->embedClient( m_pluginWindowID );
|
||||
#else
|
||||
QWindow * window = QWindow::fromWinId( m_pluginWindowID );
|
||||
m_pluginWidget = QWidget::createWindowContainer( window, _parent,
|
||||
Qt::Window );
|
||||
m_pluginWidget->setFixedSize( m_pluginGeometry );
|
||||
m_pluginWidget->setWindowTitle( name() );
|
||||
QWindow* vw = QWindow::fromWinId(m_pluginWindowID);
|
||||
QWidget* container = QWidget::createWindowContainer(vw, sw );
|
||||
// TODO: Synchronize show
|
||||
// Tell remote that it is embedded
|
||||
// Wait for remote reply
|
||||
#endif
|
||||
|
||||
container->setFixedSize( m_pluginGeometry );
|
||||
container->setWindowTitle( name() );
|
||||
|
||||
if( _parent == NULL )
|
||||
{
|
||||
m_pluginWidget = container;
|
||||
|
||||
sw->setWidget(container);
|
||||
|
||||
if( isEffect )
|
||||
{
|
||||
sw->setAttribute( Qt::WA_TranslucentBackground );
|
||||
sw->setWindowFlags( Qt::FramelessWindowHint );
|
||||
}
|
||||
else
|
||||
{
|
||||
sw->setWindowFlags( Qt::WindowCloseButtonHint );
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef LMMS_EMBED_VST_X11
|
||||
#endif
|
||||
container->setFixedSize( m_pluginGeometry );
|
||||
#endif
|
||||
|
||||
m_pluginWidget->show();
|
||||
//m_pluginWidget->show();
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +264,7 @@ void VstPlugin::hideEditor()
|
||||
|
||||
void VstPlugin::toggleEditor()
|
||||
{
|
||||
QWidget * w = m_pluginWidget;
|
||||
QWidget * w = pluginWidget();
|
||||
if( w )
|
||||
{
|
||||
w->setVisible( !w->isVisible() );
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
inline QWidget * pluginWidget( bool _top_widget = true )
|
||||
{
|
||||
#if QT_VERSION < 0x050000
|
||||
#ifdef LMMS_EMBED_VST
|
||||
if( _top_widget && m_pluginWidget )
|
||||
{
|
||||
if( m_pluginWidget->parentWidget() )
|
||||
|
||||
Reference in New Issue
Block a user