@@ -685,7 +685,7 @@ class ParamsDialog {
685
685
} else if (after == Param::AfterOption::invalidateParams) {
686
686
this ->source ->rebuildParams ();
687
687
this ->updateParamList ();
688
- } else {
688
+ } else if (after == Param::AfterOption::dismiss) {
689
689
SendMessage (this ->dialog , WM_CLOSE, 0 , 0 );
690
690
}
691
691
}
@@ -835,11 +835,16 @@ class FxParam: public Param {
835
835
FxParams<ReaperObj>& source;
836
836
int fx;
837
837
int param;
838
+ double unrestrictedMin = 0 ;
839
+ double unrestrictedMax = 0 ;
838
840
839
841
public:
840
842
FxParam (FxParams<ReaperObj>& source, int fx, int param):
841
843
Param (), source(source), fx(fx), param(param) {
842
- source._GetParam (source.obj , fx, param, &this ->min , &this ->max );
844
+ source._GetParam (source.obj , fx, param, &this ->unrestrictedMin ,
845
+ &this ->unrestrictedMax );
846
+ this ->min = this ->unrestrictedMin ;
847
+ this ->max = this ->unrestrictedMax ;
843
848
// *FX_GetParameterStepSizes doesn't set these to 0 if it can't fetch them,
844
849
// even if it returns true.
845
850
this ->step = 0 ;
@@ -895,6 +900,46 @@ class FxParam: public Param {
895
900
void setValueFromEdited (const string& text) final {
896
901
this ->setValue (atof (text.c_str ()));
897
902
}
903
+
904
+ Param::MoreOptions getMoreOptions () final {
905
+ Param::MoreOptions options;
906
+ double val = this ->getValue ();
907
+ if (val == this ->min ) {
908
+ options.push_back ({
909
+ translate (" Unrestrict minimum" ),
910
+ [this ] {
911
+ this ->min = this ->unrestrictedMin ;
912
+ return Param::AfterOption::nothing;
913
+ }
914
+ });
915
+ } else {
916
+ options.push_back ({
917
+ translate (" Restrict minimum to current value" ),
918
+ [this ] {
919
+ this ->min = this ->getValue ();
920
+ return Param::AfterOption::nothing;
921
+ }
922
+ });
923
+ }
924
+ if (val == this ->max ) {
925
+ options.push_back ({
926
+ translate (" Unrestrict maximum" ),
927
+ [this ] {
928
+ this ->max = this ->unrestrictedMax ;
929
+ return Param::AfterOption::nothing;
930
+ }
931
+ });
932
+ } else {
933
+ options.push_back ({
934
+ translate (" Restrict maximum to current value" ),
935
+ [this ] {
936
+ this ->max = this ->getValue ();
937
+ return Param::AfterOption::nothing;
938
+ }
939
+ });
940
+ }
941
+ return options;
942
+ }
898
943
};
899
944
900
945
// The possible values for an FX named config param. The first string is the
0 commit comments