Ability to pass a FactoryInstance to WaveformAudioBufferSink which will create custom WaveformBar instances#3038
Conversation
…ll create custom WaveformBar instances
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
This is a duplicate of #2998 which was closed because the CLA was not signed after 3 weeks. The CLA still appears to be unsigned. Please sign the CLA. |
I have signed it yesterday. |
|
Thanks, I've re-run it and it's passing now. |
|
Hi - would it be possible to open a new PR from an individual-owned fork? We can't push changes to organization-owned forks like this one unless we have collaborator access. If that's not possible then we can still merge this PR but it will result in an 'evil' merge. See more info here: https://github.com/androidx/media/blob/release/CONTRIBUTING.md#push-access-to-pr-branches |
| /** | ||
| * Default factory instance that creates standard WaveformBar objects. | ||
| */ | ||
| private static final WaveformBarFactory DEFAULT_WAVEFORM_BAR_FACTORY = new WaveformBarFactory(); |
There was a problem hiding this comment.
We usually use interfaces to allow customization. Could you make WaveformBar an interface?
If a consumer app wants to override the behavior of WaveformBar it is not possible, because the creation is happening internally in WaveformAudioBufferSink.
One option is to have a override constructor for WaveformAudioBufferSink, which takes an Factory that will be responsible for creating WaveformBar.
Consumer app can pass this factory instance and create custom WaveformBar instances.
The current constructor which is present will be still available and the current WaveformBar will be created.
There will be no impact in current behavior
Added unit test for the custom factory.