Signed-off-by: falkTX <falktx@falktx.com>fix-audiofile-buffering
@@ -51,6 +51,8 @@ typedef struct { | |||||
uint parameterOuts; | uint parameterOuts; | ||||
} PluginListDialogResults; | } PluginListDialogResults; | ||||
struct PluginListDialog; | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
CARLA_API void | CARLA_API void | ||||
@@ -59,6 +61,12 @@ carla_frontend_createAndExecAboutJuceDialog(void* parent); | |||||
CARLA_API const JackAppDialogResults* | CARLA_API const JackAppDialogResults* | ||||
carla_frontend_createAndExecJackAppDialog(void* parent, const char* projectFilename); | 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_API const PluginListDialogResults* | ||||
carla_frontend_createAndExecPluginListDialog(void* parent/*, const HostSettings& hostSettings*/); | carla_frontend_createAndExecPluginListDialog(void* parent/*, const HostSettings& hostSettings*/); | ||||
@@ -87,7 +87,13 @@ class CarlaFrontendLib(): | |||||
self.lib.carla_frontend_createAndExecJackAppDialog.argtypes = (c_void_p, c_char_p) | self.lib.carla_frontend_createAndExecJackAppDialog.argtypes = (c_void_p, c_char_p) | ||||
self.lib.carla_frontend_createAndExecJackAppDialog.restype = POINTER(JackApplicationDialogResults) | 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) | self.lib.carla_frontend_createAndExecPluginListDialog.restype = POINTER(PluginListDialogResults) | ||||
# -------------------------------------------------------------------------------------------------------- | # -------------------------------------------------------------------------------------------------------- | ||||
@@ -99,6 +105,12 @@ class CarlaFrontendLib(): | |||||
return structToDictOrNull(self.lib.carla_frontend_createAndExecJackAppDialog(unwrapinstance(parent), | return structToDictOrNull(self.lib.carla_frontend_createAndExecJackAppDialog(unwrapinstance(parent), | ||||
projectFilename.encode("utf-8"))) | 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): | def createAndExecPluginListDialog(self, parent, useSystemIcons): | ||||
return structToDictOrNull(self.lib.carla_frontend_createAndExecPluginListDialog(unwrapinstance(parent))) | return structToDictOrNull(self.lib.carla_frontend_createAndExecPluginListDialog(unwrapinstance(parent))) | ||||
@@ -161,7 +161,7 @@ class HostWindow(QMainWindow): | |||||
self.fPluginCount = 0 | self.fPluginCount = 0 | ||||
self.fPluginList = [] | self.fPluginList = [] | ||||
self.fPluginDatabaseDialog = None | |||||
self.fPluginListDialog = None | |||||
self.fFavoritePlugins = [] | self.fFavoritePlugins = [] | ||||
self.fProjectFilename = "" | self.fProjectFilename = "" | ||||
@@ -1208,8 +1208,10 @@ class HostWindow(QMainWindow): | |||||
def showAddPluginDialog(self): | def showAddPluginDialog(self): | ||||
# TODO self.fHasLoadedLv2Plugins | # 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) | print(ret) | ||||
# TODO | # TODO | ||||
@@ -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 = {}; | 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 PluginListDialogResults ret; | ||||
static CarlaString category; | static CarlaString category; | ||||
@@ -1916,7 +1920,7 @@ carla_frontend_createAndExecPluginListDialog(void* const parent/*, const HostSet | |||||
static CarlaString label; | static CarlaString label; | ||||
static CarlaString maker; | static CarlaString maker; | ||||
const PluginInfo& plugin(gui.getSelectedPluginInfo()); | |||||
const PluginInfo& plugin(dialog->getSelectedPluginInfo()); | |||||
category = plugin.category.toUtf8(); | category = plugin.category.toUtf8(); | ||||
filename = plugin.filename.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); | |||||
} | |||||
// -------------------------------------------------------------------------------------------------------------------- |