Browse Source

Carla: call programs/state stuff for 2nd handles too (forced stereo fix)

tags/v0.9.0
falkTX 12 years ago
parent
commit
a25b496ea5
2 changed files with 20 additions and 8 deletions
  1. +5
    -0
      c++/carla-backend/dssi.cpp
  2. +15
    -8
      c++/carla-backend/lv2.cpp

+ 5
- 0
c++/carla-backend/dssi.cpp View File

@@ -226,6 +226,7 @@ public:
return qCritical("DssiPlugin::setCustomData(%s, \"%s\", \"%s\", %s) - value is null", CustomDataType2str(type), key, value, bool2str(sendGui)); return qCritical("DssiPlugin::setCustomData(%s, \"%s\", \"%s\", %s) - value is null", CustomDataType2str(type), key, value, bool2str(sendGui));


descriptor->configure(handle, key, value); descriptor->configure(handle, key, value);
if (h2) descriptor->configure(h2, key, value);


#ifndef BUILD_BRIDGE #ifndef BUILD_BRIDGE
if (sendGui && osc.data.target) if (sendGui && osc.data.target)
@@ -252,11 +253,13 @@ public:
{ {
const CarlaEngine::ScopedLocker m(x_engine); const CarlaEngine::ScopedLocker m(x_engine);
descriptor->set_custom_data(handle, chunk.data(), chunk.size()); descriptor->set_custom_data(handle, chunk.data(), chunk.size());
if (h2) descriptor->set_custom_data(h2, chunk.data(), chunk.size());
} }
else else
{ {
const CarlaPlugin::ScopedDisabler m(this); const CarlaPlugin::ScopedDisabler m(this);
descriptor->set_custom_data(handle, chunk.data(), chunk.size()); descriptor->set_custom_data(handle, chunk.data(), chunk.size());
if (h2) descriptor->set_custom_data(h2, chunk.data(), chunk.size());
} }
} }


@@ -275,11 +278,13 @@ public:
{ {
const CarlaEngine::ScopedLocker m(x_engine, block); const CarlaEngine::ScopedLocker m(x_engine, block);
descriptor->select_program(handle, midiprog.data[index].bank, midiprog.data[index].program); descriptor->select_program(handle, midiprog.data[index].bank, midiprog.data[index].program);
if (h2) descriptor->select_program(h2, midiprog.data[index].bank, midiprog.data[index].program);
} }
else else
{ {
const ScopedDisabler m(this, block); const ScopedDisabler m(this, block);
descriptor->select_program(handle, midiprog.data[index].bank, midiprog.data[index].program); descriptor->select_program(handle, midiprog.data[index].bank, midiprog.data[index].program);
if (h2) descriptor->select_program(h2, midiprog.data[index].bank, midiprog.data[index].program);
} }
} }




+ 15
- 8
c++/carla-backend/lv2.cpp View File

@@ -810,11 +810,13 @@ public:
{ {
const CarlaEngine::ScopedLocker m(x_engine); const CarlaEngine::ScopedLocker m(x_engine);
status = ext.state->restore(handle, carla_lv2_state_retrieve, this, 0, features); status = ext.state->restore(handle, carla_lv2_state_retrieve, this, 0, features);
if (h2) ext.state->restore(h2, carla_lv2_state_retrieve, this, 0, features);
} }
else else
{ {
const CarlaPlugin::ScopedDisabler m(this); const CarlaPlugin::ScopedDisabler m(this);
status = ext.state->restore(handle, carla_lv2_state_retrieve, this, 0, features); status = ext.state->restore(handle, carla_lv2_state_retrieve, this, 0, features);
if (h2) ext.state->restore(h2, carla_lv2_state_retrieve, this, 0, features);
} }


switch (status) switch (status)
@@ -865,11 +867,13 @@ public:
{ {
const CarlaEngine::ScopedLocker m(x_engine, block); const CarlaEngine::ScopedLocker m(x_engine, block);
ext.programs->select_program(handle, midiprog.data[index].bank, midiprog.data[index].program); ext.programs->select_program(handle, midiprog.data[index].bank, midiprog.data[index].program);
if (h2) ext.programs->select_program(h2, midiprog.data[index].bank, midiprog.data[index].program);
} }
else else
{ {
const ScopedDisabler m(this, block); const ScopedDisabler m(this, block);
ext.programs->select_program(handle, midiprog.data[index].bank, midiprog.data[index].program); ext.programs->select_program(handle, midiprog.data[index].bank, midiprog.data[index].program);
if (h2) ext.programs->select_program(h2, midiprog.data[index].bank, midiprog.data[index].program);
} }
} }


@@ -1642,13 +1646,13 @@ public:
if (descriptor->extension_data) if (descriptor->extension_data)
{ {
if (m_hints & PLUGIN_HAS_EXTENSION_PROGRAMS) if (m_hints & PLUGIN_HAS_EXTENSION_PROGRAMS)
ext.programs = (LV2_Programs_Interface*)descriptor->extension_data(LV2_PROGRAMS__Interface);
ext.programs = (const LV2_Programs_Interface*)descriptor->extension_data(LV2_PROGRAMS__Interface);


if (m_hints & PLUGIN_HAS_EXTENSION_STATE) if (m_hints & PLUGIN_HAS_EXTENSION_STATE)
ext.state = (LV2_State_Interface*)descriptor->extension_data(LV2_STATE__interface);
ext.state = (const LV2_State_Interface*)descriptor->extension_data(LV2_STATE__interface);


if (m_hints & PLUGIN_HAS_EXTENSION_WORKER) if (m_hints & PLUGIN_HAS_EXTENSION_WORKER)
ext.worker = (LV2_Worker_Interface*)descriptor->extension_data(LV2_WORKER__interface);
ext.worker = (const LV2_Worker_Interface*)descriptor->extension_data(LV2_WORKER__interface);
} }


reloadPrograms(true); reloadPrograms(true);
@@ -1754,7 +1758,10 @@ public:
void prepareForSave() void prepareForSave()
{ {
if (ext.state && ext.state->save) if (ext.state && ext.state->save)
{
ext.state->save(handle, carla_lv2_state_store, this, LV2_STATE_IS_POD, features); ext.state->save(handle, carla_lv2_state_store, this, LV2_STATE_IS_POD, features);
if (h2) ext.state->save(h2, carla_lv2_state_store, this, LV2_STATE_IS_POD, features);
}
} }


// ------------------------------------------------------------------- // -------------------------------------------------------------------
@@ -3196,7 +3203,7 @@ public:
{ {
if (ui.descriptor->extension_data) if (ui.descriptor->extension_data)
{ {
ext.uiprograms = (LV2_Programs_UI_Interface*)ui.descriptor->extension_data(LV2_PROGRAMS__UIInterface);
ext.uiprograms = (const LV2_Programs_UI_Interface*)ui.descriptor->extension_data(LV2_PROGRAMS__UIInterface);


if (ext.uiprograms && ! ext.uiprograms->select_program) if (ext.uiprograms && ! ext.uiprograms->select_program)
// invalid // invalid
@@ -4214,10 +4221,10 @@ private:
LV2_Feature* features[lv2_feature_count+1]; LV2_Feature* features[lv2_feature_count+1];


struct { struct {
LV2_State_Interface* state;
LV2_Worker_Interface* worker;
LV2_Programs_Interface* programs;
LV2_Programs_UI_Interface* uiprograms;
const LV2_State_Interface* state;
const LV2_Worker_Interface* worker;
const LV2_Programs_Interface* programs;
const LV2_Programs_UI_Interface* uiprograms;
} ext; } ext;


struct { struct {


Loading…
Cancel
Save