Browse Source

Misc fixing; LinuxSampler support in carla-discovery (for GIG and SFZ)

tags/v0.9.0
falkTX 13 years ago
parent
commit
13d1ef6b06
10 changed files with 314 additions and 200 deletions
  1. +3
    -1
      src/carla-backend/carla_backend.h
  2. +1
    -1
      src/carla-backend/carla_shared.cpp
  3. +2
    -2
      src/carla-backend/dssi.cpp
  4. +22
    -57
      src/carla-backend/lv2.cpp
  5. +261
    -121
      src/carla-discovery/carla-discovery.cpp
  6. +2
    -2
      src/carla-discovery/qtcreator/carla-discovery.pro
  7. +1
    -1
      src/carla.py
  8. +3
    -1
      src/carla_backend.py
  9. BIN
      src/icons/bitmaps/carla_knobs1.png
  10. +19
    -14
      src/pixmapdial.py

+ 3
- 1
src/carla-backend/carla_backend.h View File

@@ -77,7 +77,9 @@ enum PluginType {
PLUGIN_DSSI = 2,
PLUGIN_LV2 = 3,
PLUGIN_VST = 4,
PLUGIN_SF2 = 5
PLUGIN_GIG = 5,
PLUGIN_SF2 = 6,
PLUGIN_SFZ = 7
};

enum PluginCategory {


+ 1
- 1
src/carla-backend/carla_shared.cpp View File

@@ -39,7 +39,7 @@ volatile double aouts_peak[MAX_PLUGINS*2] = { 0.0 };
carla_options_t carla_options = {
/* global_jack_client */ true,
/* prefer_ui_bridges */ true,
/* proccess_hq */ true,
/* proccess_hq */ false,
/* bridge_unix32 */ nullptr,
/* bridge_unix64 */ nullptr,
/* bridge_win32 */ nullptr,


+ 2
- 2
src/carla-backend/dssi.cpp View File

@@ -592,8 +592,8 @@ public:
if (midi.port_min && aout.count > 0)
m_hints |= PLUGIN_IS_SYNTH;

#if 0
if (carla_options.use_dssi_chunks && QString(m_filename).endsWith("dssi-vst.so", Qt::CaseInsensitive))
#if 1
if (/*carla_options.use_dssi_chunks &&*/ QString(m_filename).endsWith("dssi-vst.so", Qt::CaseInsensitive))
{
if (descriptor->get_custom_data && descriptor->set_custom_data)
m_hints |= PLUGIN_USES_CHUNKS;


+ 22
- 57
src/carla-backend/lv2.cpp View File

@@ -37,6 +37,7 @@ CARLA_BACKEND_START_NAMESPACE

// static max values
const unsigned int MAX_EVENT_BUFFER = 8192; // 0x2000
//const unsigned int MAX_EVENT_BUFFER = (sizeof(LV2_Atom_Event) + 4) * MAX_MIDI_EVENTS;

// extra plugin hints
const unsigned int PLUGIN_HAS_EXTENSION_DYNPARAM = 0x0100;
@@ -3131,43 +3132,7 @@ public:
static uint32_t carla_lv2_uri_to_id(LV2_URI_Map_Callback_Data data, const char* map, const char* uri)
{
qDebug("Lv2Plugin::carla_lv2_uri_to_id(%p, %s, %s)", data, map, uri);

// Atom types
if (strcmp(uri, LV2_ATOM__Chunk) == 0)
return CARLA_URI_MAP_ID_ATOM_CHUNK;
else if (strcmp(uri, LV2_ATOM__Path) == 0)
return CARLA_URI_MAP_ID_ATOM_PATH;
else if (strcmp(uri, LV2_ATOM__Sequence) == 0)
return CARLA_URI_MAP_ID_ATOM_SEQUENCE;
else if (strcmp(uri, LV2_ATOM__String) == 0)
return CARLA_URI_MAP_ID_ATOM_STRING;
else if (strcmp(uri, LV2_ATOM__atomTransfer) == 0)
return CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM;
else if (strcmp(uri, LV2_ATOM__eventTransfer) == 0)
return CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT;

// Log types
else if (strcmp(uri, LV2_LOG__Error) == 0)
return CARLA_URI_MAP_ID_LOG_ERROR;
else if (strcmp(uri, LV2_LOG__Note) == 0)
return CARLA_URI_MAP_ID_LOG_NOTE;
else if (strcmp(uri, LV2_LOG__Trace) == 0)
return CARLA_URI_MAP_ID_LOG_TRACE;
else if (strcmp(uri, LV2_LOG__Warning) == 0)
return CARLA_URI_MAP_ID_LOG_WARNING;

// Others
else if (strcmp(uri, LV2_MIDI__MidiEvent) == 0)
return CARLA_URI_MAP_ID_MIDI_EVENT;

// Custom types
if (data)
{
Lv2Plugin* plugin = (Lv2Plugin*)data;
return plugin->get_custom_uri_id(uri);
}

return CARLA_URI_MAP_ID_NULL;
return carla_lv2_urid_map(data, uri);
}

// ----------------- URID Feature ----------------------------------------------------
@@ -3178,29 +3143,29 @@ public:
// Atom types
if (strcmp(uri, LV2_ATOM__Chunk) == 0)
return CARLA_URI_MAP_ID_ATOM_CHUNK;
else if (strcmp(uri, LV2_ATOM__Path) == 0)
if (strcmp(uri, LV2_ATOM__Path) == 0)
return CARLA_URI_MAP_ID_ATOM_PATH;
else if (strcmp(uri, LV2_ATOM__Sequence) == 0)
if (strcmp(uri, LV2_ATOM__Sequence) == 0)
return CARLA_URI_MAP_ID_ATOM_SEQUENCE;
else if (strcmp(uri, LV2_ATOM__String) == 0)
if (strcmp(uri, LV2_ATOM__String) == 0)
return CARLA_URI_MAP_ID_ATOM_STRING;
else if (strcmp(uri, LV2_ATOM__atomTransfer) == 0)
if (strcmp(uri, LV2_ATOM__atomTransfer) == 0)
return CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM;
else if (strcmp(uri, LV2_ATOM__eventTransfer) == 0)
if (strcmp(uri, LV2_ATOM__eventTransfer) == 0)
return CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT;

// Log types
else if (strcmp(uri, LV2_LOG__Error) == 0)
if (strcmp(uri, LV2_LOG__Error) == 0)
return CARLA_URI_MAP_ID_LOG_ERROR;
else if (strcmp(uri, LV2_LOG__Note) == 0)
if (strcmp(uri, LV2_LOG__Note) == 0)
return CARLA_URI_MAP_ID_LOG_NOTE;
else if (strcmp(uri, LV2_LOG__Trace) == 0)
if (strcmp(uri, LV2_LOG__Trace) == 0)
return CARLA_URI_MAP_ID_LOG_TRACE;
else if (strcmp(uri, LV2_LOG__Warning) == 0)
if (strcmp(uri, LV2_LOG__Warning) == 0)
return CARLA_URI_MAP_ID_LOG_WARNING;

// Others
else if (strcmp(uri, LV2_MIDI__MidiEvent) == 0)
if (strcmp(uri, LV2_MIDI__MidiEvent) == 0)
return CARLA_URI_MAP_ID_MIDI_EVENT;

// Custom types
@@ -3220,29 +3185,29 @@ public:
// Atom types
if (urid == CARLA_URI_MAP_ID_ATOM_CHUNK)
return LV2_ATOM__Chunk;
else if (urid == CARLA_URI_MAP_ID_ATOM_PATH)
if (urid == CARLA_URI_MAP_ID_ATOM_PATH)
return LV2_ATOM__Path;
else if (urid == CARLA_URI_MAP_ID_ATOM_SEQUENCE)
if (urid == CARLA_URI_MAP_ID_ATOM_SEQUENCE)
return LV2_ATOM__Sequence;
else if (urid == CARLA_URI_MAP_ID_ATOM_STRING)
if (urid == CARLA_URI_MAP_ID_ATOM_STRING)
return LV2_ATOM__String;
else if (urid == CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM)
if (urid == CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM)
return LV2_ATOM__atomTransfer;
else if (urid == CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT)
if (urid == CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT)
return LV2_ATOM__eventTransfer;

// Log types
else if (urid == CARLA_URI_MAP_ID_LOG_ERROR)
if (urid == CARLA_URI_MAP_ID_LOG_ERROR)
return LV2_LOG__Error;
else if (urid == CARLA_URI_MAP_ID_LOG_NOTE)
if (urid == CARLA_URI_MAP_ID_LOG_NOTE)
return LV2_LOG__Note;
else if (urid == CARLA_URI_MAP_ID_LOG_TRACE)
if (urid == CARLA_URI_MAP_ID_LOG_TRACE)
return LV2_LOG__Trace;
else if (urid == CARLA_URI_MAP_ID_LOG_WARNING)
if (urid == CARLA_URI_MAP_ID_LOG_WARNING)
return LV2_LOG__Warning;

// Others
else if (urid == CARLA_URI_MAP_ID_MIDI_EVENT)
if (urid == CARLA_URI_MAP_ID_MIDI_EVENT)
return LV2_MIDI__MidiEvent;

// Custom types


+ 261
- 121
src/carla-discovery/carla-discovery.cpp View File

@@ -25,6 +25,9 @@
#include <cstring>
#include <iostream>

#include <QtCore/QFileInfo>
#include <QtCore/QUrl>

#include "ladspa/ladspa.h"
#include "dssi/dssi.h"
#include "lv2_rdf.h"
@@ -33,6 +36,10 @@
#include <fluidsynth.h>
#endif

#ifdef WANT_LINUXSAMPLER
#include "linuxsampler/EngineFactory.h"
#endif

#define CARLA_BACKEND_NO_EXPORTS
#define CARLA_BACKEND_NO_NAMESPACE
#include "carla_backend.h"
@@ -175,7 +182,7 @@ intptr_t VstHostCallback(AEffect* effect, int32_t opcode, int32_t index, intptr_

// ------------------------------ Plugin Checks -----------------------------

void do_ladspa_check(void* lib_handle)
void do_ladspa_check(void* lib_handle, bool init)
{
LADSPA_Descriptor_Function descfn = (LADSPA_Descriptor_Function)lib_symbol(lib_handle, "ladspa_descriptor");

@@ -190,42 +197,53 @@ void do_ladspa_check(void* lib_handle)

while ((descriptor = descfn(i++)))
{
LADSPA_Handle handle = descriptor->instantiate(descriptor, sampleRate);
LADSPA_Handle handle = nullptr;

if (handle)
if (init)
{
int hints = 0;
int audio_ins = 0;
int audio_outs = 0;
int audio_total = 0;
int parameters_ins = 0;
int parameters_outs = 0;
int parameters_total = 0;

for (unsigned long j=0; j < descriptor->PortCount; j++)
handle = descriptor->instantiate(descriptor, sampleRate);

if (! handle)
{
const LADSPA_PortDescriptor PortDescriptor = descriptor->PortDescriptors[j];
if (LADSPA_IS_PORT_AUDIO(PortDescriptor))
{
if (LADSPA_IS_PORT_INPUT(PortDescriptor))
audio_ins += 1;
else if (LADSPA_IS_PORT_OUTPUT(PortDescriptor))
audio_outs += 1;
audio_total += 1;
}
else if (LADSPA_IS_PORT_CONTROL(PortDescriptor))
DISCOVERY_OUT("error", "Failed to init LADSPA plugin");
continue;
}
}

int hints = 0;
int audio_ins = 0;
int audio_outs = 0;
int audio_total = 0;
int parameters_ins = 0;
int parameters_outs = 0;
int parameters_total = 0;

for (unsigned long j=0; j < descriptor->PortCount; j++)
{
const LADSPA_PortDescriptor PortDescriptor = descriptor->PortDescriptors[j];
if (LADSPA_IS_PORT_AUDIO(PortDescriptor))
{
if (LADSPA_IS_PORT_INPUT(PortDescriptor))
audio_ins += 1;
else if (LADSPA_IS_PORT_OUTPUT(PortDescriptor))
audio_outs += 1;
audio_total += 1;
}
else if (LADSPA_IS_PORT_CONTROL(PortDescriptor))
{
if (LADSPA_IS_PORT_INPUT(PortDescriptor))
parameters_ins += 1;
else if (LADSPA_IS_PORT_OUTPUT(PortDescriptor))
{
if (LADSPA_IS_PORT_INPUT(PortDescriptor))
parameters_ins += 1;
else if (LADSPA_IS_PORT_OUTPUT(PortDescriptor))
{
if (strcmp(descriptor->PortNames[j], "latency") != 0 && strcmp(descriptor->PortNames[j], "_latency") != 0)
parameters_outs += 1;
}
parameters_total += 1;
if (strcmp(descriptor->PortNames[j], "latency") != 0 && strcmp(descriptor->PortNames[j], "_latency") != 0)
parameters_outs += 1;
}
parameters_total += 1;
}
}

if (init)
{
// -----------------------------------------------------------------------
// start crash-free plugin test

@@ -365,33 +383,31 @@ void do_ladspa_check(void* lib_handle)

// end crash-free plugin test
// -----------------------------------------------------------------------
}

DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", descriptor->Name);
DISCOVERY_OUT("label", descriptor->Label);
DISCOVERY_OUT("maker", descriptor->Maker);
DISCOVERY_OUT("copyright", descriptor->Copyright);
DISCOVERY_OUT("unique_id", descriptor->UniqueID);
DISCOVERY_OUT("hints", hints);
DISCOVERY_OUT("audio.ins", audio_ins);
DISCOVERY_OUT("audio.outs", audio_outs);
DISCOVERY_OUT("audio.total", audio_total);
DISCOVERY_OUT("parameters.ins", parameters_ins);
DISCOVERY_OUT("parameters.outs", parameters_outs);
DISCOVERY_OUT("parameters.total", parameters_total);
DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", descriptor->Name);
DISCOVERY_OUT("label", descriptor->Label);
DISCOVERY_OUT("maker", descriptor->Maker);
DISCOVERY_OUT("copyright", descriptor->Copyright);
DISCOVERY_OUT("unique_id", descriptor->UniqueID);
DISCOVERY_OUT("hints", hints);
DISCOVERY_OUT("audio.ins", audio_ins);
DISCOVERY_OUT("audio.outs", audio_outs);
DISCOVERY_OUT("audio.total", audio_total);
DISCOVERY_OUT("parameters.ins", parameters_ins);
DISCOVERY_OUT("parameters.outs", parameters_outs);
DISCOVERY_OUT("parameters.total", parameters_total);

if (descriptor->cleanup)
descriptor->cleanup(handle);
if (init && descriptor->cleanup)
descriptor->cleanup(handle);

DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("end", "------------");
}
else
DISCOVERY_OUT("error", "Failed to init LADSPA plugin");
DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("end", "------------");
}
}

void do_dssi_check(void* lib_handle)
void do_dssi_check(void* lib_handle, bool init)
{
DSSI_Descriptor_Function descfn = (DSSI_Descriptor_Function)lib_symbol(lib_handle, "dssi_descriptor");

@@ -407,51 +423,62 @@ void do_dssi_check(void* lib_handle)
while ((descriptor = descfn(i++)))
{
const LADSPA_Descriptor* ldescriptor = descriptor->LADSPA_Plugin;
LADSPA_Handle handle = ldescriptor->instantiate(ldescriptor, sampleRate);
LADSPA_Handle handle = nullptr;

if (handle)
if (init)
{
int hints = 0;
int audio_ins = 0;
int audio_outs = 0;
int audio_total = 0;
int midi_ins = 0;
int midi_total = 0;
int parameters_ins = 0;
int parameters_outs = 0;
int parameters_total = 0;
int programs_total = 0;
handle = ldescriptor->instantiate(ldescriptor, sampleRate);

for (unsigned long j=0; j < ldescriptor->PortCount; j++)
if (! handle)
{
const LADSPA_PortDescriptor PortDescriptor = ldescriptor->PortDescriptors[j];
if (LADSPA_IS_PORT_AUDIO(PortDescriptor))
{
if (LADSPA_IS_PORT_INPUT(PortDescriptor))
audio_ins += 1;
else if (LADSPA_IS_PORT_OUTPUT(PortDescriptor))
audio_outs += 1;
audio_total += 1;
}
else if (LADSPA_IS_PORT_CONTROL(PortDescriptor))
DISCOVERY_OUT("error", "Failed to init DSSI plugin");
continue;
}
}

int hints = 0;
int audio_ins = 0;
int audio_outs = 0;
int audio_total = 0;
int midi_ins = 0;
int midi_total = 0;
int parameters_ins = 0;
int parameters_outs = 0;
int parameters_total = 0;
int programs_total = 0;

for (unsigned long j=0; j < ldescriptor->PortCount; j++)
{
const LADSPA_PortDescriptor PortDescriptor = ldescriptor->PortDescriptors[j];
if (LADSPA_IS_PORT_AUDIO(PortDescriptor))
{
if (LADSPA_IS_PORT_INPUT(PortDescriptor))
audio_ins += 1;
else if (LADSPA_IS_PORT_OUTPUT(PortDescriptor))
audio_outs += 1;
audio_total += 1;
}
else if (LADSPA_IS_PORT_CONTROL(PortDescriptor))
{
if (LADSPA_IS_PORT_INPUT(PortDescriptor))
parameters_ins += 1;
else if (LADSPA_IS_PORT_OUTPUT(PortDescriptor))
{
if (LADSPA_IS_PORT_INPUT(PortDescriptor))
parameters_ins += 1;
else if (LADSPA_IS_PORT_OUTPUT(PortDescriptor))
{
if (strcmp(ldescriptor->PortNames[j], "latency") != 0 && strcmp(ldescriptor->PortNames[j], "_latency") != 0)
parameters_outs += 1;
}
parameters_total += 1;
if (strcmp(ldescriptor->PortNames[j], "latency") != 0 && strcmp(ldescriptor->PortNames[j], "_latency") != 0)
parameters_outs += 1;
}
parameters_total += 1;
}
}

if (descriptor->run_synth || descriptor->run_multiple_synths)
midi_ins = midi_total = 1;
if (descriptor->run_synth || descriptor->run_multiple_synths)
midi_ins = midi_total = 1;

if (midi_ins > 0 && audio_outs > 0)
hints |= PLUGIN_IS_SYNTH;
if (midi_ins > 0 && audio_outs > 0)
hints |= PLUGIN_IS_SYNTH;

if (init)
{
if (descriptor->get_program)
{
while ((descriptor->get_program(handle, programs_total++)))
@@ -622,46 +649,37 @@ void do_dssi_check(void* lib_handle)

// end crash-free plugin test
// -----------------------------------------------------------------------
}

DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", ldescriptor->Name);
DISCOVERY_OUT("label", ldescriptor->Label);
DISCOVERY_OUT("maker", ldescriptor->Maker);
DISCOVERY_OUT("copyright", ldescriptor->Copyright);
DISCOVERY_OUT("unique_id", ldescriptor->UniqueID);
DISCOVERY_OUT("hints", hints);
DISCOVERY_OUT("audio.ins", audio_ins);
DISCOVERY_OUT("audio.outs", audio_outs);
DISCOVERY_OUT("audio.total", audio_total);
DISCOVERY_OUT("midi.ins", midi_ins);
DISCOVERY_OUT("midi.total", midi_total);
DISCOVERY_OUT("parameters.ins", parameters_ins);
DISCOVERY_OUT("parameters.outs", parameters_outs);
DISCOVERY_OUT("parameters.total", parameters_total);
DISCOVERY_OUT("programs.total", programs_total);
DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", ldescriptor->Name);
DISCOVERY_OUT("label", ldescriptor->Label);
DISCOVERY_OUT("maker", ldescriptor->Maker);
DISCOVERY_OUT("copyright", ldescriptor->Copyright);
DISCOVERY_OUT("unique_id", ldescriptor->UniqueID);
DISCOVERY_OUT("hints", hints);
DISCOVERY_OUT("audio.ins", audio_ins);
DISCOVERY_OUT("audio.outs", audio_outs);
DISCOVERY_OUT("audio.total", audio_total);
DISCOVERY_OUT("midi.ins", midi_ins);
DISCOVERY_OUT("midi.total", midi_total);
DISCOVERY_OUT("parameters.ins", parameters_ins);
DISCOVERY_OUT("parameters.outs", parameters_outs);
DISCOVERY_OUT("parameters.total", parameters_total);
DISCOVERY_OUT("programs.total", programs_total);

if (ldescriptor->cleanup)
ldescriptor->cleanup(handle);
if (init && ldescriptor->cleanup)
ldescriptor->cleanup(handle);

DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("end", "------------");
}
else
DISCOVERY_OUT("error", "Failed to init DSSI plugin");
DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("end", "------------");
}
}

void do_lv2_check(const char* bundle)
{
// Convert bundle filename to URI
QString qBundle;
qBundle += "file://";
qBundle += bundle;
#ifdef Q_OS_WIN
qBundle += "\\";
#else
qBundle += "/";
#endif
QString qBundle(QUrl::fromLocalFile(bundle).toString());

// Load bundle
Lilv::Node Bundle(Lv2World.new_uri(qBundle.toUtf8().constData()));
@@ -985,7 +1003,7 @@ void do_vst_check(void* lib_handle)
DISCOVERY_OUT("error", "Failed to init VST plugin");
}

void do_sf2_check(const char* filename)
void do_fluidsynth_check(const char* filename)
{
#ifdef WANT_FLUIDSYNTH
if (fluid_is_soundfont(filename))
@@ -1043,6 +1061,110 @@ void do_sf2_check(const char* filename)
#endif
}

void do_linuxsampler_check(const char* filename, const char* stype)
{
#ifdef WANT_LINUXSAMPLER
using namespace LinuxSampler;

class ScopedEngine {
public:
ScopedEngine(const char* filename, const char* stype)
{
try {
engine = EngineFactory::Create(stype);
}
catch (Exception& e)
{
DISCOVERY_OUT("error", e.what());
return;
}

try {
ins = engine->GetInstrumentManager();
}
catch (Exception& e)
{
DISCOVERY_OUT("error", e.what());
return;
}

std::vector<InstrumentManager::instrument_id_t> ids;

try {
ids = ins->GetInstrumentFileContent(filename);
}
catch (Exception& e)
{
DISCOVERY_OUT("error", e.what());
return;
}

if (ids.size() > 0)
{
InstrumentManager::instrument_info_t info = ins->GetInstrumentInfo(ids[0]);

DISCOVERY_OUT("init", "-----------");
DISCOVERY_OUT("name", info.InstrumentName);
DISCOVERY_OUT("label", info.Product);
DISCOVERY_OUT("maker", info.Artists);
DISCOVERY_OUT("copyright", info.Artists);

DISCOVERY_OUT("hints", PLUGIN_IS_SYNTH);
DISCOVERY_OUT("audio.outs", 2);
DISCOVERY_OUT("audio.total", 2);
DISCOVERY_OUT("midi.ins", 1);
DISCOVERY_OUT("midi.total", 1);
DISCOVERY_OUT("programs.total", ids.size());

// defined in Carla - TODO
//DISCOVERY_OUT("parameters.ins", 13);
//DISCOVERY_OUT("parameters.outs", 1);
//DISCOVERY_OUT("parameters.total", 14);

DISCOVERY_OUT("build", BINARY_NATIVE);
DISCOVERY_OUT("end", "------------");
}
}

~ScopedEngine()
{
if (engine)
EngineFactory::Destroy(engine);
}

private:
Engine* engine;
InstrumentManager* ins;
};

QFileInfo file(filename);

if (! file.exists())
{
DISCOVERY_OUT("error", "Requested file does not exist");
return;
}

if (! file.isFile())
{
DISCOVERY_OUT("error", "Requested filename is not a file");
return;
}

if (! file.isReadable())
{
DISCOVERY_OUT("error", "Requested file is not readable");
return;
}

const ScopedEngine engine(filename, stype);

#else
(void)filename;
DISCOVERY_OUT("error", stype << " support not available");
#endif
}

// ------------------------------ main entry point ------------------------------

int main(int argc, char* argv[])
@@ -1080,11 +1202,21 @@ int main(int argc, char* argv[])
open_lib = true;
type = PLUGIN_VST;
}
else if (strcmp(type_str, "GIG") == 0)
{
open_lib = false;
type = PLUGIN_GIG;
}
else if (strcmp(type_str, "SF2") == 0)
{
open_lib = false;
type = PLUGIN_SF2;
}
else if (strcmp(type_str, "SFZ") == 0)
{
open_lib = false;
type = PLUGIN_SFZ;
}
else
{
DISCOVERY_OUT("error", "Invalid plugin type");
@@ -1102,13 +1234,15 @@ int main(int argc, char* argv[])
}
}

bool doInit = QString(filename).endsWith("dssi-vst.so", Qt::CaseInsensitive);

switch (type)
{
case PLUGIN_LADSPA:
do_ladspa_check(handle);
do_ladspa_check(handle, doInit);
break;
case PLUGIN_DSSI:
do_dssi_check(handle);
do_dssi_check(handle, doInit);
break;
case PLUGIN_LV2:
do_lv2_check(filename);
@@ -1116,8 +1250,14 @@ int main(int argc, char* argv[])
case PLUGIN_VST:
do_vst_check(handle);
break;
case PLUGIN_GIG:
do_linuxsampler_check(filename, "gig");
break;
case PLUGIN_SF2:
do_sf2_check(filename);
do_fluidsynth_check(filename);
break;
case PLUGIN_SFZ:
do_linuxsampler_check(filename, "sfz");
break;
default:
break;


+ 2
- 2
src/carla-discovery/qtcreator/carla-discovery.pro View File

@@ -3,8 +3,8 @@
QT = core

CONFIG = link_pkgconfig qt warn_on debug
DEFINES = DEBUG WANT_FLUIDSYNTH
PKGCONFIG = fluidsynth
DEFINES = DEBUG WANT_FLUIDSYNTH WANT_LINUXSAMPLER
PKGCONFIG = fluidsynth linuxsampler

TARGET = carla-discovery-qtcreator
TEMPLATE = app


+ 1
- 1
src/carla.py View File

@@ -2229,7 +2229,7 @@ class PluginWidget(QFrame, ui_carla_plugin.Ui_PluginWidget):
border-radius: 4px;
}
QFrame#frame_controls {
/*background-image: url(:/bitmaps/carla_knobs1.png);*/
background-image: url(:/bitmaps/carla_knobs1.png);
background-color: rgb(35, 35, 35);
border: 1px solid rgb(35, 35, 35);
border-radius: 4px;


+ 3
- 1
src/carla_backend.py View File

@@ -537,7 +537,9 @@ PLUGIN_LADSPA = 1
PLUGIN_DSSI = 2
PLUGIN_LV2 = 3
PLUGIN_VST = 4
PLUGIN_SF2 = 5
PLUGIN_GIG = 5
PLUGIN_SF2 = 6
PLUGIN_SFZ = 7

# enum PluginCategory
PLUGIN_CATEGORY_NONE = 0


BIN
src/icons/bitmaps/carla_knobs1.png View File

Before After
Width: 160  |  Height: 40  |  Size: 6.2KB Width: 160  |  Height: 40  |  Size: 6.1KB

+ 19
- 14
src/pixmapdial.py View File

@@ -175,18 +175,8 @@ class PixmapDial(QDial):

target = QRectF(0.0, 0.0, self.p_size, self.p_size)
value = (current / divider)
per = int((self.p_count - 1) * (current / divider))

if self.m_orientation == self.HORIZONTAL:
xpos = self.p_size * per
ypos = 0.0
else:
xpos = 0.0
ypos = self.p_size * per

source = QRectF(xpos, ypos, self.p_size, self.p_size)
painter.drawPixmap(target, self.m_pixmap, source)

# Custom knobs (Dry/Wet and Volume)
if self.m_custom_paint in (self.CUSTOM_PAINT_CARLA_WET, self.CUSTOM_PAINT_CARLA_VOL):
# knob color
colorGreen = QColor(0x5D + self.m_hover_step*6, 0xE7 + self.m_hover_step*1, 0x3D + self.m_hover_step*5)
@@ -213,8 +203,9 @@ class PixmapDial(QDial):
painter.setBrush(colorBlue)
painter.setPen(QPen(colorBlue, 3))

painter.drawArc(3.0, 3.0, 25.0, 25.0, startAngle, spanAngle)
painter.drawArc(3.0, 3.0, 26.0, 26.0, startAngle, spanAngle)

# Custom knobs (L and R)
elif self.m_custom_paint in (self.CUSTOM_PAINT_CARLA_L, self.CUSTOM_PAINT_CARLA_R):
# knob color
color = QColor(0xAD + self.m_hover_step*5, 0xD5 + self.m_hover_step*4, 0x4B + self.m_hover_step*5)
@@ -229,7 +220,7 @@ class PixmapDial(QDial):

painter.setBrush(color)
painter.setPen(QPen(color, 0))
painter.drawEllipse(QRectF(ballPoint.x(), ballPoint.y(), 3.0, 3.0))
painter.drawEllipse(QRectF(ballPoint.x(), ballPoint.y(), 2.0, 2.0))

# draw arc
if self.m_custom_paint == self.CUSTOM_PAINT_CARLA_L:
@@ -242,7 +233,21 @@ class PixmapDial(QDial):
return

painter.setPen(QPen(color, 2))
painter.drawArc(3.0, 3.0, 20.0, 20.0, startAngle, spanAngle)
painter.drawArc(3.0, 4.0, 20.0, 20.0, startAngle, spanAngle)

# Regular knobs
else:
per = int((self.p_count - 1) * (current / divider))

if self.m_orientation == self.HORIZONTAL:
xpos = self.p_size * per
ypos = 0.0
else:
xpos = 0.0
ypos = self.p_size * per

source = QRectF(xpos, ypos, self.p_size, self.p_size)
painter.drawPixmap(target, self.m_pixmap, source)

if self.HOVER_MIN < self.m_hover_step < self.HOVER_MAX:
self.m_hover_step += 1 if self.m_hovered else -1


Loading…
Cancel
Save