Browse Source

Keep plugin list dialog in memory

Signed-off-by: falkTX <falktx@falktx.com>
fix-audiofile-buffering
falkTX 1 year ago
parent
commit
0335e038a7
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 46 additions and 9 deletions
  1. +8
    -0
      source/frontend/CarlaFrontend.h
  2. +13
    -1
      source/frontend/carla_frontend.py
  3. +5
    -3
      source/frontend/carla_host.py
  4. +20
    -5
      source/frontend/pluginlist/pluginlistdialog.cpp

+ 8
- 0
source/frontend/CarlaFrontend.h View File

@@ -51,6 +51,8 @@ typedef struct {
uint parameterOuts;
} PluginListDialogResults;

struct PluginListDialog;

// --------------------------------------------------------------------------------------------------------------------

CARLA_API void
@@ -59,6 +61,12 @@ carla_frontend_createAndExecAboutJuceDialog(void* parent);
CARLA_API const JackAppDialogResults*
carla_frontend_createAndExecJackAppDialog(void* parent, const char* projectFilename);

CARLA_API PluginListDialog*
carla_frontend_createPluginListDialog(void* parent);

CARLA_API const PluginListDialogResults*
carla_frontend_execPluginListDialog(PluginListDialog* dialog);

CARLA_API const PluginListDialogResults*
carla_frontend_createAndExecPluginListDialog(void* parent/*, const HostSettings& hostSettings*/);



+ 13
- 1
source/frontend/carla_frontend.py View File

@@ -87,7 +87,13 @@ class CarlaFrontendLib():
self.lib.carla_frontend_createAndExecJackAppDialog.argtypes = (c_void_p, c_char_p)
self.lib.carla_frontend_createAndExecJackAppDialog.restype = POINTER(JackApplicationDialogResults)

self.lib.carla_frontend_createAndExecPluginListDialog.argtypes = (c_void_p,) # , c_bool)
self.lib.carla_frontend_createPluginListDialog.argtypes = (c_void_p,)
self.lib.carla_frontend_createPluginListDialog.restype = c_void_p

self.lib.carla_frontend_execPluginListDialog.argtypes = (c_void_p,)
self.lib.carla_frontend_execPluginListDialog.restype = POINTER(PluginListDialogResults)

self.lib.carla_frontend_createAndExecPluginListDialog.argtypes = (c_void_p,)
self.lib.carla_frontend_createAndExecPluginListDialog.restype = POINTER(PluginListDialogResults)

# --------------------------------------------------------------------------------------------------------
@@ -99,6 +105,12 @@ class CarlaFrontendLib():
return structToDictOrNull(self.lib.carla_frontend_createAndExecJackAppDialog(unwrapinstance(parent),
projectFilename.encode("utf-8")))

def createPluginListDialog(self, parent, useSystemIcons):
return self.lib.carla_frontend_createPluginListDialog(unwrapinstance(parent))

def execPluginListDialog(self, dialog):
return structToDictOrNull(self.lib.carla_frontend_execPluginListDialog(dialog))

def createAndExecPluginListDialog(self, parent, useSystemIcons):
return structToDictOrNull(self.lib.carla_frontend_createAndExecPluginListDialog(unwrapinstance(parent)))



+ 5
- 3
source/frontend/carla_host.py View File

@@ -161,7 +161,7 @@ class HostWindow(QMainWindow):
self.fPluginCount = 0
self.fPluginList = []

self.fPluginDatabaseDialog = None
self.fPluginListDialog = None
self.fFavoritePlugins = []

self.fProjectFilename = ""
@@ -1208,8 +1208,10 @@ class HostWindow(QMainWindow):

def showAddPluginDialog(self):
# TODO self.fHasLoadedLv2Plugins
ret = gCarla.felib.createAndExecPluginListDialog(self.fParentOrSelf,
self.fSavedSettings[CARLA_KEY_MAIN_SYSTEM_ICONS])
if self.fPluginListDialog is None:
self.fPluginListDialog = gCarla.felib.createPluginListDialog(self.fParentOrSelf,
self.fSavedSettings[CARLA_KEY_MAIN_SYSTEM_ICONS])
ret = gCarla.felib.execPluginListDialog(self.fPluginListDialog)
print(ret)

# TODO


+ 20
- 5
source/frontend/pluginlist/pluginlistdialog.cpp View File

@@ -1901,13 +1901,17 @@ void PluginListDialog::saveSettings()

// --------------------------------------------------------------------------------------------------------------------

const PluginListDialogResults*
carla_frontend_createAndExecPluginListDialog(void* const parent/*, const HostSettings& hostSettings*/)
PluginListDialog*
carla_frontend_createPluginListDialog(void* const parent)
{
const HostSettings hostSettings = {};
PluginListDialog gui(reinterpret_cast<QWidget*>(parent), hostSettings);
return new PluginListDialog(reinterpret_cast<QWidget*>(parent), hostSettings);
}

if (gui.exec())
const PluginListDialogResults*
carla_frontend_execPluginListDialog(PluginListDialog* const dialog)
{
if (dialog->exec())
{
static PluginListDialogResults ret;
static CarlaString category;
@@ -1916,7 +1920,7 @@ carla_frontend_createAndExecPluginListDialog(void* const parent/*, const HostSet
static CarlaString label;
static CarlaString maker;

const PluginInfo& plugin(gui.getSelectedPluginInfo());
const PluginInfo& plugin(dialog->getSelectedPluginInfo());

category = plugin.category.toUtf8();
filename = plugin.filename.toUtf8();
@@ -1949,3 +1953,14 @@ carla_frontend_createAndExecPluginListDialog(void* const parent/*, const HostSet
}

// --------------------------------------------------------------------------------------------------------------------

const PluginListDialogResults*
carla_frontend_createAndExecPluginListDialog(void* const parent/*, const HostSettings& hostSettings*/)
{
const HostSettings hostSettings = {};
PluginListDialog gui(reinterpret_cast<QWidget*>(parent), hostSettings);

return carla_frontend_execPluginListDialog(&gui);
}

// --------------------------------------------------------------------------------------------------------------------

Loading…
Cancel
Save