Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
psycha0s committed Apr 20, 2015
2 parents 6761c8a + b04e2e3 commit cf494db
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 53 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(${PROJECT_NAME})
# Project version
set(VERSION_MAJOR 1)
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)
set(VERSION_PATCH 1)

# Set plugin shared library base name
set(PLUGIN_BASENAME ${PROJECT_NAME}-plugin)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The following list is not complete. It contains only plugins, that have been tes
VST-Plugins | works? | Notes |
------------:|:----------:|:-------|
AlgoMusic CZythia | yes |
AlgoMusic CZynthia | yes |
Aly James LAB OB-Xtreme | yes |
Blue Cat Audio Oscilloscope Multi | no | doesn't work with wine
Credland Audio BigKick | no | doesn't work with wine
Expand Down Expand Up @@ -106,6 +106,7 @@ The following list is not complete. It contains only plugins, that have been tes
Smartelectronix s(M)exoscope | yes |
SQ8L by Siegfried Kullmann | yes |
SuperWave P8 | yes |
Synapse Audio DUNE 2 | yes |
Synth1 by Ichiro Toda | yes |
Tone2 FireBird | yes |
Tone2 Nemesis | yes |
Expand Down
89 changes: 38 additions & 51 deletions src/plugin/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,8 @@ intptr_t Plugin::handleAudioMaster()
intptr_t Plugin::dispatch(DataPort* port, i32 opcode, i32 index, intptr_t value,
void* ptr, float opt)
{
// if(opcode != effCanBeAutomated && opcode != effGetProgramNameIndexed &&
// opcode != effEditIdle && opcode != effGetParamDisplay &&
// opcode != effGetParamLabel && opcode != effGetParameterProperties) {
// FLOOD("dispatch: %s", kDispatchEvents[opcode]);
// }

if(opcode != effEditIdle && opcode) {
if(opcode != effEditIdle && opcode)
FLOOD("(%p) dispatch: %s", std::this_thread::get_id(), kDispatchEvents[opcode]);
}

DataFrame* frame = port->frame<DataFrame>();
frame->command = Command::Dispatch;
Expand Down Expand Up @@ -382,19 +375,16 @@ intptr_t Plugin::dispatch(DataPort* port, i32 opcode, i32 index, intptr_t value,
port->waitResponse();
return frame->value; }

case effGetProgramName:
case effGetProgramName: {
port->sendRequest();
port->waitResponse();

if(frame->value) {
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);

std::strncpy(dest, source, kVstMaxProgNameLen);
dest[kVstMaxProgNameLen-1] = '\0';
}
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);

return frame->value;
std::strncpy(dest, source, kVstMaxProgNameLen);
dest[kVstMaxProgNameLen-1] = '\0';
return frame->value; }

case effSetProgramName: {
const char* source = static_cast<const char*>(ptr);
Expand All @@ -408,49 +398,49 @@ intptr_t Plugin::dispatch(DataPort* port, i32 opcode, i32 index, intptr_t value,
return frame->value; }

case effGetVendorString:
case effGetProductString:
case effGetProductString: {
port->sendRequest();
port->waitResponse();

if(frame->value) {
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);

std::strncpy(dest, source, kVstMaxVendorStrLen);
dest[kVstMaxVendorStrLen-1] = '\0';
}
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);

return frame->value;
std::strncpy(dest, source, kVstMaxVendorStrLen);
dest[kVstMaxVendorStrLen-1] = '\0';
return frame->value; }

case effGetParamName:
case effGetParamLabel:
case effGetParamDisplay:
case effGetParamDisplay: {
port->sendRequest();
port->waitResponse();

if(frame->value) {
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);

// std::strncpy(dest, source, kVstMaxParamStrLen);
// dest[kVstMaxParamStrLen-1] = '\0';

std::strncpy(dest, source, kVstMaxParamStrLen);
dest[kVstMaxParamStrLen-1] = '\0';
// Workaround for Variety of Sound plugins bug (non-printable characters)
int i;
for(i = 0; i < kVstMaxParamStrLen - 1; ++i) {
if(isprint(source[i]))
dest[i] = source[i];
}

return frame->value;
dest[i] = '\0';
return frame->value; }

case effGetEffectName:
case effGetEffectName: {
port->sendRequest();
port->waitResponse();

if(frame->value) {
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);

std::strncpy(dest, source, kVstMaxEffectNameLen);
dest[kVstMaxEffectNameLen-1] = '\0';
}
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);

return frame->value;
std::strncpy(dest, source, kVstMaxEffectNameLen);
dest[kVstMaxEffectNameLen-1] = '\0';
return frame->value; }

case effGetParameterProperties:
port->sendRequest();
Expand All @@ -467,19 +457,16 @@ intptr_t Plugin::dispatch(DataPort* port, i32 opcode, i32 index, intptr_t value,
std::memcpy(ptr, frame->data, sizeof(VstPinProperties));
return frame->value;

case effGetProgramNameIndexed:
case effGetProgramNameIndexed: {
port->sendRequest();
port->waitResponse();

if(frame->value) {
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);
const char* source = reinterpret_cast<const char*>(frame->data);
char* dest = static_cast<char*>(ptr);

std::strncpy(dest, source, kVstMaxProgNameLen);
dest[kVstMaxProgNameLen-1] = '\0';
}

return frame->value;
std::strncpy(dest, source, kVstMaxProgNameLen);
dest[kVstMaxProgNameLen-1] = '\0';
return frame->value; }

case effGetMidiKeyName:
port->sendRequest();
Expand Down

0 comments on commit cf494db

Please sign in to comment.