Improvements to UI controlsin prep for Recorder.
This commit is contained in:
+3
-2
@@ -55,13 +55,14 @@ namespace macaron
|
||||
'w', 'x', 'y', 'z', '0', '1', '2', '3',
|
||||
'4', '5', '6', '7', '8', '9', '+', '/'};
|
||||
|
||||
|
||||
size_t in_len = size;
|
||||
size_t out_len = 4 * ((in_len + 2) / 3);
|
||||
std::string ret(out_len, '\0');
|
||||
size_t i;
|
||||
size_t i = 0;
|
||||
char *p = const_cast<char *>(ret.c_str());
|
||||
|
||||
for (i = 0; i < in_len - 2; i += 3)
|
||||
for (i = 0; i+2 < in_len; i += 3)
|
||||
{
|
||||
*p++ = sEncodingTable[(data[i] >> 2) & 0x3F];
|
||||
*p++ = sEncodingTable[((data[i] & 0x3) << 4) | ((int)(data[i + 1] & 0xF0) >> 4)];
|
||||
|
||||
@@ -44,6 +44,10 @@ const std::vector<ModFileTypes::ModDirectory> ModFileTypes::ModDirectories =
|
||||
{"nammodel", "NeuralAmpModels", "Neural Amp Models", {".nam"}}, // Ratatoille, Mike's NAM.
|
||||
{"aidadspmodel", "shared/aidaaix", "AIDA IAX Models", {".json", ".aidaiax"}}, // Ratatoille
|
||||
{"mlmodel", "ToobMlModels", "ML Models", {".json"}}, //
|
||||
|
||||
// pipedal-specific types. use pipedal_ui:filetypes instead (or in addition to) mod:fileTypes.
|
||||
{"recording", "shared/audio/Recordings", "Recordings", {"audio/*"}}, // Recordings from recordings plugins.
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
@@ -134,7 +138,7 @@ void ModFileTypes::CreateDefaultDirectories(const std::filesystem::path &rootDir
|
||||
|
||||
fs::create_directories(path);
|
||||
}
|
||||
|
||||
|
||||
if (!fs::exists(rootDirectory / "shared" / "audio" / "Cab IR Files"))
|
||||
{
|
||||
fs::create_symlink(
|
||||
|
||||
+5
-1
@@ -59,6 +59,8 @@
|
||||
#define PIPEDAL_UI__yBottom PIPEDAL_UI_PREFIX "yBottom"
|
||||
#define PIPEDAL_UI__width PIPEDAL_UI_PREFIX "width"
|
||||
|
||||
#define PIPEDAL_UI__ledColor PIPEDAL_UI_PREFIX "ledColor"
|
||||
|
||||
|
||||
namespace pipedal {
|
||||
|
||||
@@ -122,14 +124,16 @@ namespace pipedal {
|
||||
UiFileProperty(PluginHost*pHost, const LilvNode*node, const std::filesystem::path&resourcePath);
|
||||
UiFileProperty(const std::string&name, const std::string&patchProperty,const std::string &directory);
|
||||
|
||||
|
||||
|
||||
std::vector<std::string>& modDirectories() { return modDirectories_; }
|
||||
const std::vector<std::string>& modDirectories() const { return modDirectories_; }
|
||||
|
||||
bool useLegacyModDirectory() const { return useLegacyModDirectory_; }
|
||||
void useLegacyModDirectory(bool value) { useLegacyModDirectory_ = value; }
|
||||
const std::string &label() const { return label_; }
|
||||
|
||||
int32_t index() const { return index_; }
|
||||
void index(int32_t value) { index_ = value; }
|
||||
|
||||
const std::string &directory() const { return directory_; }
|
||||
void directory(const std::string &path) { directory_ = path; }
|
||||
|
||||
+31
-1
@@ -150,6 +150,7 @@ void PluginHost::LilvUris::Initialize(LilvWorld *pWorld)
|
||||
pipedalUI__mimeType = lilv_new_uri(pWorld, PIPEDAL_UI__mimeType);
|
||||
pipedalUI__outputPorts = lilv_new_uri(pWorld, PIPEDAL_UI__outputPorts);
|
||||
pipedalUI__text = lilv_new_uri(pWorld, PIPEDAL_UI__text);
|
||||
pipedalUI__ledColor = lilv_new_uri(pWorld,PIPEDAL_UI__ledColor);
|
||||
|
||||
pipedalUI__frequencyPlot = lilv_new_uri(pWorld, PIPEDAL_UI__frequencyPlot);
|
||||
pipedalUI__xLeft = lilv_new_uri(pWorld, PIPEDAL_UI__xLeft);
|
||||
@@ -194,6 +195,7 @@ void PluginHost::LilvUris::Initialize(LilvWorld *pWorld)
|
||||
dc__format = lilv_new_uri(pWorld, "http://purl.org/dc/terms/format");
|
||||
|
||||
mod__fileTypes = lilv_new_uri(pWorld, "http://moddevices.com/ns/mod#fileTypes");
|
||||
pipedalui__fileTypes =lilv_new_uri(pWorld, PIPEDAL_UI__fileTypes);
|
||||
}
|
||||
|
||||
void PluginHost::LilvUris::Free()
|
||||
@@ -623,8 +625,11 @@ std::shared_ptr<PiPedalUI> Lv2PluginInfo::FindWritablePathProperties(PluginHost
|
||||
// rfs:range atom:Path?
|
||||
if (lilv_world_ask(pWorld, propertyUri, lv2Host->lilvUris->rdfs__range, lv2Host->lilvUris->atom__Path))
|
||||
{
|
||||
|
||||
|
||||
AutoLilvNode label = lilv_world_get(pWorld, propertyUri, lv2Host->lilvUris->rdfs__label, nullptr);
|
||||
std::string strLabel = label.AsString();
|
||||
|
||||
if (strLabel.length() != 0)
|
||||
{
|
||||
std::filesystem::path path = this->bundle_path();
|
||||
@@ -636,7 +641,20 @@ std::shared_ptr<PiPedalUI> Lv2PluginInfo::FindWritablePathProperties(PluginHost
|
||||
std::make_shared<UiFileProperty>(
|
||||
strLabel, propertyUri.AsUri(), lv2DirectoryName);
|
||||
|
||||
AutoLilvNodes mod__fileTypes = lilv_world_find_nodes(pWorld, propertyUri, lv2Host->lilvUris->mod__fileTypes, nullptr);
|
||||
|
||||
AutoLilvNode indexNode = lilv_world_get(pWorld, propertyUri, lv2Host->lilvUris->lv2core__index, nullptr);
|
||||
int32_t index = indexNode.AsInt(-1);
|
||||
fileProperty->index(index);
|
||||
|
||||
|
||||
// if there's a pipedalui_fileTypes node, use that instead.
|
||||
|
||||
AutoLilvNodes mod__fileTypes = lilv_world_find_nodes(pWorld, propertyUri, lv2Host->lilvUris->pipedalui__fileTypes, nullptr);
|
||||
if (!mod__fileTypes)
|
||||
{
|
||||
mod__fileTypes = lilv_world_find_nodes(pWorld, propertyUri, lv2Host->lilvUris->mod__fileTypes, nullptr);
|
||||
}
|
||||
|
||||
LILV_FOREACH(nodes, i, mod__fileTypes)
|
||||
{
|
||||
// "nam,nammodel"
|
||||
@@ -979,6 +997,15 @@ Lv2PortInfo::Lv2PortInfo(PluginHost *host, const LilvPlugin *plugin, const LilvP
|
||||
this->connection_optional_ = lilv_port_has_property(plugin, pPort, host->lilvUris->core__connectionOptional);
|
||||
this->trigger_property_ = lilv_port_has_property(plugin, pPort, host->lilvUris->portprops__trigger);
|
||||
|
||||
AutoLilvNode port_ledColor = lilv_port_get(plugin,pPort,host->lilvUris->pipedalUI__ledColor);
|
||||
if (port_ledColor)
|
||||
{
|
||||
auto value = lilv_node_as_string(port_ledColor);
|
||||
if (value) {
|
||||
this->pipedal_ledColor_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
LilvScalePoints *pScalePoints = lilv_port_get_scale_points(plugin, pPort);
|
||||
LILV_FOREACH(scale_points, iSP, pScalePoints)
|
||||
{
|
||||
@@ -1650,6 +1677,8 @@ json_map::storage_type<Lv2PortInfo> Lv2PortInfo::jmap{
|
||||
MAP_REF(Lv2PortInfo, not_on_gui),
|
||||
MAP_REF(Lv2PortInfo, buffer_type),
|
||||
MAP_REF(Lv2PortInfo, port_group),
|
||||
MAP_REF(Lv2PortInfo, pipedal_ledColor),
|
||||
|
||||
json_map::enum_reference("units", &Lv2PortInfo::units_, get_units_enum_converter()),
|
||||
MAP_REF(Lv2PortInfo, comment)}};
|
||||
|
||||
@@ -1715,6 +1744,7 @@ json_map::storage_type<Lv2PluginUiPort> Lv2PluginUiPort::jmap{{
|
||||
MAP_REF(Lv2PluginUiPort, trigger_property),
|
||||
MAP_REF(Lv2PluginUiPort, scale_points),
|
||||
MAP_REF(Lv2PluginUiPort, port_group),
|
||||
MAP_REF(Lv2PluginUiPort, pipedal_ledColor),
|
||||
|
||||
json_map::enum_reference("units", &Lv2PluginUiPort::units_, get_units_enum_converter()),
|
||||
MAP_REF(Lv2PluginUiPort, comment),
|
||||
|
||||
@@ -227,6 +227,7 @@ namespace pipedal
|
||||
std::string comment_;
|
||||
PiPedalUI::ptr piPedalUI_;
|
||||
|
||||
std::string pipedal_ledColor_;
|
||||
|
||||
public:
|
||||
bool IsSwitch() const
|
||||
@@ -293,6 +294,7 @@ namespace pipedal
|
||||
LV2_PROPERTY_GETSET(port_group);
|
||||
LV2_PROPERTY_GETSET(comment);
|
||||
LV2_PROPERTY_GETSET_SCALAR(units);
|
||||
LV2_PROPERTY_GETSET(pipedal_ledColor);
|
||||
|
||||
LV2_PROPERTY_GETSET(buffer_type);
|
||||
|
||||
@@ -497,6 +499,7 @@ namespace pipedal
|
||||
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()),
|
||||
trigger_property_(pPort->trigger_property()),
|
||||
pipedal_ledColor_(pPort->pipedal_ledColor()),
|
||||
comment_(pPort->comment()), units_(pPort->units()),
|
||||
connection_optional_(pPort->connection_optional())
|
||||
{
|
||||
@@ -540,6 +543,7 @@ namespace pipedal
|
||||
bool trigger_property_ = false;
|
||||
std::vector<Lv2ScalePoint> scale_points_;
|
||||
std::string port_group_;
|
||||
std::string pipedal_ledColor_;
|
||||
|
||||
Units units_ = Units::none;
|
||||
std::string comment_;
|
||||
@@ -572,6 +576,7 @@ namespace pipedal
|
||||
LV2_PROPERTY_GETSET_SCALAR(is_program_controller);
|
||||
LV2_PROPERTY_GETSET(custom_units);
|
||||
LV2_PROPERTY_GETSET(connection_optional);
|
||||
LV2_PROPERTY_GETSET(pipedal_ledColor);
|
||||
|
||||
public:
|
||||
static json_map::storage_type<Lv2PluginUiPort> jmap;
|
||||
@@ -707,6 +712,8 @@ namespace pipedal
|
||||
AutoLilvNode pipedalUI__outputPorts;
|
||||
AutoLilvNode pipedalUI__text;
|
||||
|
||||
AutoLilvNode pipedalUI__ledColor;
|
||||
|
||||
AutoLilvNode time_Position;
|
||||
AutoLilvNode time_barBeat;
|
||||
AutoLilvNode time_beatsPerMinute;
|
||||
@@ -717,6 +724,7 @@ namespace pipedal
|
||||
|
||||
AutoLilvNode ui__portNotification;
|
||||
AutoLilvNode ui__plugin;
|
||||
AutoLilvNode ui__ledColor;
|
||||
AutoLilvNode ui__protocol;
|
||||
AutoLilvNode ui__floatProtocol;
|
||||
AutoLilvNode ui__peakProtocol;
|
||||
@@ -735,6 +743,7 @@ namespace pipedal
|
||||
AutoLilvNode dc__format;
|
||||
|
||||
AutoLilvNode mod__fileTypes;
|
||||
AutoLilvNode pipedalui__fileTypes;
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user