Browse Source

Add some precautions about closing LV2 UIs; Fix typo

tags/1.9.6
falkTX 10 years ago
parent
commit
358edf5d2d
2 changed files with 12 additions and 7 deletions
  1. +11
    -6
      source/backend/plugin/CarlaPluginLV2.cpp
  2. +1
    -1
      source/carla_backend.py

+ 11
- 6
source/backend/plugin/CarlaPluginLV2.cpp View File

@@ -1477,7 +1477,8 @@ public:

uint32_t portIndex;
const LV2_Atom* atom;
const bool hasPortEvent(fUI.handle != nullptr && fUI.descriptor != nullptr && fUI.descriptor->port_event != nullptr);
const bool hasPortEvent(fUI.handle != nullptr && fUI.descriptor != nullptr &&
fUI.descriptor->port_event != nullptr && ! fNeedsUiClose);

for (; tmpRingBuffer.get(atom, portIndex);)
{
@@ -1540,7 +1541,11 @@ public:
if (fNeedsUiClose)
pass();
else if (fUI.handle != nullptr && fExt.uiidle != nullptr && fExt.uiidle->idle(fUI.handle) != 0)
fNeedsUiClose = true;
{
showCustomUI(false);
pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0.0f, nullptr);
CARLA_SAFE_ASSERT(fUI.handle == nullptr);
}
#endif
}

@@ -3936,7 +3941,7 @@ public:
}
else
{
if (fUI.handle != nullptr && fUI.descriptor != nullptr && fUI.descriptor->port_event != nullptr)
if (fUI.handle != nullptr && fUI.descriptor != nullptr && fUI.descriptor->port_event != nullptr && ! fNeedsUiClose)
{
CARLA_SAFE_ASSERT_RETURN(pData->param.data[index].rindex >= 0,);
fUI.descriptor->port_event(fUI.handle, static_cast<uint32_t>(pData->param.data[index].rindex), sizeof(float), CARLA_URI_MAP_ID_NULL, &value);
@@ -3956,7 +3961,7 @@ public:
}
else
{
if (fExt.uiprograms != nullptr && fExt.uiprograms->select_program != nullptr)
if (fExt.uiprograms != nullptr && fExt.uiprograms->select_program != nullptr && ! fNeedsUiClose)
fExt.uiprograms->select_program(fUI.handle, pData->midiprog.data[index].bank, pData->midiprog.data[index].program);
}
}
@@ -3975,7 +3980,7 @@ public:
}
else
{
if (fUI.handle != nullptr && fUI.descriptor != nullptr && fUI.descriptor->port_event != nullptr && fEventsIn.ctrl != nullptr)
if (fUI.handle != nullptr && fUI.descriptor != nullptr && fUI.descriptor->port_event != nullptr && fEventsIn.ctrl != nullptr && ! fNeedsUiClose)
{
LV2_Atom_MidiEvent midiEv;
midiEv.atom.type = CARLA_URI_MAP_ID_MIDI_EVENT;
@@ -4002,7 +4007,7 @@ public:
}
else
{
if (fUI.handle != nullptr && fUI.descriptor != nullptr && fUI.descriptor->port_event != nullptr && fEventsIn.ctrl != nullptr)
if (fUI.handle != nullptr && fUI.descriptor != nullptr && fUI.descriptor->port_event != nullptr && fEventsIn.ctrl != nullptr && ! fNeedsUiClose)
{
LV2_Atom_MidiEvent midiEv;
midiEv.atom.type = CARLA_URI_MAP_ID_MIDI_EVENT;


+ 1
- 1
source/carla_backend.py View File

@@ -2427,7 +2427,7 @@ class CarlaHostDLL(CarlaHostMeta):
cfilename = filename.encode("utf-8") if filename else None
cname = name.encode("utf-8") if name else None
clabel = label.encode("utf-8") if label else None
return bool(self.lib.carla_add_plugin(btype, ptype, cfilename, cname, clabel, uniqueId, cast(extraPtr, c_void_p)), options)
return bool(self.lib.carla_add_plugin(btype, ptype, cfilename, cname, clabel, uniqueId, cast(extraPtr, c_void_p), options))

def remove_plugin(self, pluginId):
return bool(self.lib.carla_remove_plugin(pluginId))


Loading…
Cancel
Save