add check for n_audio_out>2

This commit is contained in:
Luna 2019-08-06 19:25:31 -03:00
parent 8172066851
commit 75eeea14f3
3 changed files with 15 additions and 4 deletions

View file

@ -95,6 +95,10 @@ pub const WildNoise = struct {
}
};
/// Write any float to the image.
/// Keep in mind that the bit representation of the float will clash with
/// the format of BMP pixel data, which means writing 0 everywhere won't give
/// you the black color.
pub const Write = struct {
data: f32,

View file

@ -249,11 +249,14 @@ pub const Image = struct {
var ports = try lv2.setupPorts(&ctx);
if (ctx.n_audio_in > 2) {
std.debug.warn("plugin <{}> accepts more than two channels.\n", plugin_uri);
std.debug.warn("plugin <{}> has more than two inputs.\n", plugin_uri);
return ImageError.InvalidPlugin;
}
// TODO check n_audio_out > 2
if (ctx.n_audio_out > 2) {
std.debug.warn("plugin <{}> has more than two outputs.\n", plugin_uri);
return ImageError.InvalidPlugin;
}
// now, for each param for the plugin, we find its port, and set
// the value for the port there.