| @@ -1207,7 +1207,14 @@ public: | |||
| if (index >= 0 && index < static_cast<int32_t>(fRdfDescriptor->PresetCount)) | |||
| { | |||
| if (LilvState* const state = Lv2WorldClass::getInstance().getStateFromURI(fRdfDescriptor->Presets[index].URI, (const LV2_URID_Map*)fFeatures[kFeatureIdUridMap]->data)) | |||
| CARLA_SAFE_ASSERT_RETURN(fExt.state != nullptr,); | |||
| LilvState* const state = Lv2WorldClass::getInstance().getStateFromURI(fRdfDescriptor->Presets[index].URI, (const LV2_URID_Map*)fFeatures[kFeatureIdUridMap]->data); | |||
| CARLA_SAFE_ASSERT_RETURN(state != nullptr,); | |||
| // invalidate midi-program selection | |||
| CarlaPlugin::setMidiProgram(-1, false, false, sendCallback); | |||
| { | |||
| const ScopedSingleProcessLocker spl(this, (sendGui || sendOsc || sendCallback)); | |||
| @@ -1215,9 +1222,9 @@ public: | |||
| if (fHandle2 != nullptr) | |||
| lilv_state_restore(state, fExt.state, fHandle2, carla_lilv_set_port_value, this, 0, fFeatures); | |||
| lilv_state_free(state); | |||
| } | |||
| lilv_state_free(state); | |||
| } | |||
| CarlaPlugin::setProgram(index, sendGui, sendOsc, sendCallback); | |||
| @@ -5783,7 +5790,7 @@ private: | |||
| static const void* carla_lv2_state_retrieve(LV2_State_Handle handle, uint32_t key, size_t* size, uint32_t* type, uint32_t* flags) | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); | |||
| carla_debug("carla_lv2_state_retrieve(%p, %i, %p, %p, %p)", handle, key, size, type, flags); | |||
| carla_stdout("carla_lv2_state_retrieve(%p, %i, %p, %p, %p)", handle, key, size, type, flags); | |||
| return ((CarlaPluginLV2*)handle)->handleStateRetrieve(key, size, type, flags); | |||
| } | |||
| @@ -630,19 +630,21 @@ class PluginEdit(QDialog): | |||
| # Update current program text | |||
| if self.ui.cb_programs.count() > 0: | |||
| pIndex = self.ui.cb_programs.currentIndex() | |||
| pName = self.host.get_program_name(self.fPluginId, pIndex) | |||
| #pName = pName[:40] + (pName[40:] and "...") | |||
| self.ui.cb_programs.setItemText(pIndex, pName) | |||
| if pIndex >= 0: | |||
| pName = self.host.get_program_name(self.fPluginId, pIndex) | |||
| #pName = pName[:40] + (pName[40:] and "...") | |||
| self.ui.cb_programs.setItemText(pIndex, pName) | |||
| # Update current midi program text | |||
| if self.ui.cb_midi_programs.count() > 0: | |||
| mpIndex = self.ui.cb_midi_programs.currentIndex() | |||
| mpData = self.host.get_midi_program_data(self.fPluginId, mpIndex) | |||
| mpBank = mpData['bank'] | |||
| mpProg = mpData['program'] | |||
| mpName = mpData['name'] | |||
| #mpName = mpName[:40] + (mpName[40:] and "...") | |||
| self.ui.cb_midi_programs.setItemText(mpIndex, "%03i:%03i - %s" % (mpBank+1, mpProg+1, mpName)) | |||
| if mpIndex >= 0: | |||
| mpData = self.host.get_midi_program_data(self.fPluginId, mpIndex) | |||
| mpBank = mpData['bank'] | |||
| mpProg = mpData['program'] | |||
| mpName = mpData['name'] | |||
| #mpName = mpName[:40] + (mpName[40:] and "...") | |||
| self.ui.cb_midi_programs.setItemText(mpIndex, "%03i:%03i - %s" % (mpBank+1, mpProg+1, mpName)) | |||
| # Update all parameter values | |||
| for paramType, paramId, paramWidget in self.fParameterList: | |||
| @@ -1181,7 +1183,6 @@ class PluginEdit(QDialog): | |||
| if ret[1]: | |||
| index = int(ret[0].split(" - ", 1)[0])-1 | |||
| self.host.set_midi_program(self.fPluginId, -1) | |||
| self.host.set_program(self.fPluginId, index) | |||
| self.setMidiProgram(-1) | |||