Open tomoyanonymous opened 4 years ago
Sorry, I solved this by calling Max-API directly. Of course, this totally ruins a cleanness of min-API :( but it worked
namespace max = c74::max;
class rtpreceive_tilde : public object<rtpreceive_tilde>, public mc_operator<> {
//adding callback on class registration
message<> maxclass_setup{this, "maxclass_setup",
MIN_FUNCTION{
auto c = max::class_findbyname(max::gensym("box"), max::gensym("mc.rtpreceive~"));
max::class_addmethod(c,(max::method)setOutChans,"multichanneloutputs",max::A_CANT, 0);
return {};
}};
...
//callback will be called on a recompilation of dsp graph
static long setOutChans(void* obj, long outletindex) {
auto chs = max::object_attr_getlong(obj, max::gensym("channels"));
return chs;
}
};
maybe is that work if we add a wrapper for "multichanneloutputs"
event to c74_min_object_wrapper.h?
Thanks for the note. This is a great idea. It would definitely provide a cleaner experience if there were a method that could be called on the outlet.
Hi @tomoyanonymous and @tap. I am trying to change the channel output number in my max-external (min-devkit). I am wondering if there is already an C++ solution for replacing you code above. Any update?
AFAIK still not.
Still no way to achieve that ?
Hi, thanks for creating a very nice framework. I'm now trying to create a network audio-transfer object with min framework and ffmpeg API(like netsend~&netreceive~ existed in many years ago).
I read an example of mc.min.info_tilde and understood the way to auto-adapt to incoming audio channels but still struggling on changing a number of output channels.
By specifying type on a declaration of an outlet like below,
I confirmed the first outlet became multichannel signal successfully but with a single channel. However, I could not find a way to modify the number of channels manually... is it not supported yet?
Best regards.