Skip to content

Commit

Permalink
* Patch from Pawel Piatek to speed up listing program names
Browse files Browse the repository at this point in the history
  • Loading branch information
cannam committed Jan 25, 2011
1 parent 2585a2f commit e15c66c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
21 changes: 13 additions & 8 deletions dssi-vst-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,19 @@ RemoteVSTServer::getProgramName(int p)
pthread_mutex_lock(&mutex);

char name[24];
// effGetProgramName appears to return the name of the current
// program, not program <index> -- though we pass in <index> as
// well, just in case
long prevProgram =
m_plugin->dispatcher(m_plugin, effGetProgram, 0, 0, NULL, 0);
m_plugin->dispatcher(m_plugin, effSetProgram, 0, p, NULL, 0);
m_plugin->dispatcher(m_plugin, effGetProgramName, p, 0, name, 0);
m_plugin->dispatcher(m_plugin, effSetProgram, 0, prevProgram, NULL, 0);

if (m_plugin->dispatcher(m_plugin, effGetVstVersion, 0, 0, NULL, 0) < 2) {

long prevProgram =
m_plugin->dispatcher(m_plugin, effGetProgram, 0, 0, NULL, 0);

m_plugin->dispatcher(m_plugin, effSetProgram, 0, p, NULL, 0);
m_plugin->dispatcher(m_plugin, effGetProgramName, p, 0, name, 0);
m_plugin->dispatcher(m_plugin, effSetProgram, 0, prevProgram, NULL, 0);

} else {
m_plugin->dispatcher(m_plugin, effGetProgramNameIndexed, p, 0, name, 0);
}

pthread_mutex_unlock(&mutex);
return name;
Expand Down
1 change: 1 addition & 0 deletions vestige/aeffectx.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ int effEditOpen = 14;
int effEditClose = 15;
int effEditIdle = 19;
int effProcessEvents = 25;
int effGetProgramNameIndexed = 29;
int effGetEffectName = 45;
int effGetParameterProperties = 47; // missing
int effGetVendorString = 47;
Expand Down

0 comments on commit e15c66c

Please sign in to comment.