@@ -246,37 +251,66 @@ const PluginInfoDialog = withStyles(styles)((props: PluginInfoProps) => {
-
-
-
+
+
-
+
{ioDescription(plugin)}
-
+
Controls:
{
makeControls(plugin.controls)
}
-
+
Description:
- {
- (plugin.description !== "") && makeParagraphs(plugin.description)
- }
+
+
{
+ // return (
+ //
+ // );
+ return (
+
+ );
+
+ },
+ code: (props: any) => {
+ return ();
+ },
+ a: (props: any) => {
+ return (
+
+ );
+
+ }
+ },
+ }}
+ >
+ {plugin.description}
+
+
diff --git a/react/src/PresetSelector.tsx b/react/src/PresetSelector.tsx
index ae96175..7249f6f 100644
--- a/react/src/PresetSelector.tsx
+++ b/react/src/PresetSelector.tsx
@@ -186,7 +186,6 @@ const PresetSelector =
let currentPresets = this.model.presets.get();
let item = currentPresets.getItem(currentPresets.selectedInstanceId);
if (item == null) return;
- let name = item.name;
this.model.newPresetItem(currentPresets.selectedInstanceId)
.then((instanceId) => {
this.model.loadPreset(instanceId);
diff --git a/react/src/SearchControl.tsx b/react/src/SearchControl.tsx
index 200d0fe..cfff2f1 100644
--- a/react/src/SearchControl.tsx
+++ b/react/src/SearchControl.tsx
@@ -96,7 +96,7 @@ const SearchControl = withStyles(styles, { withTheme: true })(
)
}
- getWorld();
- AutoLilvNode name = lilv_world_get(
+ AutoLilvNode label = lilv_world_get(
pWorld,
node,
- pHost->lilvUris.lv2core__name,
+ pHost->lilvUris.rdfs__label,
nullptr);
- if (name)
+ if (label)
{
- this->name_ = name.AsString();
+ this->label_ = label.AsString();
}
else
{
- this->name_ = "File";
+ this->label_ = "File";
}
AutoLilvNode index = lilv_world_get(
pWorld,
@@ -120,7 +120,7 @@ UiFileProperty::UiFileProperty(PluginHost *pHost, const LilvNode *node, const st
nullptr);
if (index)
{
- this->index_ = name.AsInt();
+ this->index_ = index.AsInt(-1);
}
else
{
@@ -159,6 +159,12 @@ UiFileProperty::UiFileProperty(PluginHost *pHost, const LilvNode *node, const st
throw std::logic_error("PiPedal FileProperty is missing pipedalui:patchProperty value.");
}
+ AutoLilvNode portGroup = lilv_world_get(pWorld,node,pHost->lilvUris.portgroups__group,nullptr);
+ if (portGroup)
+ {
+ this->portGroup_ = portGroup.AsUri();
+ }
+
this->fileTypes_ = PiPedalFileType::GetArray(pHost, node, pHost->lilvUris.pipedalUI__fileTypes);
}
@@ -297,7 +303,7 @@ UiPortNotification::UiPortNotification(PluginHost *pHost, const LilvNode *node)
}
UiFileProperty::UiFileProperty(const std::string &name, const std::string &patchProperty, const std::string &directory)
- : name_(name),
+ : label_(name),
patchProperty_(patchProperty),
directory_(directory)
{
@@ -320,9 +326,10 @@ JSON_MAP_REFERENCE(PiPedalFileType, fileExtension)
JSON_MAP_END()
JSON_MAP_BEGIN(UiFileProperty)
-JSON_MAP_REFERENCE(UiFileProperty, name)
+JSON_MAP_REFERENCE(UiFileProperty, label)
JSON_MAP_REFERENCE(UiFileProperty, index)
JSON_MAP_REFERENCE(UiFileProperty, directory)
-JSON_MAP_REFERENCE(UiFileProperty, fileTypes)
JSON_MAP_REFERENCE(UiFileProperty, patchProperty)
+JSON_MAP_REFERENCE(UiFileProperty, fileTypes)
+JSON_MAP_REFERENCE(UiFileProperty, portGroup)
JSON_MAP_END()
\ No newline at end of file
diff --git a/src/PiPedalUI.hpp b/src/PiPedalUI.hpp
index 66718a5..01949b3 100644
--- a/src/PiPedalUI.hpp
+++ b/src/PiPedalUI.hpp
@@ -93,11 +93,12 @@ namespace pipedal {
};
class UiFileProperty {
private:
- std::string name_;
+ std::string label_;
std::int64_t index_ = -1;
std::string directory_;
std::vector fileTypes_;
std::string patchProperty_;
+ std::string portGroup_;
public:
using ptr = std::shared_ptr;
UiFileProperty() { }
@@ -105,9 +106,10 @@ namespace pipedal {
UiFileProperty(const std::string&name, const std::string&patchProperty,const std::string &directory);
- const std::string &name() const { return name_; }
+ const std::string &label() const { return label_; }
int64_t index() const { return index_; }
const std::string &directory() const { return directory_; }
+ const std::string&portGroup() const { return portGroup_; }
const std::vector &fileTypes() const { return fileTypes_; }
diff --git a/src/PluginHost.cpp b/src/PluginHost.cpp
index 10b489d..6090f7f 100644
--- a/src/PluginHost.cpp
+++ b/src/PluginHost.cpp
@@ -554,33 +554,6 @@ void PluginHost::Load(const char *lv2Path)
#endif
};
-class NodesAutoFree
-{
- LilvNodes *nodes;
-
- // const LilvNode* returns must not be freed, by convention.
- NodesAutoFree(const LilvNodes *nodes)
- {
- }
-
-public:
- NodesAutoFree(LilvNodes *nodes)
- {
- this->nodes = nodes;
- }
- operator const LilvNodes *()
- {
- return this->nodes;
- }
- operator bool()
- {
- return this->nodes != nullptr;
- }
- ~NodesAutoFree()
- {
- lilv_nodes_free(this->nodes);
- }
-};
static std::vector nodeAsStringArray(const LilvNodes *nodes)
{
@@ -614,7 +587,7 @@ static bool ports_sort_compare(std::shared_ptr &p1, const std::shar
bool Lv2PluginInfo::HasFactoryPresets(PluginHost *lv2Host, const LilvPlugin *plugin)
{
- NodesAutoFree nodes = lilv_plugin_get_related(plugin, lv2Host->lilvUris.presets__preset);
+ AutoLilvNodes nodes = lilv_plugin_get_related(plugin, lv2Host->lilvUris.presets__preset);
bool result = false;
LILV_FOREACH(nodes, iNode, nodes)
{
@@ -711,16 +684,16 @@ Lv2PluginInfo::Lv2PluginInfo(PluginHost *lv2Host, LilvWorld *pWorld, const LilvP
const LilvPluginClass *pClass = lilv_plugin_get_class(pPlugin);
this->plugin_class_ = nodeAsString(lilv_plugin_class_get_uri(pClass));
- NodesAutoFree required_features = lilv_plugin_get_required_features(pPlugin);
+ AutoLilvNodes required_features = lilv_plugin_get_required_features(pPlugin);
this->required_features_ = nodeAsStringArray(required_features);
- NodesAutoFree supported_features = lilv_plugin_get_supported_features(pPlugin);
+ AutoLilvNodes supported_features = lilv_plugin_get_supported_features(pPlugin);
this->supported_features_ = nodeAsStringArray(supported_features);
- NodesAutoFree optional_features = lilv_plugin_get_optional_features(pPlugin);
+ AutoLilvNodes optional_features = lilv_plugin_get_optional_features(pPlugin);
this->optional_features_ = nodeAsStringArray(optional_features);
- NodesAutoFree extensions = lilv_plugin_get_extension_data(pPlugin);
+ AutoLilvNodes extensions = lilv_plugin_get_extension_data(pPlugin);
this->extensions_ = nodeAsStringArray(extensions);
AutoLilvNode comment = lv2Host->get_comment(this->uri_);
@@ -827,6 +800,7 @@ std::vector supportedFeatures = {
LV2_STATE__loadDefaultState,
LV2_STATE__makePath,
LV2_STATE__mapPath,
+ LV2_STATE__freePath,
LV2_CORE__inPlaceBroken,
// UI features that we can ignore, since we won't load their ui.
@@ -908,7 +882,7 @@ Lv2PortInfo::Lv2PortInfo(PluginHost *host, const LilvPlugin *plugin, const LilvP
// typo in invada plugins.
this->is_logarithmic_ |= lilv_port_has_property(plugin, pPort, host->lilvUris.invada_portprops__logarithmic);
- NodesAutoFree priority_nodes = lilv_port_get_value(plugin, pPort, host->lilvUris.port__display_priority);
+ AutoLilvNodes priority_nodes = lilv_port_get_value(plugin, pPort, host->lilvUris.port__display_priority);
this->display_priority_ = -1;
if (priority_nodes)
@@ -920,7 +894,7 @@ Lv2PortInfo::Lv2PortInfo(PluginHost *host, const LilvPlugin *plugin, const LilvP
}
}
- NodesAutoFree range_steps_nodes = lilv_port_get_value(plugin, pPort, host->lilvUris.port_range_steps);
+ AutoLilvNodes range_steps_nodes = lilv_port_get_value(plugin, pPort, host->lilvUris.port_range_steps);
this->range_steps_ = 0;
if (range_steps_nodes)
{
@@ -1458,6 +1432,7 @@ json_map::storage_type Lv2PluginClass::jmap{{
}};
json_map::storage_type Lv2PluginUiPortGroup::jmap{{
+ MAP_REF(Lv2PluginUiPortGroup, uri),
MAP_REF(Lv2PluginUiPortGroup, symbol),
MAP_REF(Lv2PluginUiPortGroup, name),
MAP_REF(Lv2PluginUiPortGroup, parent_group),
diff --git a/src/PluginHost.hpp b/src/PluginHost.hpp
index ebe5437..94d8357 100644
--- a/src/PluginHost.hpp
+++ b/src/PluginHost.hpp
@@ -340,7 +340,7 @@ namespace pipedal
Lv2PluginInfo() {}
private:
- std::shared_ptr FindWritablePathProperties(PluginHost *lv2Host,const LilvPlugin*pPlugin);
+ std::shared_ptr FindWritablePathProperties(PluginHost *lv2Host, const LilvPlugin *pPlugin);
bool HasFactoryPresets(PluginHost *lv2Host, const LilvPlugin *plugin);
std::string bundle_path_;
@@ -443,12 +443,15 @@ namespace pipedal
class Lv2PluginUiPortGroup
{
private:
+ std::string uri_;
std::string symbol_;
std::string name_;
std::string parent_group_;
int32_t program_list_id_ = -1; // used by VST3.
public:
+ LV2_PROPERTY_GETSET(uri)
+
LV2_PROPERTY_GETSET(symbol)
LV2_PROPERTY_GETSET(name)
LV2_PROPERTY_GETSET(parent_group)
@@ -457,7 +460,9 @@ namespace pipedal
public:
Lv2PluginUiPortGroup() {}
Lv2PluginUiPortGroup(Lv2PortGroup *pPortGroup)
- : symbol_(pPortGroup->symbol()), name_(pPortGroup->name())
+ : symbol_(pPortGroup->symbol())
+ , name_(pPortGroup->name())
+ , uri_(pPortGroup->uri())
{
}
Lv2PluginUiPortGroup(
@@ -479,30 +484,34 @@ namespace pipedal
}
Lv2PluginUiPort(const Lv2PluginInfo *pPlugin, const Lv2PortInfo *pPort)
: symbol_(pPort->symbol()), index_(pPort->index()),
- is_input_(pPort->is_input()), name_(pPort->name()), min_value_(pPort->min_value()), max_value_(pPort->max_value()),
- default_value_(pPort->default_value()), range_steps_(pPort->range_steps()), display_priority_(pPort->display_priority()),
- is_logarithmic_(pPort->is_logarithmic()), integer_property_(pPort->integer_property()), enumeration_property_(pPort->enumeration_property()),
- toggled_property_(pPort->toggled_property()), not_on_gui_(pPort->not_on_gui()), scale_points_(pPort->scale_points()),
- comment_(pPort->comment()), units_(pPort->units()),
- connection_optional_(pPort->connection_optional())
+ is_input_(pPort->is_input()), name_(pPort->name()), min_value_(pPort->min_value()), max_value_(pPort->max_value()),
+ default_value_(pPort->default_value()), range_steps_(pPort->range_steps()), display_priority_(pPort->display_priority()),
+ is_logarithmic_(pPort->is_logarithmic()), integer_property_(pPort->integer_property()), enumeration_property_(pPort->enumeration_property()),
+ toggled_property_(pPort->toggled_property()), not_on_gui_(pPort->not_on_gui()), scale_points_(pPort->scale_points()),
+ comment_(pPort->comment()), units_(pPort->units()),
+ connection_optional_(pPort->connection_optional())
{
// Use symbols to index port groups, instead of uris.
// symbols are guaranteed to be unique.
- auto &portGroup = pPort->port_group();
- for (int i = 0; i < pPlugin->port_groups().size(); ++i)
+ const auto &portGroup = pPort->port_group();
+ if (portGroup.length() != 0)
{
-
- auto &p = pPlugin->port_groups()[i];
- if (p->uri() == portGroup)
+ for (int i = 0; i < pPlugin->port_groups().size(); ++i)
{
- this->port_group_ = p->symbol();
- break;
+
+ auto &p = pPlugin->port_groups()[i];
+ if (p->symbol().length() == 0)
+ {
+ // supposed to be mandatory; but make up a synthetic symbol.
+ }
+ if (p->uri() == portGroup)
+ {
+ this->port_group_ = p->symbol();
+ break;
+ }
}
}
- is_bypass_ = name_ == "bypass"
- || name_ == "Bypass"
- || symbol_ == "bypass"
- || symbol_ == "Bypass";
+ is_bypass_ = name_ == "bypass" || name_ == "Bypass" || symbol_ == "bypass" || symbol_ == "Bypass";
}
private:
@@ -645,7 +654,7 @@ namespace pipedal
AutoLilvNode core__designation;
AutoLilvNode portgroups__group;
AutoLilvNode units__unit;
- AutoLilvNode invada_units__unit; // typo in invada plugins.
+ AutoLilvNode invada_units__unit; // typo in invada plugins.
AutoLilvNode invada_portprops__logarithmic; // typo in invada plugins.
AutoLilvNode atom__bufferType;
@@ -687,7 +696,6 @@ namespace pipedal
AutoLilvNode patch__writable;
AutoLilvNode patch__readable;
-
};
LilvUris lilvUris;