Don't load program 0 on initialising a VST; I don't
think we do that for any other plugins. Restore chunk-based preset loading for Linux VSTs. git-svn-id: svn://localhost/ardour2/branches/3.0@10805 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e8ee8593c7
commit
9040712ab9
|
@ -287,6 +287,29 @@ dispatch_x_events (XEvent* event, VSTState* vstfx)
|
||||||
vstfx->eventProc((void*)event);
|
vstfx->eventProc((void*)event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
maybe_set_program (VSTState* vstfx)
|
||||||
|
{
|
||||||
|
if (vstfx->want_program != -1) {
|
||||||
|
if (vstfx->vst_version >= 2) {
|
||||||
|
vstfx->plugin->dispatcher (vstfx->plugin, 67 /* effBeginSetProgram */, 0, 0, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
vstfx->plugin->dispatcher (vstfx->plugin, effSetProgram, 0, vstfx->want_program, NULL, 0);
|
||||||
|
|
||||||
|
if (vstfx->vst_version >= 2) {
|
||||||
|
vstfx->plugin->dispatcher (vstfx->plugin, 68 /* effEndSetProgram */, 0, 0, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
vstfx->want_program = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vstfx->want_chunk == 1) {
|
||||||
|
vstfx->plugin->dispatcher (vstfx->plugin, 24 /* effSetChunk */, 1, vstfx->wanted_chunk_size, vstfx->wanted_chunk, 0);
|
||||||
|
vstfx->want_chunk = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** This is the main gui event loop for the plugin, we also need to pass
|
/** This is the main gui event loop for the plugin, we also need to pass
|
||||||
any Xevents to all the UI callbacks plugins 'may' have registered on their
|
any Xevents to all the UI callbacks plugins 'may' have registered on their
|
||||||
windows, that is if they don't manage their own UIs **/
|
windows, that is if they don't manage their own UIs **/
|
||||||
|
@ -391,24 +414,9 @@ again:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Scheduled for setting a new program*/
|
maybe_set_program (vstfx);
|
||||||
|
vstfx->want_program = -1;
|
||||||
if (vstfx->want_program != -1 )
|
vstfx->want_chunk = 0;
|
||||||
{
|
|
||||||
if (vstfx->vst_version >= 2)
|
|
||||||
{
|
|
||||||
vstfx->plugin->dispatcher (vstfx->plugin, 67 /* effBeginSetProgram */, 0, 0, NULL, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
vstfx->plugin->dispatcher (vstfx->plugin, effSetProgram, 0, vstfx->want_program, NULL, 0);
|
|
||||||
|
|
||||||
if (vstfx->vst_version >= 2)
|
|
||||||
{
|
|
||||||
vstfx->plugin->dispatcher (vstfx->plugin, 68 /* effEndSetProgram */, 0, 0, NULL, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
vstfx->want_program = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*scheduled call to dispatcher*/
|
/*scheduled call to dispatcher*/
|
||||||
|
|
||||||
|
|
|
@ -56,10 +56,6 @@ VSTPlugin::set_plugin (AEffect* e)
|
||||||
|
|
||||||
_plugin->dispatcher (_plugin, effSetSampleRate, 0, 0, NULL, (float) _session.frame_rate());
|
_plugin->dispatcher (_plugin, effSetSampleRate, 0, 0, NULL, (float) _session.frame_rate());
|
||||||
_plugin->dispatcher (_plugin, effSetBlockSize, 0, _session.get_block_size(), NULL, 0.0f);
|
_plugin->dispatcher (_plugin, effSetBlockSize, 0, _session.get_block_size(), NULL, 0.0f);
|
||||||
|
|
||||||
/* set program to zero */
|
|
||||||
|
|
||||||
_plugin->dispatcher (_plugin, effSetProgram, 0, 0, NULL, 0.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -385,8 +381,8 @@ VSTPlugin::load_user_preset (PresetRecord r)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
|
for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
|
||||||
if ((*j)->name() == X_("Parameter")) {
|
if ((*j)->name() == X_("Parameter")) {
|
||||||
XMLProperty* index = (*j)->property (X_("index"));
|
XMLProperty* index = (*j)->property (X_("index"));
|
||||||
|
@ -425,8 +421,7 @@ VSTPlugin::do_save_preset (string name)
|
||||||
p->add_content (string (data));
|
p->add_content (string (data));
|
||||||
g_free (data);
|
g_free (data);
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
p = new XMLNode (X_("Preset"));
|
p = new XMLNode (X_("Preset"));
|
||||||
p->add_property (X_("uri"), uri);
|
p->add_property (X_("uri"), uri);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user