Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
begone embedding
  • Loading branch information
Rossmaxx committed Apr 7, 2025
commit aa989ad5024d86d9fec2a2d3798f1aa4040babb4
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ SET(QT_LIBRARIES
Qt5::Svg
)

IF(LMMS_BUILD_LINUX AND WANT_VST)
FIND_PACKAGE(Qt5 COMPONENTS X11Extras REQUIRED)
LIST(APPEND QT_LIBRARIES Qt5::X11Extras)
ENDIF()

# Resolve Qt5::qmake to full path for use in packaging scripts
GET_TARGET_PROPERTY(QT_QMAKE_EXECUTABLE "${Qt5Core_QMAKE_EXECUTABLE}" IMPORTED_LOCATION)

Expand Down
3 changes: 0 additions & 3 deletions include/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ class LMMS_EXPORT ConfigManager : public QObject

static bool enableBlockedPlugins();

static QStringList availableVstEmbedMethods();
QString vstEmbedMethod() const;

// Returns true if the working dir (e.g. ~/lmms) exists on disk.
bool hasWorkingDir() const;

Expand Down
4 changes: 0 additions & 4 deletions include/SetupDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ private slots:
void toggleRunningAutoSave(bool enabled);
void toggleSmoothScroll(bool enabled);
void toggleAnimateAFP(bool enabled);
void vstEmbedMethodChanged();
void toggleVSTAlwaysOnTop(bool en);
void toggleDisableAutoQuit(bool enabled);

Expand Down Expand Up @@ -162,9 +161,6 @@ private slots:
QCheckBox * m_runningAutoSave;
bool m_smoothScroll;
bool m_animateAFP;
QLabel * m_vstEmbedLbl;
QComboBox* m_vstEmbedComboBox;
QString m_vstEmbedMethod;
QCheckBox * m_vstAlwaysOnTopCheckBox;
bool m_vstAlwaysOnTop;
bool m_disableAutoQuit;
Expand Down
16 changes: 0 additions & 16 deletions plugins/Vestige/Vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,6 @@ class VstInstrumentPlugin : public VstPlugin
public:
using VstPlugin::VstPlugin;

void createUI( QWidget *parent ) override
{
Q_UNUSED(parent);
if ( !hasEditor() ) {
return;
}
if ( embedMethod() != "none" ) {
m_pluginSubWindow.reset(new gui::vstSubWin( gui::getGUI()->mainWindow()->workspace() ));
VstPlugin::createUI( m_pluginSubWindow.get() );
m_pluginSubWindow->setWidget(pluginWidget());
} else {
VstPlugin::createUI( nullptr );
}
}

/// Overwrite editor() to return the sub window instead of the embed widget
/// itself. This makes toggleUI() and related functions toggle the
/// sub window's visibility.
Expand Down Expand Up @@ -380,7 +365,6 @@ void VestigeInstrument::loadFile( const QString & _file )

if ( !(instrumentTrack() != nullptr && instrumentTrack()->isPreviewMode()))
{
m_plugin->createUI(nullptr);
m_plugin->showUI();
}

Expand Down
77 changes: 8 additions & 69 deletions plugins/VstBase/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ using namespace std;

static lmms::VstHostLanguage hlang = lmms::VstHostLanguage::English;

static bool EMBED = false;
static bool EMBED_X11 = false;
static bool EMBED_WIN32 = false;
static bool HEADLESS = false;

namespace lmms
Expand Down Expand Up @@ -561,10 +558,9 @@ RemoteVstPlugin::~RemoteVstPlugin()

bool RemoteVstPlugin::processMessage( const message & _m )
{
if (! EMBED)

switch( _m.id )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
switch( _m.id )
switch (_m.id)

{
switch( _m.id )
{
case IdShowUI:
showEditor();
return true;
Expand Down Expand Up @@ -598,19 +594,7 @@ bool RemoteVstPlugin::processMessage( const message & _m )
sendMessage( message( IdIsUIVisible )
.addInt( visible ? 1 : 0 ) );
return true;
}
}
else if (EMBED && _m.id == IdShowUI)
{
#ifndef NATIVE_LINUX_VST
ShowWindow( m_window, SW_SHOWNORMAL );
UpdateWindow( m_window );
#endif
return true;
}

switch( _m.id )
{
case IdVstLoadPlugin:
init( _m.getString() );
break;
Expand Down Expand Up @@ -798,12 +782,7 @@ void RemoteVstPlugin::initEditor()
}


DWORD dwStyle;
if (EMBED) {
dwStyle = WS_POPUP | WS_SYSMENU | WS_BORDER;
} else {
dwStyle = WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX;
}
dwStyle = WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX;

m_window = CreateWindowEx( WS_EX_APPWINDOW, "LVSL", pluginName(),
dwStyle,
Expand Down Expand Up @@ -881,37 +860,19 @@ void RemoteVstPlugin::initEditor()


void RemoteVstPlugin::showEditor() {
if( !EMBED && !HEADLESS && m_window )
if (!HEADLESS && m_window)
{
#ifndef NATIVE_LINUX_VST
ShowWindow( m_window, SW_SHOWNORMAL );
#else
if (!m_x11WindowVisible)
{
XMapWindow(m_display, m_window);
XFlush(m_display);
m_x11WindowVisible = true;
}
#endif
}
}




void RemoteVstPlugin::hideEditor() {
if( !EMBED && !HEADLESS && m_window )
if (!HEADLESS && m_window)
{
#ifndef NATIVE_LINUX_VST
ShowWindow( m_window, SW_HIDE );
#else
if (m_x11WindowVisible)
{
XUnmapWindow(m_display, m_window);
XFlush(m_display);
m_x11WindowVisible = false;
}
#endif
}
}

Expand Down Expand Up @@ -2454,41 +2415,19 @@ int main( int _argc, char * * _argv )
if ( embedMethod == "none" )
{
std::cerr << "Starting detached." << std::endl;
EMBED = EMBED_X11 = EMBED_WIN32 = HEADLESS = false;
}
else if ( embedMethod == "win32" )
{
std::cerr << "Starting using Win32-native embedding." << std::endl;
EMBED = EMBED_WIN32 = true; EMBED_X11 = HEADLESS = false;
}
else if ( embedMethod == "qt" )
{
std::cerr << "Starting using Qt-native embedding." << std::endl;
EMBED = true; EMBED_X11 = EMBED_WIN32 = HEADLESS = false;
}
else if ( embedMethod == "xembed" )
{
std::cerr << "Starting using X11Embed protocol." << std::endl;
EMBED = EMBED_X11 = true; EMBED_WIN32 = HEADLESS = false;
HEADLESS = false;
}
else if ( embedMethod == "headless" )
{
std::cerr << "Starting without UI." << std::endl;
HEADLESS = true; EMBED = EMBED_X11 = EMBED_WIN32 = false;
HEADLESS = true;
}
else
{
std::cerr << "Unknown embed method " << embedMethod << ". Starting detached instead." << std::endl;
EMBED = EMBED_X11 = EMBED_WIN32 = HEADLESS = false;
HEADLESS = false;
}
}

#ifdef NATIVE_LINUX_VST
if (EMBED)
{
std::cerr << "Native linux VST works only without embedding." << std::endl;
}
#endif

// constructor automatically will process messages until it receives
// a IdVstLoadPlugin message and processes it
Expand Down
Loading