Add plugin version and parameter count to VST user presets
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
parent
83a0b1e3a8
commit
8e25b4d193
@ -308,8 +308,8 @@ struct _AEffect
|
|||||||
void *user;
|
void *user;
|
||||||
// Id 48-4b
|
// Id 48-4b
|
||||||
int32_t uniqueID;
|
int32_t uniqueID;
|
||||||
// Don't know 4c-4f
|
// Version 4c-4f
|
||||||
char unknown1[4];
|
int32_t version;
|
||||||
// processReplacing 50-53
|
// processReplacing 50-53
|
||||||
void (* processReplacing) (struct _AEffect *, float **, float **, int);
|
void (* processReplacing) (struct _AEffect *, float **, float **, int);
|
||||||
};
|
};
|
||||||
|
@ -81,8 +81,9 @@ public:
|
|||||||
const char * label () const;
|
const char * label () const;
|
||||||
const char * name () const;
|
const char * name () const;
|
||||||
const char * maker () const;
|
const char * maker () const;
|
||||||
|
int32_t version () const;
|
||||||
uint32_t parameter_count () const;
|
uint32_t parameter_count () const;
|
||||||
void print_parameter (uint32_t, char*, uint32_t len) const;
|
void print_parameter (uint32_t, char*, uint32_t len) const;
|
||||||
|
|
||||||
bool has_editor () const;
|
bool has_editor () const;
|
||||||
|
|
||||||
|
@ -540,22 +540,28 @@ VSTPlugin::do_save_preset (string name)
|
|||||||
sha1_result_hash (&s, hash);
|
sha1_result_hash (&s, hash);
|
||||||
|
|
||||||
string const uri = string_compose (X_("VST:%1:x%2"), unique_id (), hash);
|
string const uri = string_compose (X_("VST:%1:x%2"), unique_id (), hash);
|
||||||
|
string const str_ver = std::to_string (version ());
|
||||||
|
string const num_params = std::to_string (parameter_count ());
|
||||||
|
|
||||||
if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
|
if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
|
||||||
|
|
||||||
p = new XMLNode (X_("ChunkPreset"));
|
p = new XMLNode (X_("ChunkPreset"));
|
||||||
p->set_property (X_("uri"), uri);
|
} else {
|
||||||
p->set_property (X_("label"), name);
|
p = new XMLNode (X_("Preset"));
|
||||||
|
}
|
||||||
|
|
||||||
|
p->set_property (X_("uri"), uri);
|
||||||
|
p->set_property (X_("version"), str_ver);
|
||||||
|
p->set_property (X_("label"), name);
|
||||||
|
p->set_property (X_("numParams"), num_params);
|
||||||
|
|
||||||
|
if (_plugin->flags & 32) {
|
||||||
|
|
||||||
gchar* data = get_chunk (true);
|
gchar* data = get_chunk (true);
|
||||||
p->add_content (string (data));
|
p->add_content (string (data));
|
||||||
g_free (data);
|
g_free (data);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
p = new XMLNode (X_("Preset"));
|
|
||||||
p->set_property (X_("uri"), uri);
|
|
||||||
p->set_property (X_("label"), name);
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < parameter_count(); ++i) {
|
for (uint32_t i = 0; i < parameter_count(); ++i) {
|
||||||
if (parameter_is_input (i)) {
|
if (parameter_is_input (i)) {
|
||||||
XMLNode* c = new XMLNode (X_("Parameter"));
|
XMLNode* c = new XMLNode (X_("Parameter"));
|
||||||
@ -761,6 +767,12 @@ VSTPlugin::label () const
|
|||||||
return _handle->name;
|
return _handle->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t
|
||||||
|
VSTPlugin::version () const
|
||||||
|
{
|
||||||
|
return _plugin->version;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
VSTPlugin::parameter_count () const
|
VSTPlugin::parameter_count () const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user