Browse Source

Expose available options per plugin type (unfinished)

tags/1.9.4
falkTX 12 years ago
parent
commit
6d53e73598
5 changed files with 98 additions and 1 deletions
  1. +35
    -1
      source/backend/plugin/DssiPlugin.cpp
  2. +13
    -0
      source/backend/plugin/FluidSynthPlugin.cpp
  3. +14
    -0
      source/backend/plugin/LadspaPlugin.cpp
  4. +12
    -0
      source/backend/plugin/LinuxSamplerPlugin.cpp
  5. +24
    -0
      source/backend/plugin/NativePlugin.cpp

+ 35
- 1
source/backend/plugin/DssiPlugin.cpp View File

@@ -138,6 +138,40 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int availableOptions()
{
CARLA_ASSERT(fDescriptor != nullptr);

const bool isDssiVst = fFilename.contains("dssi-vst", true);
unsigned int options = 0x0;

options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

//if ((kData->audioIns.count() == 1 || kData->audioOuts.count() == 0) || (kData->audioIns.count() == 0 || kData->audioOuts.count() == 1))
// options |= PLUGIN_OPTION_FORCE_STEREO;

if (isDssiVst)
{
if (fDescriptor != nullptr && fDssiDescriptor->get_custom_data != nullptr && fDssiDescriptor->set_custom_data != nullptr)
options |= PLUGIN_OPTION_USE_CHUNKS;
}
else
{
options |= PLUGIN_OPTION_FIXED_BUFFER;
}

if (kData->extraHints & PLUGIN_HINT_HAS_MIDI_IN)
{
options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES;
options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE;
options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH;
options |= PLUGIN_OPTION_SEND_PITCHBEND;
options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF;
}

return options;
}

float getParameterValue(const uint32_t parameterId) float getParameterValue(const uint32_t parameterId)
{ {
CARLA_ASSERT(parameterId < kData->param.count); CARLA_ASSERT(parameterId < kData->param.count);
@@ -670,7 +704,7 @@ public:


// plugin hints // plugin hints
const bool haveGUI = (fHints & PLUGIN_HAS_GUI); const bool haveGUI = (fHints & PLUGIN_HAS_GUI);
const bool isDssiVst = QString(fFilename).endsWith("dssi-vst.so", Qt::CaseInsensitive);
const bool isDssiVst = fFilename.contains("dssi-vst", true);


fHints = 0x0; fHints = 0x0;




+ 13
- 0
source/backend/plugin/FluidSynthPlugin.cpp View File

@@ -111,6 +111,19 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int availableOptions()
{
unsigned int options = 0x0;

options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES;
options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE;
options |= PLUGIN_OPTION_SEND_PITCHBEND;
options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF;

return options;
}

float getParameterValue(const uint32_t parameterId) float getParameterValue(const uint32_t parameterId)
{ {
CARLA_ASSERT(parameterId < kData->param.count); CARLA_ASSERT(parameterId < kData->param.count);


+ 14
- 0
source/backend/plugin/LadspaPlugin.cpp View File

@@ -150,6 +150,20 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int availableOptions()
{
const bool isDssiVst = fFilename.contains("dssi-vst", true);
unsigned int options = 0x0;

if (! isDssiVst)
options |= PLUGIN_OPTION_FIXED_BUFFER;

//if ((kData->audioIns.count() == 1 || kData->audioOuts.count() == 0) || (kData->audioIns.count() == 0 || kData->audioOuts.count() == 1))
// options |= PLUGIN_OPTION_FORCE_STEREO;

return options;
}

float getParameterValue(const uint32_t parameterId) float getParameterValue(const uint32_t parameterId)
{ {
CARLA_ASSERT(parameterId < kData->param.count); CARLA_ASSERT(parameterId < kData->param.count);


+ 12
- 0
source/backend/plugin/LinuxSamplerPlugin.cpp View File

@@ -228,6 +228,18 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int availableOptions()
{
unsigned int options = 0x0;

options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES;
options |= PLUGIN_OPTION_SEND_PITCHBEND;
options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF;

return options;
}

void getLabel(char* const strBuf) void getLabel(char* const strBuf)
{ {
std::strncpy(strBuf, (const char*)fLabel, STR_MAX); std::strncpy(strBuf, (const char*)fLabel, STR_MAX);


+ 24
- 0
source/backend/plugin/NativePlugin.cpp View File

@@ -201,6 +201,30 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int availableOptions()
{
CARLA_ASSERT(fDescriptor != nullptr);

unsigned int options = 0x0;

options |= PLUGIN_OPTION_FIXED_BUFFER;
options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

//if ((kData->audioIns.count() == 1 || kData->audioOuts.count() == 0) || (kData->audioIns.count() == 0 || kData->audioOuts.count() == 1))
// options |= PLUGIN_OPTION_FORCE_STEREO;

if (fMidiIn.count > 0)
{
options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES;
options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE;
options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH;
options |= PLUGIN_OPTION_SEND_PITCHBEND;
options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF;
}

return options;
}

float getParameterValue(const uint32_t parameterId) float getParameterValue(const uint32_t parameterId)
{ {
CARLA_ASSERT(fDescriptor != nullptr); CARLA_ASSERT(fDescriptor != nullptr);


Loading…
Cancel
Save