Skip to content

Commit 7e0c3cd

Browse files
committed
Add "priority" field in parameter extension. (#159)
1 parent 7abe27c commit 7e0c3cd

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

androidaudioplugin/src/main/cpp/android/AAPJniFacade.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ namespace aap {
127127
"(I)Lorg/androidaudioplugin/PortInformation;");
128128

129129
j_method_parameter_ctor = env->GetMethodID(java_parameter_information_class, "<init>",
130-
"(ILjava/lang/String;DDD)V");
130+
"(ILjava/lang/String;DDDD)V");
131131
j_method_parameter_get_id = env->GetMethodID(java_parameter_information_class, "getId",
132132
"()I");
133133
j_method_parameter_get_name = env->GetMethodID(java_parameter_information_class, "getName",
@@ -681,7 +681,7 @@ namespace aap {
681681
assert(klass);
682682
return env->NewObject(klass, j_method_parameter_ctor, (jint) para->getId(),
683683
env->NewStringUTF(para->getName()), para->getMinimumValue(),
684-
para->getMaximumValue(), para->getDefaultValue());
684+
para->getMaximumValue(), para->getDefaultValue(), para->getPriority());
685685
});
686686
}
687687

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package org.androidaudioplugin
22

3-
class ParameterInformation(var id: Int, var name: String, var minimumValue: Double = 0.0, var maximumValue: Double = 1.0, var defaultValue: Double = 0.0)
3+
class ParameterInformation(var id: Int, var name: String, var minimumValue: Double = 0.0, var maximumValue: Double = 1.0, var defaultValue: Double = 0.0, var priority: Double = 0.0)

include/aap/core/plugin-information.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ class ParameterInformation : public PropertyContainer {
7474
double min_value;
7575
double max_value;
7676
double default_value;
77+
double priority;
7778

7879
public:
79-
ParameterInformation(int32_t id, std::string name, double minValue, double maxValue, double defaultValue)
80-
: id(id), name(name), min_value(minValue), max_value(maxValue), default_value(defaultValue)
80+
ParameterInformation(int32_t id, std::string name, double minValue, double maxValue, double defaultValue, double priority = 0)
81+
: id(id), name(name), min_value(minValue), max_value(maxValue), default_value(defaultValue), priority(priority)
8182
{
8283
}
8384

@@ -86,6 +87,7 @@ class ParameterInformation : public PropertyContainer {
8687
double getMinimumValue() const { return min_value; }
8788
double getMaximumValue() const { return max_value; }
8889
double getDefaultValue() const { return default_value; }
90+
double getPriority() const { return priority; }
8991
};
9092

9193
class PluginExtensionInformation

include/aap/ext/parameters.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ typedef struct aap_parameter_info_t {
4747
double max_value;
4848
double default_value;
4949
bool per_note_enabled;
50+
// It helps to determine which parameters should be displayed on generic compact views.
51+
// It does not imply anything other than priority (e.g. "-1 means never show up"; it is up to host)
52+
double priority;
5053
} aap_parameter_info_t;
5154

5255
typedef struct aap_parameters_extension_t {

0 commit comments

Comments
 (0)