Browse Source

Small tweaks to make embed VST work better

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.1-rc1
falkTX 5 years ago
parent
commit
0526bccfd7
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 23 additions and 11 deletions
  1. +1
    -1
      source/frontend/carla_host.py
  2. +14
    -2
      source/native-plugins/resources/carla-plugin
  3. +6
    -6
      source/plugin/carla-vst.cpp
  4. +2
    -2
      source/plugin/carla-vst.hpp

+ 1
- 1
source/frontend/carla_host.py View File

@@ -1827,7 +1827,7 @@ class HostWindow(QMainWindow):
# Transport

def refreshTransport(self, forced = False):
if not self.isVisible():
if not self.ui.l_transport_time.isVisible():
return
if self.fSampleRate == 0.0 or not self.host.is_engine_running():
return


+ 14
- 2
source/native-plugins/resources/carla-plugin View File

@@ -20,7 +20,7 @@
# Imports (Global)

from PyQt5.QtGui import QKeySequence, QMouseEvent
from PyQt5.QtWidgets import QHBoxLayout
from PyQt5.QtWidgets import QSplitter

# ------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)
@@ -466,7 +466,15 @@ class CarlaEmbedW(QEmbedWidget):
if self.host.processMode == ENGINE_PROCESS_MODE_PATCHBAY:
self.addLine()

self.addWidget(self.gui.centralWidget())
self.fCentralSplitter = QSplitter(self)
policy = self.fCentralSplitter.sizePolicy()
policy.setVerticalStretch(1)
self.fCentralSplitter.setSizePolicy(policy)

self.addCentralWidget(self.gui.ui.dockWidget)
self.addCentralWidget(self.gui.centralWidget())
self.fLayout.addWidget(self.fCentralSplitter)

self.finalSetup(self.gui, winId)

def addShortcutActions(self, actions):
@@ -478,6 +486,10 @@ class CarlaEmbedW(QEmbedWidget):
widget.setParent(self)
self.fLayout.addWidget(widget)

def addCentralWidget(self, widget):
widget.setParent(self)
self.fCentralSplitter.addWidget(widget)

def addLine(self):
line = QFrame(self)
line.setFrameShadow(QFrame.Sunken)


+ 6
- 6
source/plugin/carla-vst.cpp View File

@@ -84,7 +84,7 @@ public:
fMidiEventCount(0),
fTimeInfo(),
fVstRect(),
#ifndef CARLA_OS_LINUX
#ifndef HAVE_X11
fUiLauncher(nullptr),
#endif
fHostType(kHostTypeNull),
@@ -135,7 +135,7 @@ public:

fVstRect.top = 0;
fVstRect.left = 0;
#ifdef CARLA_OS_LINUX
#ifdef HAVE_X11
fVstRect.bottom = 712;
fVstRect.right = 1024;
#else
@@ -295,7 +295,7 @@ public:
case effEditOpen:
if (fDescriptor->ui_show != nullptr)
{
#ifdef CARLA_OS_LINUX
#ifdef HAVE_X11
char strBuf[0xff+1];
std::snprintf(strBuf, 0xff, P_INTPTR, (intptr_t)ptr);
strBuf[0xff] = '\0';
@@ -319,7 +319,7 @@ public:
case effEditClose:
if (fDescriptor->ui_show != nullptr)
{
#ifdef CARLA_OS_LINUX
#ifdef HAVE_X11
fDescriptor->ui_show(fHandle, false);
#else
destoryUILauncher(fUiLauncher);
@@ -330,7 +330,7 @@ public:
break;

case effEditIdle:
#ifndef CARLA_OS_LINUX
#ifndef HAVE_X11
if (fUiLauncher != nullptr)
idleUILauncher(fUiLauncher);
#endif
@@ -629,7 +629,7 @@ private:
NativeTimeInfo fTimeInfo;
ERect fVstRect;

#ifndef CARLA_OS_LINUX
#ifndef HAVE_X11
// UI button
CarlaUILauncher* fUiLauncher;
#endif


+ 2
- 2
source/plugin/carla-vst.hpp View File

@@ -19,7 +19,7 @@
#include "CarlaNative.h"
#include "vestige/vestige.h"

#ifndef CARLA_OS_LINUX
#ifndef HAVE_X11
# include "ui_launcher_res.hpp"
struct CarlaUILauncher;
#endif
@@ -31,7 +31,7 @@ struct VstObject {
NativePlugin* plugin;
};

#ifndef CARLA_OS_LINUX
#ifndef HAVE_X11
CarlaUILauncher* createUILauncher(const intptr_t winId,
const NativePluginDescriptor* const d,
const NativePluginHandle h);


Loading…
Cancel
Save