The purpose of the plugin is to toggle the option Editing a clip can move other clips. Then I can assign a keyboard shortcut for that.
Plugin should read the preferences value “/GUI/EditClipCanMove” and then set it the opposite state [0;1].
It does not work, instead it return a message with the value of variable originalstate.
This line won’t work because “originalstate” is a string “0” or “1”, not numbers 0 or 1.
We can see this in the debug message:
error: bad argument type - "1"
Function: #<Subr--: #0x55faec0c1bd8>
Arguments:
1
"1"
Function: #<FSubr-SETF: #0x55faec0b92a8>
Arguments:
NEWSTATE
(- 1 ORIGINALSTATE)
Reading Nyquist debug messages is not easy, especially as they don’t give line numbers, but reading through this debug message line by line:
error: bad argument type - “1”
Error: we are passing the string value “1” to a function, which is the wrong data type.
Function: #<Subr–: #0x55faec0c1bd8>
The function’s id is #0x55faec0c1bd8. This isn’t very useful, other than it tells us that we are looking into a function …
Arguments:
and now the arguments that are being passed to that function…
1
The argument being passed to the function…
“1”
Oh, look, it is a string value “1”
Function: #<FSubr-SETF: #0x55faec0b92a8>
The containing function’s id
Arguments:
and now the argument list for the containing function…
NEWSTATE
First argument
(- 1 ORIGINALSTATE)
Second argument.
The debug error messages start with the fatal error, then work backwards, so we can deduce that:
We are passing a string, which is the wrong data type for the function that we are passing it to.
The function that we are passing it to (id = #0x55faec0b92a8) has arguments “NEWSTATE” and “(- 1 ORIGINALSTATE)”.
So we are looking for the error in a line that looks like:
(some-function NEWSTATE (- 1 ORIGINALSTATE))
Looking at our code, this line looks very much like the above:
(setf newstate (- 1 originalstate))
You’re welcome. I’ll close this topic as “solved”, but please feel free to create a new topic if you would like to make your plug-in available to other Audacity users.