Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a81f4ca
Embed VST GUI in subwindow
Jun 17, 2016
878dd94
Embed in a separate window
Oct 2, 2016
ebe63d1
Fixes for Windows builds
Jan 2, 2017
6395cd4
Enable C++11
Jan 3, 2017
e3d3052
Enable C++11 on Windows
Jan 4, 2017
12f6ea5
C++11 is enabled by default now
Jan 24, 2017
f87f363
Use window instead of embedder application
Mar 31, 2017
2d35de4
Debug window ID
Apr 1, 2017
d04fd9f
FluidSynth is currently undistributable
Apr 10, 2017
7a9396d
Let Wine handle the window interface
Apr 10, 2017
47d0e66
Re-enable SF2
tresf Apr 10, 2017
e661d26
Add X11EmbedContainer Qt5 port
lukas-w Apr 1, 2017
adef05f
X11EmbedContainer: Fix XEMBED protocol implementation
lukas-w Apr 8, 2017
f097be6
RemoteVst: Fix flickering when moving window
lukas-w Apr 8, 2017
0e311ff
X11Embed: Remove flag causing embedding to fail
lukas-w Apr 8, 2017
8fdcc6c
Fix compile on Windows
lukas-w Apr 8, 2017
7ce60c2
Travis: Add missing packages
lukas-w Apr 8, 2017
dc4a387
X11EmbedContainer: Don't grab mouse in acceptClient, more debugging msgs
lukas-w Jul 15, 2017
000fe2d
Travis: Fix xcb package name
lukas-w Jul 16, 2017
d9626e9
Move X11EmbedContainer.h to include
lukas-w Jul 19, 2017
def2b7d
Move X11EmbedContainer to submodule
lukas-w Aug 5, 2017
0d3aaf6
.gitmodules: Use https URL
lukas-w Aug 5, 2017
bd33475
Fix x11embed for non qt5+linux
lukas-w Aug 5, 2017
f7dab93
Merge branch 'qt5-vst-2-stable' into fix/qt5-vst
lukas-w Sep 1, 2017
ddab534
Allow switching VST embed method at compile time
lukas-w Sep 1, 2017
e7d0675
Fix Qt4 VST embed option
lukas-w Sep 1, 2017
df37833
Merge branch 'stable-1.2' into fix/qt5-vst
lukas-w Sep 22, 2017
ffa1b63
Fix VST effects embedding
lukas-w Sep 22, 2017
6839746
VstEmbed: Allow selecting method at runtime
lukas-w Nov 6, 2017
415316f
VstEmbed: Remove obsolete CMake flags
lukas-w Nov 6, 2017
134dae8
VstEmbed: Add missing find_package instruction for Qt5X11Extras
lukas-w Nov 6, 2017
472a74d
Minor fixes
lukas-w Nov 6, 2017
e95fdcc
Add missing includes
lukas-w Nov 6, 2017
421a85d
Update qt5-x11embed submodule
lukas-w Nov 6, 2017
e3ba9ba
Update qt5-x11embed submodule for CMake changes
lukas-w Nov 6, 2017
6eb447d
Merge branch 'stable-1.2' into fix/qt5-vst
lukas-w Nov 7, 2017
2b6f366
CMake: Only link qx11embedcontainer on Linux
lukas-w Nov 7, 2017
6fd38fe
Fix qt5-x11embed submodule reference
lukas-w Nov 7, 2017
a8311a7
Vst: Fix widget deletion
lukas-w Nov 10, 2017
f9f4d0c
VstEmbed: Store embed method on plugin start
lukas-w Nov 10, 2017
358a251
VstEmbed: Support changing embed method without restart
lukas-w Nov 10, 2017
df3c07b
Fix Qt4 compatibility
PhysSong Nov 6, 2017
b0f64de
Restrict "qt" embed method to Qt5 only
PhysSong Nov 6, 2017
7da7a70
Add Win32 embedding
PhysSong Nov 7, 2017
463d02e
Move SC_CLOSE handling code
PhysSong Nov 8, 2017
55ce90e
Try to improve embedding method logic
PhysSong Nov 18, 2017
72e882a
Add a fallback logic for VST embedding methods
PhysSong Nov 20, 2017
a8aa3e1
VST: Fix Qt4 compilation
lukas-w Nov 24, 2017
3d47344
Travis: Enable Linux/Qt4 builds
lukas-w Nov 24, 2017
e95e379
Merge pull request #3991 from PhysSong/fix/qt5-vst
lukas-w Nov 24, 2017
23cb385
VstEmbed: Remove obsolete CMake flags
lukas-w Nov 24, 2017
7019cab
Merge branch 'stable-1.2' into fix/qt5-vst
lukas-w Nov 25, 2017
238d6b6
CMake: Fix RemoteVstPlugin build when winebuild is not in PATH
lukas-w Nov 25, 2017
8c02495
Qt4 compat simplified
lukas-w Nov 25, 2017
ae488b8
Fix VstEffect width issue
lukas-w Nov 29, 2017
a446775
VST: Fix Qt-embedded VSTs not always appearing
lukas-w Nov 29, 2017
7ae348e
Vst refactorings
lukas-w Nov 29, 2017
19f4889
VST: Disable plugin reload on embed method change
lukas-w Dec 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/3rdparty/qt5-x11embed"]
path = src/3rdparty/qt5-x11embed
url = https://github.com/Lukas-W/qt5-x11embed.git
6 changes: 4 additions & 2 deletions .travis/linux..install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

PACKAGES="cmake libsndfile-dev fftw3-dev libvorbis-dev libogg-dev libmp3lame-dev
libasound2-dev libjack-dev libsdl-dev libsamplerate0-dev libstk0-dev
libfluidsynth-dev portaudio19-dev wine-dev g++-multilib libfltk1.3-dev
libfluidsynth-dev portaudio19-dev g++-multilib libfltk1.3-dev
libgig-dev libsoundio-dev"

VST_PACKAGES="wine-dev libqt5x11extras5-dev qtbase5-private-dev libxcb-util0-dev libxcb-keysyms1-dev"

# Help with unmet dependencies
PACKAGES="$PACKAGES libjack0"
PACKAGES="$PACKAGES $VST_PACKAGES libjack0"

if [ $QT5 ]; then
PACKAGES="$PACKAGES qtbase5-dev qttools5-dev-tools qttools5-dev"
Expand Down
16 changes: 3 additions & 13 deletions include/RemotePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -796,19 +796,6 @@ class EXPORT RemotePlugin : public QObject, public RemotePluginBase
unlock();
}

void showUI()
{
lock();
sendMessage( IdShowUI );
unlock();
}

void hideUI()
{
lock();
sendMessage( IdHideUI );
unlock();
}

void toggleUI()
{
Expand Down Expand Up @@ -841,6 +828,9 @@ class EXPORT RemotePlugin : public QObject, public RemotePluginBase
m_commMutex.unlock();
}

public slots:
void showUI();
void hideUI();

protected:
inline void setSplittedChannels( bool _on )
Expand Down
1 change: 1 addition & 0 deletions plugins/vst_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
15 changes: 14 additions & 1 deletion plugins/vst_base/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() );
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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
Expand Down
66 changes: 31 additions & 35 deletions plugins/vst_base/VstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <QX11EmbedContainer>
#include <QX11Info>
#else
#include "X11EmbedContainer.h"
#include <QWindow>
#endif
#else
Expand All @@ -55,8 +56,7 @@
#include "templates.h"
#include "FileDialog.h"


#if QT_VERSION < 0x050000
#ifdef LMMS_EMBED_VST
class vstSubWin : public QMdiSubWindow
{
public:
Expand Down Expand Up @@ -175,8 +175,6 @@ void VstPlugin::tryLoad( const QString &remoteVstPluginExecutable )
}




#ifdef LMMS_EMBED_VST
void VstPlugin::showEditor( QWidget * _parent, bool isEffect )
{
Expand Down Expand Up @@ -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() );
vstSubWin * sw = new vstSubWin( gui->mainWindow()->workspace() );
//auto sw = new SubWindow();

#ifdef LMMS_EMBED_VST_X11
QX11EmbedContainer * container = new QX11EmbedContainer( sw );
connect(container, SIGNAL(clientIsEmbedded()), this, SLOT(showUI()));
container->embedClient( m_pluginWindowID );
#else
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 )
{
vstSubWin * sw = new vstSubWin(
gui->mainWindow()->workspace() );
m_pluginWidget = container;

sw->setWidget(container);

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 );

QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );
xe->move( 4, 24 );
xe->show();
}
}
#else
QWindow * window = QWindow::fromWinId( m_pluginWindowID );
m_pluginWidget = QWidget::createWindowContainer( window, _parent,
Qt::Window );
m_pluginWidget->setFixedSize( m_pluginGeometry );
m_pluginWidget->setWindowTitle( name() );
// TODO: Synchronize show
// Tell remote that it is embedded
// Wait for remote reply
};

#ifdef LMMS_EMBED_VST_X11
#endif
container->setFixedSize( m_pluginGeometry );
#endif

m_pluginWidget->show();
//m_pluginWidget->show();
}


Expand All @@ -268,7 +264,7 @@ void VstPlugin::hideEditor()

void VstPlugin::toggleEditor()
{
QWidget * w = m_pluginWidget;
QWidget * w = pluginWidget();
if( w )
{
w->setVisible( !w->isVisible() );
Expand Down
2 changes: 1 addition & 1 deletion plugins/vst_base/VstPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class PLUGIN_EXPORT VstPlugin : public RemotePlugin, public JournallingObject

inline QWidget * pluginWidget( bool _top_widget = true )
{
#if QT_VERSION < 0x050000
#ifdef LMMS_EMBED_VST
if( _top_widget && m_pluginWidget )
{
if( m_pluginWidget->parentWidget() )
Expand Down
8 changes: 8 additions & 0 deletions src/3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(ExternalProject)

IF(QT5 AND LMMS_BUILD_LINUX)
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(qt5-x11embed)
ELSE()
add_library(qx11embedcontainer STATIC /dev/null)
ENDIF()
1 change: 1 addition & 0 deletions src/3rdparty/qt5-x11embed
Submodule qt5-x11embed added at dad35c
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ IF(LMMS_BUILD_APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()

ADD_SUBDIRECTORY(3rdparty)
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(tracks)
Expand Down Expand Up @@ -132,7 +133,7 @@ IF(LMMS_BUILD_HAIKU)
SET(EXTRA_LIBRARIES "-lnetwork")
ENDIF()

SET(LMMS_REQUIRED_LIBS
SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS}
${CMAKE_THREAD_LIBS_INIT}
${QT_LIBRARIES}
${ASOUND_LIBRARY}
Expand Down
14 changes: 14 additions & 0 deletions src/core/RemotePlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,20 @@ void RemotePlugin::processMidiEvent( const MidiEvent & _e,
unlock();
}

void RemotePlugin::showUI()
{
lock();
sendMessage( IdShowUI );
unlock();
}

void RemotePlugin::hideUI()
{
lock();
sendMessage( IdHideUI );
unlock();
}




Expand Down
5 changes: 4 additions & 1 deletion src/gui/SubWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ void SubWindow::paintEvent( QPaintEvent * )
{
QPainter p( this );
QRect rect( 0, 0, width(), m_titleBarHeight );
bool isActive = SubWindow::mdiArea()->activeSubWindow() == this;

bool isActive = mdiArea()
? mdiArea()->activeSubWindow() == this
: false;

p.fillRect( rect, isActive ? activeColor() : p.pen().brush() );

Expand Down