d-uzlov / Rainmeter-Plugins-by-rxtd

A set of plugins for Rainmeter
GNU General Public License v3.0
10 stars 1 forks source link

Process all available channels at once (multichannel support) #2

Closed sctanf closed 3 years ago

sctanf commented 4 years ago

Channel Auto works with the front left and front right channels, but nothing else.

I experimented with adding channels and sanity checks (for differing setups) in ChannelMixer.cpp and it appears to work, but I get some pauses with very high numbers of bands and/or very small BinWidth (high cpu usage?).

This is my first time working with plugin code, sorry.

d-uzlov commented 3 years ago

Hello, @sctanf I'm sorry I didn't leave any comment on this. I haven't received any notifications from github about new pull requests, and I didn't check pull requests page on the site in the past half a year, so I didn't know about it before today.

Thank you for your contribution but I can't accept it.

Channel Auto only uses front channels because usually only these 2 channels have sound in them. In most cases all the other channels are silent, so including them in the average would only reduce registered loudness. Auto is intended to be used in all cases except special situations (when user knows which exact channels are needed), and averaging all channels in most cases is worse that averaging only front channels.

At some point I considered adding a more complex mechanism of specifying source channels, so that maybe there could be front, back, side averages, or side+back average, or anything else, but I didn't have time to code this.

Maybe it's worth to add just back and side averages (and maybe something like Full, which would average all channels) for cases when user knows that he needs all channels but doesn't want to have separate left and right values, but they would need to be separate averages. Adding them would be a bit easier than adding full custom channels support, but it would still require to significantly rewrite ChannelMixer and probably several other classes because in current implementation Auto channel is a special channel with special if() blocks and is calculated always, which is not a good solution for a big number of such channels (both for performance and code readability reasons). I don't have time for this right now (and probably won't have time in the foreseeable future) but if you can rewrite related classes to generalize special channels without much clutter in code then you are welcome to make another pull request.

sctanf commented 3 years ago

Okay, thanks! I'm not all too familiar with the code yet but maybe I can give this a try someday.