@@ -1177,16 +1177,48 @@ This mode is not available for VST plugins.</string> | |||||
</layout> | </layout> | ||||
</widget> | </widget> | ||||
<widget class="QWidget" name="tw_paths_lv2"> | <widget class="QWidget" name="tw_paths_lv2"> | ||||
<layout class="QVBoxLayout" name="verticalLayout_6"> | |||||
<property name="spacing"> | |||||
<layout class="QGridLayout" name="gridLayout"> | |||||
<property name="leftMargin"> | |||||
<number>0</number> | <number>0</number> | ||||
</property> | </property> | ||||
<property name="margin"> | |||||
<property name="topMargin"> | |||||
<number>0</number> | <number>0</number> | ||||
</property> | </property> | ||||
<item> | |||||
<property name="rightMargin"> | |||||
<number>0</number> | |||||
</property> | |||||
<property name="bottomMargin"> | |||||
<number>6</number> | |||||
</property> | |||||
<item row="0" column="0" colspan="2"> | |||||
<widget class="QListWidget" name="lw_lv2"/> | <widget class="QListWidget" name="lw_lv2"/> | ||||
</item> | </item> | ||||
<item row="1" column="0"> | |||||
<widget class="QLabel" name="label_4"> | |||||
<property name="maximumSize"> | |||||
<size> | |||||
<width>22</width> | |||||
<height>22</height> | |||||
</size> | |||||
</property> | |||||
<property name="text"> | |||||
<string/> | |||||
</property> | |||||
<property name="pixmap"> | |||||
<pixmap resource="../resources.qrc">:/16x16/dialog-information.png</pixmap> | |||||
</property> | |||||
<property name="alignment"> | |||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | |||||
</property> | |||||
</widget> | |||||
</item> | |||||
<item row="1" column="1"> | |||||
<widget class="QLabel" name="label_5"> | |||||
<property name="text"> | |||||
<string>Restart Carla to be able to load new found plugins</string> | |||||
</property> | |||||
</widget> | |||||
</item> | |||||
</layout> | </layout> | ||||
</widget> | </widget> | ||||
<widget class="QWidget" name="tw_paths_vst"> | <widget class="QWidget" name="tw_paths_vst"> | ||||
@@ -1361,6 +1393,7 @@ This mode is not available for VST plugins.</string> | |||||
<include location="../resources.qrc"/> | <include location="../resources.qrc"/> | ||||
<include location="../resources.qrc"/> | <include location="../resources.qrc"/> | ||||
<include location="../resources.qrc"/> | <include location="../resources.qrc"/> | ||||
<include location="../../../Carla-stable/resources/resources.qrc"/> | |||||
</resources> | </resources> | ||||
<connections> | <connections> | ||||
<connection> | <connection> | ||||
@@ -4245,17 +4245,6 @@ public: | |||||
// --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
// get plugin from lv2_rdf (lilv) | // get plugin from lv2_rdf (lilv) | ||||
Lv2WorldClass& lv2World(Lv2WorldClass::getInstance()); | |||||
// Convert bundle filename to URI | |||||
QString qBundle(QUrl::fromLocalFile(bundle).toString()); | |||||
if (! qBundle.endsWith(OS_SEP_STR)) | |||||
qBundle += OS_SEP_STR; | |||||
// Load bundle | |||||
Lilv::Node lilvBundle(lv2World.new_uri(qBundle.toUtf8().constData())); | |||||
lv2World.load_bundle(lilvBundle); | |||||
fRdfDescriptor = lv2_rdf_new(uri, true); | fRdfDescriptor = lv2_rdf_new(uri, true); | ||||
if (fRdfDescriptor == nullptr) | if (fRdfDescriptor == nullptr) | ||||
@@ -349,10 +349,7 @@ public: | |||||
// ----------------------------------------------------------------- | // ----------------------------------------------------------------- | ||||
// get plugin from lv2_rdf (lilv) | // get plugin from lv2_rdf (lilv) | ||||
Lv2WorldClass& lv2World(Lv2WorldClass::getInstance()); | |||||
lv2World.load_all(); // FIXME | |||||
fRdfDescriptor = lv2_rdf_new(pluginURI, false); | |||||
fRdfDescriptor = lv2_rdf_new(pluginURI, true); | |||||
if (fRdfDescriptor == nullptr) | if (fRdfDescriptor == nullptr) | ||||
return false; | return false; | ||||
@@ -216,6 +216,8 @@ public: | |||||
Lilv::Node rdf_type; | Lilv::Node rdf_type; | ||||
Lilv::Node rdfs_label; | Lilv::Node rdfs_label; | ||||
bool needsInit; | |||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
Lv2WorldClass() | Lv2WorldClass() | ||||
@@ -330,7 +332,11 @@ public: | |||||
dct_replaces (new_uri(NS_dct "replaces")), | dct_replaces (new_uri(NS_dct "replaces")), | ||||
doap_license (new_uri(NS_doap "license")), | doap_license (new_uri(NS_doap "license")), | ||||
rdf_type (new_uri(NS_rdf "type")), | rdf_type (new_uri(NS_rdf "type")), | ||||
rdfs_label (new_uri(NS_rdfs "label")) {} | |||||
rdfs_label (new_uri(NS_rdfs "label")), | |||||
needsInit(true) | |||||
{ | |||||
} | |||||
static Lv2WorldClass& getInstance() | static Lv2WorldClass& getInstance() | ||||
{ | { | ||||
@@ -338,6 +344,15 @@ public: | |||||
return lv2World; | return lv2World; | ||||
} | } | ||||
void init() | |||||
{ | |||||
if (! needsInit) | |||||
return; | |||||
needsInit = false; | |||||
Lilv::World::load_all(); | |||||
} | |||||
const LilvPlugin* getPlugin(const LV2_URI uri) const | const LilvPlugin* getPlugin(const LV2_URI uri) const | ||||
{ | { | ||||
CARLA_SAFE_ASSERT_RETURN(uri != nullptr && uri[0] != '\0', nullptr); | CARLA_SAFE_ASSERT_RETURN(uri != nullptr && uri[0] != '\0', nullptr); | ||||
@@ -402,12 +417,15 @@ public: | |||||
// Create new RDF object (using lilv) | // Create new RDF object (using lilv) | ||||
static inline | static inline | ||||
const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool fillPresets) | |||||
const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool doInit) | |||||
{ | { | ||||
CARLA_SAFE_ASSERT_RETURN(uri != nullptr && uri[0] != '\0', nullptr); | CARLA_SAFE_ASSERT_RETURN(uri != nullptr && uri[0] != '\0', nullptr); | ||||
Lv2WorldClass& lv2World(Lv2WorldClass::getInstance()); | Lv2WorldClass& lv2World(Lv2WorldClass::getInstance()); | ||||
if (doInit) | |||||
lv2World.init(); | |||||
const LilvPlugin* const cPlugin(lv2World.getPlugin(uri)); | const LilvPlugin* const cPlugin(lv2World.getPlugin(uri)); | ||||
if (cPlugin == nullptr) | if (cPlugin == nullptr) | ||||
@@ -1019,11 +1037,10 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool fillPresets) | |||||
} | } | ||||
} | } | ||||
#if 1 | |||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
// Set Plugin Presets | // Set Plugin Presets | ||||
if (fillPresets) | |||||
if (doInit) | |||||
{ | { | ||||
Lilv::Nodes presetNodes(lilvPlugin.get_related(lv2World.preset_preset)); | Lilv::Nodes presetNodes(lilvPlugin.get_related(lv2World.preset_preset)); | ||||
@@ -1081,7 +1098,6 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool fillPresets) | |||||
} | } | ||||
} | } | ||||
} | } | ||||
#endif | |||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
// Set Plugin Features | // Set Plugin Features | ||||