Add support for AAX meters
- Created issue #800
- This pull requests adds input, output, and gain reduction meters (for Dynamics plugins) that report information back to Pro Tools for metering within the host UI - this could additionally be extended to other formats than AAX if the host supports it.
I was waiting for something like this always wanted to work on it but never found the time! Thank you! one vote for me!
@hor-net do be sure to read the notes on the linked issue #800 about how to implement Gain Reduction in Dynamics plugins - you'll need to add a single call in your plugin's ProcessBlock() method to report the highest gain reduction in that block (0.0 = no reduction, 1.0 = full reduction to silence). That's per Pro Tools AAX SDK docs.
I'll do the work, but do you have a suggestion as to where? I placed it there because it's able to surround the call to the plugin's ProcessBlock() method, and also to plan ahead if VST3 or other SDK would support similar mechanism in the future.
Again, willing to do the work, but unsure where else it could logically go.
edit: I guess I could put it in IPlugAAX::RenderAudio and just surround the call to ProcessBuffers() / PassThroughBuffers()...would that work for you? I'll have to change how I access the buffers, but I think I can accomplish that.
https://github.com/iPlug2/iPlug2/blob/master/IPlug/AAX/IPlugAAX.cpp#L366
I'll work on it this evening if I have a chance. Thanks!
I've refactored into IPlugAAX.h/.cpp - it works here. Please review @olilarkin. It's not pretty but it works.
FYI, making this change means that the call to SetGRBufferMaxValue() in the plugin's ProcessBlock() method must be guarded by:
#ifdef AAX_API SetGRBufferMaxValue(some_value); #endif