mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-24 06:10:09 +01:00
commit it tidied up version of the patch to fix bug 497, with a consistent error message (none of the others include the Error. prefix) and some documentation of what the nyx function returns for future sanity.
This commit is contained in:
@@ -875,7 +875,11 @@ int nyx_get_audio_num_channels()
|
||||
}
|
||||
|
||||
if (vectorp(nyx_result)) {
|
||||
return getsize(nyx_result);
|
||||
if (getsize(nyx_result) == 1) {
|
||||
return -1; // invalid number of channels in array
|
||||
} else {
|
||||
return getsize(nyx_result);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -64,6 +64,12 @@ extern "C"
|
||||
|
||||
nyx_rval nyx_eval_expression(const char *expr);
|
||||
|
||||
/** @brief Get the number of channels in the Nyquist audio object
|
||||
*
|
||||
* @return The positive integer number of audio channels in the
|
||||
* Nyquist audio object, 0 if not an audio object, -1 one if
|
||||
* Nyquist returns an array of samples (which we can't handle)
|
||||
*/
|
||||
int nyx_get_audio_num_channels();
|
||||
int nyx_get_audio(nyx_audio_callback callback,
|
||||
void *userdata);
|
||||
|
||||
Reference in New Issue
Block a user