Browse Source

Visual consistency; Remove animations showing a plugin at a time

Signed-off-by: falkTX <falktx@gmail.com>
tags/v2.1-alpha2
falkTX 5 years ago
parent
commit
e2aaa1f06a
Signed by: falkTX <falktx@gmail.com> GPG Key ID: 2D3445A829213837
3 changed files with 49 additions and 26 deletions
  1. +24
    -0
      resources/ui/carla_host.ui
  2. +4
    -1
      source/backend/engine/CarlaEngine.cpp
  3. +21
    -25
      source/frontend/carla_host.py

+ 24
- 0
resources/ui/carla_host.ui View File

@@ -809,6 +809,12 @@
<property name="text">
<string>&amp;Open...</string>
</property>
<property name="iconText">
<string>Open...</string>
</property>
<property name="toolTip">
<string>Open...</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
</property>
@@ -833,6 +839,12 @@
<property name="text">
<string>Save &amp;As...</string>
</property>
<property name="iconText">
<string>Save As...</string>
</property>
<property name="toolTip">
<string>Save As...</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+S</string>
</property>
@@ -893,6 +905,12 @@
<property name="text">
<string>Add Plugin...</string>
</property>
<property name="iconText">
<string>Add Plugin...</string>
</property>
<property name="toolTip">
<string>Add Plugin...</string>
</property>
</action>
<action name="act_plugin_remove_all">
<property name="icon">
@@ -1225,6 +1243,12 @@
<property name="text">
<string>Add &amp;JACK Application</string>
</property>
<property name="iconText">
<string>Add JACK Application...</string>
</property>
<property name="toolTip">
<string>Add JACK Application...</string>
</property>
</action>
<action name="act_plugin_add_jack">
<property name="icon">


+ 4
- 1
source/backend/engine/CarlaEngine.cpp View File

@@ -726,7 +726,8 @@ bool CarlaEngine::removeAllPlugins()

for (uint i=0; i < curPluginCount; ++i)
{
EnginePluginData& pluginData(pData->plugins[i]);
const uint id = curPluginCount - i - 1;
EnginePluginData& pluginData(pData->plugins[id]);

if (pluginData.plugin != nullptr)
{
@@ -735,6 +736,8 @@ bool CarlaEngine::removeAllPlugins()
}

carla_zeroFloats(pluginData.peaks, 4);

callback(ENGINE_CALLBACK_PLUGIN_REMOVED, id, 0, 0, 0.0f, nullptr);
callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);
}



+ 21
- 25
source/frontend/carla_host.py View File

@@ -851,10 +851,17 @@ class HostWindow(QMainWindow):

def engineStopFinal(self):
self.killTimers()
self.removeAllPlugins()

if self.host.is_engine_running():
self.host.remove_all_plugins()
if self.fCustomStopAction == self.CUSTOM_ACTION_PROJECT_LOAD:
self.removeAllPlugins()
else:
self.fCurrentlyRemovingAllPlugins = True
self.projectLoadingStarted()

if not self.host.remove_all_plugins():
self.ui.text_logs.appendPlainText("Failed to remove all plugins, error was:")
self.ui.text_logs.appendPlainText(self.host.get_last_error())

if not self.host.engine_close():
self.ui.text_logs.appendPlainText("Failed to stop engine, error was:")
@@ -1096,33 +1103,15 @@ class HostWindow(QMainWindow):
if self.fPluginCount == 0:
return

# FIXME - this is not working
# removing a plugin causes flicker, the rack-list becomes empty for some time
# this breaks the remove-all animation, so don't bother using it
if False and not self.host.isPlugin:
self.projectLoadingStarted()

app = QApplication.instance()
app.processEvents()

for i in reversed(range(self.fPluginCount)):
self.host.remove_plugin(i)
app.processEvents()

self.projectLoadingFinished()

self.fCurrentlyRemovingAllPlugins = True
ok = self.host.remove_all_plugins()
self.fCurrentlyRemovingAllPlugins = False
self.projectLoadingStarted()

if ok:
self.removeAllPlugins()
else:
if not self.host.remove_all_plugins():
self.projectLoadingFinished()
self.fCurrentlyRemovingAllPlugins = False
CustomMessageBox(self, QMessageBox.Warning, self.tr("Error"), self.tr("Operation failed"),
self.host.get_last_error(), QMessageBox.Ok, QMessageBox.Ok)

self.fCurrentlyRemovingAllPlugins = False

@pyqtSlot()
def slot_jackAppAdd(self):
data = self.showAddJackAppDialog()
@@ -1266,12 +1255,19 @@ class HostWindow(QMainWindow):
pitem.close()
del pitem

if self.fPluginCount == 0:
self.ui.act_plugin_remove_all.setEnabled(False)
if self.fCurrentlyRemovingAllPlugins:
self.fCurrentlyRemovingAllPlugins = False
self.projectLoadingFinished()
return

# push all plugins 1 slot back
for i in range(pluginId, self.fPluginCount):
pitem = self.fPluginList[i]
pitem.setPluginId(i)

self.ui.act_plugin_remove_all.setEnabled(self.fPluginCount > 0)
self.ui.act_plugin_remove_all.setEnabled(True)

# --------------------------------------------------------------------------------------------------------
# Canvas


Loading…
Cancel
Save