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
tidied up everything and a few fixes here and there
  • Loading branch information
Rossmaxx committed Apr 7, 2025
commit 07c940bc9bc8c77fbde7063cac3c573d23f1ca74
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
12 changes: 12 additions & 0 deletions plugins/Vestige/Vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@
public:
using VstPlugin::VstPlugin;

void createUI( QWidget *parent ) override
{
Q_UNUSED(parent);
if ( !hasEditor() ) {
return;
}

VstPlugin::createUI( nullptr );
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
VstPlugin::createUI( nullptr );
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 @@ -365,6 +376,7 @@

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

Expand Down Expand Up @@ -1233,7 +1245,7 @@
return new VestigeInstrument( static_cast<InstrumentTrack *>( m ) );
}


Check notice on line 1248 in plugins/Vestige/Vestige.cpp

View check run for this annotation

codefactor.io / CodeFactor

plugins/Vestige/Vestige.cpp#L1248

Redundant blank line at the end of a code block should be deleted. (whitespace/blank_line)
}


Expand Down
27 changes: 26 additions & 1 deletion plugins/VstBase/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,12 +865,38 @@ void RemoteVstPlugin::initEditor()


void RemoteVstPlugin::showEditor() {
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 (!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 @@ -2162,7 +2188,6 @@ void * RemoteVstPlugin::processingThread(void * _param)
RemotePluginClient::message m;
while( ( m = _this->receiveMessage() ).id != IdQuit )
{

if( m.id == IdStartProcessing
|| m.id == IdMidiEvent
|| m.id == IdVstSetParameter
Expand Down
21 changes: 16 additions & 5 deletions plugins/VstBase/VstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
# include <QLayout>
#endif


#include "AudioEngine.h"
#include "ConfigManager.h"
#include "GuiApplication.h"
Expand All @@ -52,6 +51,7 @@
#include "FileDialog.h"

#ifdef LMMS_BUILD_LINUX
# include <QX11Info>
# include <X11/Xlib.h>
#endif

Expand Down Expand Up @@ -268,8 +268,7 @@ void VstPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this )
if ( visible != -1 )
{
_this.setAttribute( "guivisible", visible );
}

}

// try to save all settings in a chunk
QByteArray chunk = saveChunk();
Expand All @@ -294,8 +293,6 @@ void VstPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this )
}




void VstPlugin::setTempo( bpm_t _bpm )
{
lock();
Expand Down Expand Up @@ -386,6 +383,11 @@ bool VstPlugin::processMessage( const message & _m )
SetWindowLongPtr( (HWND)(intptr_t) m_pluginWindowID,
GWLP_HWNDPARENT,
(LONG_PTR) gui::getGUI()->mainWindow()->winId() );
#endif
#ifdef LMMS_BUILD_LINUX
XSetTransientForHint( QX11Info::display(),
m_pluginWindowID,
gui::getGUI()->mainWindow()->winId() );
#endif
}
break;
Expand Down Expand Up @@ -677,6 +679,15 @@ void VstPlugin::toggleEditorVisibility( int visible )
w->setVisible( visible );
}

void VstPlugin::createUI( QWidget * parent )
{
if ( m_pluginWidget ) {
qWarning() << "VstPlugin::createUI called twice";
m_pluginWidget->setParent( parent );
return;
}
}


QString VstPlugin::embedMethod() const
{
Expand Down
3 changes: 1 addition & 2 deletions plugins/VstBase/VstPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class VSTBASE_EXPORT VstPlugin : public RemotePlugin, public JournallingObject
return "vstplugin";
}


bool eventFilter(QObject *obj, QEvent *event) override;
virtual void createUI(QWidget *parent);

QString embedMethod() const;

Expand Down
2 changes: 0 additions & 2 deletions plugins/VstEffect/VstEffectControlDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
l->setVerticalSpacing( 2 );
l->setHorizontalSpacing( 2 );

bool embed_vst = false;

if (m_plugin)
{
setWindowTitle( m_plugin->name() );
Expand Down
12 changes: 0 additions & 12 deletions src/core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,6 @@ bool ConfigManager::enableBlockedPlugins()
return (envVar && *envVar);
}

QStringList ConfigManager::availableVstEmbedMethods()
{
QStringList methods;
methods.append("none");
return methods;
}

QString ConfigManager::vstEmbedMethod() const
{
return "none";
}

bool ConfigManager::hasWorkingDir() const
{
return QDir(m_workingDir).exists();
Expand Down
Loading