Browse Source

Remove forced-testing LS 16out; implement LS 16out on discovery

tags/1.9.4
falkTX 11 years ago
parent
commit
2f69104066
7 changed files with 67 additions and 62 deletions
  1. +4
    -14
      source/backend/plugin/BridgePlugin.cpp
  2. +1
    -1
      source/backend/plugin/DssiPlugin.cpp
  3. +1
    -4
      source/backend/plugin/LinuxSamplerPlugin.cpp
  4. +8
    -18
      source/backend/plugin/Lv2Plugin.cpp
  5. +3
    -2
      source/backend/plugin/NativePlugin.cpp
  6. +3
    -8
      source/backend/plugin/VstPlugin.cpp
  7. +47
    -15
      source/discovery/carla-discovery.cpp

+ 4
- 14
source/backend/plugin/BridgePlugin.cpp View File

@@ -477,14 +477,9 @@ public:
CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback);
}

void setProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
{
CARLA_ASSERT(index >= -1 && index < static_cast<int32_t>(pData->prog.count));

if (index < -1)
index = -1;
else if (index > static_cast<int32_t>(pData->prog.count))
return;
CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->prog.count),);

const bool doLock(sendGui || sendOsc || sendCallback);

@@ -503,14 +498,9 @@ public:
CarlaPlugin::setProgram(index, sendGui, sendOsc, sendCallback);
}

void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
{
CARLA_ASSERT(index >= -1 && index < static_cast<int32_t>(pData->midiprog.count));

if (index < -1)
index = -1;
else if (index > static_cast<int32_t>(pData->midiprog.count))
return;
CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->midiprog.count),);

const bool doLock(sendGui || sendOsc || sendCallback);



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

@@ -331,7 +331,7 @@ public:
fDssiDescriptor->set_custom_data(fHandle, chunk.data(), chunk.size());
}

void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
{
CARLA_SAFE_ASSERT_RETURN(fDssiDescriptor != nullptr,);
CARLA_SAFE_ASSERT_RETURN(fDssiDescriptor->select_program != nullptr,);


+ 1
- 4
source/backend/plugin/LinuxSamplerPlugin.cpp View File

@@ -1349,11 +1349,8 @@ CARLA_BACKEND_END_NAMESPACE

CARLA_BACKEND_START_NAMESPACE

CarlaPlugin* CarlaPlugin::newLinuxSampler(const Initializer& init, const char* const format, const bool /*use16Outs*/)
CarlaPlugin* CarlaPlugin::newLinuxSampler(const Initializer& init, const char* const format, const bool use16Outs)
{
// TESTING
const bool use16Outs = true;

carla_debug("LinuxSamplerPlugin::newLinuxSampler({%p, \"%s\", \"%s\", \"%s\"}, %s, %s)", init.engine, init.filename, init.name, init.label, format, bool2str(use16Outs));

#ifdef WANT_LINUXSAMPLER


+ 8
- 18
source/backend/plugin/Lv2Plugin.cpp View File

@@ -996,16 +996,11 @@ public:
}
}

void setProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
{
CARLA_ASSERT(fRdfDescriptor != nullptr);
CARLA_ASSERT(index >= -1 && index < static_cast<int32_t>(fRdfDescriptor->PresetCount));
CARLA_ASSERT(sendGui || sendOsc || sendCallback); // never call this from RT

if (index < -1)
index = -1;
else if (index > static_cast<int32_t>(fRdfDescriptor->PresetCount))
return;
CARLA_SAFE_ASSERT_RETURN(fRdfDescriptor != nullptr,);
CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(fRdfDescriptor->PresetCount),);
CARLA_SAFE_ASSERT_RETURN(sendGui || sendOsc || sendCallback,); // never call this from RT

if (index >= 0 && index < static_cast<int32_t>(fRdfDescriptor->PresetCount))
{
@@ -1025,16 +1020,11 @@ public:
CarlaPlugin::setProgram(index, sendGui, sendOsc, sendCallback);
}

void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
{
CARLA_ASSERT(fDescriptor != nullptr);
CARLA_ASSERT(fHandle != nullptr);
CARLA_ASSERT(index >= -1 && index < static_cast<int32_t>(pData->midiprog.count));

if (index < -1)
index = -1;
else if (index > static_cast<int32_t>(pData->midiprog.count))
return;
CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,);
CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr,);
CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->midiprog.count),);

if (index >= 0 && fExt.programs != nullptr && fExt.programs->select_program != nullptr)
{


+ 3
- 2
source/backend/plugin/NativePlugin.cpp View File

@@ -596,14 +596,15 @@ public:
CarlaPlugin::setCustomData(type, key, value, sendGui);
}

void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
{
CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,);
CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr,);
CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->midiprog.count),);

// TODO, put into check below
if ((pData->hints & PLUGIN_IS_SYNTH) != 0 && (pData->ctrlChannel < 0 || pData->ctrlChannel >= MAX_MIDI_CHANNELS))
return;
return CarlaPlugin::setMidiProgram(index, sendGui, sendOsc, sendCallback);

if (index >= 0)
{


+ 3
- 8
source/backend/plugin/VstPlugin.cpp View File

@@ -338,15 +338,10 @@ public:
// }
}

void setProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override
{
CARLA_ASSERT(fEffect != nullptr);
CARLA_ASSERT(index >= -1 && index < static_cast<int32_t>(pData->prog.count));

if (index < -1)
index = -1;
else if (index > static_cast<int32_t>(pData->prog.count))
return;
CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr,);
CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->prog.count),);

if (index >= 0)
{


+ 47
- 15
source/discovery/carla-discovery.cpp View File

@@ -363,26 +363,56 @@ public:

static void outputInfo(const LinuxSampler::InstrumentManager::instrument_info_t* const info, const size_t programs, const char* const basename = nullptr)
{
CarlaString name;
const char* label;

if (info != nullptr)
{
name = info->InstrumentName.c_str();
label = info->Product.c_str();
}
else
{
name = basename;
label = basename;
}

// 2 channels
DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", (const char*)name);
DISCOVERY_OUT("label", label);

if (info != nullptr)
{
DISCOVERY_OUT("name", info->InstrumentName);
DISCOVERY_OUT("label", info->Product);
DISCOVERY_OUT("maker", info->Artists);
DISCOVERY_OUT("copyright", info->Artists);
}
else if (basename != nullptr && basename[0] != '\0')

DISCOVERY_OUT("hints", PLUGIN_IS_SYNTH);
DISCOVERY_OUT("audio.outs", 2);
DISCOVERY_OUT("midi.ins", 1);
DISCOVERY_OUT("programs", programs);
DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("end", "------------");

if (name.isEmpty())
return;
name += " (16 outputs)";

// 16 channels
DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", (const char*)name);
DISCOVERY_OUT("label", label);

if (info != nullptr)
{
DISCOVERY_OUT("name", basename);
DISCOVERY_OUT("label", basename);
DISCOVERY_OUT("maker", info->Artists);
DISCOVERY_OUT("copyright", info->Artists);
}

DISCOVERY_OUT("hints", PLUGIN_IS_SYNTH);
DISCOVERY_OUT("audio.outs", 2);
DISCOVERY_OUT("midi.ins", 1);
//DISCOVERY_OUT("parameters.ins", 13); // defined in Carla, TODO
//DISCOVERY_OUT("parameters.outs", 1);
DISCOVERY_OUT("programs", programs);
DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("end", "------------");
@@ -1660,8 +1690,13 @@ void do_fluidsynth_check(const char* const filename, const bool init)
delete_fluid_settings(f_settings);
}

// FIXME
CarlaString name(std::strrchr(filename, OS_SEP)+1);
CarlaString name;

if (const char* const shortname = std::strrchr(filename, OS_SEP))
name = shortname+1;
else
name = filename;

name.truncate(name.rfind('.'));

CarlaString label(name);
@@ -1670,8 +1705,6 @@ void do_fluidsynth_check(const char* const filename, const bool init)
DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", (const char*)name);
DISCOVERY_OUT("label", (const char*)label);
DISCOVERY_OUT("maker", "");
DISCOVERY_OUT("copyright", "");
DISCOVERY_OUT("hints", PLUGIN_IS_SYNTH);
DISCOVERY_OUT("audio.outs", 2);
DISCOVERY_OUT("midi.ins", 1);
@@ -1682,14 +1715,13 @@ void do_fluidsynth_check(const char* const filename, const bool init)
DISCOVERY_OUT("end", "------------");

// 16 channels
if (name.isNotEmpty())
name += " (16 outputs)";
if (name.isEmpty())
return;
name += " (16 outputs)";

DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", "");
DISCOVERY_OUT("name", (const char*)name);
DISCOVERY_OUT("label", (const char*)label);
DISCOVERY_OUT("copyright", "");
DISCOVERY_OUT("hints", PLUGIN_IS_SYNTH);
DISCOVERY_OUT("audio.outs", 32);
DISCOVERY_OUT("midi.ins", 1);


Loading…
Cancel
Save