-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reinit. Audio Engine for MegaDrone on restart. #523
Conversation
…s. This refactor impacted MegaDrone and RhythmGame. This prevents ambiguous ownership of audio components, leaving the owner of the Mixer as the sole owner of the inputs to the Mixer. This allows for objects with the Mixer as a member along with its inputs to control their duration automatically, in aggregate. This fixes crashes on destruction of objects composing the Mixer and various inputs. (E.g. Fixes #521).
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
Changed username, replying to recheck CLA |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
// Rendering objects | ||
std::array<Oscillator, kNumOscillators> mOscs; | ||
Mixer mMixer; | ||
std::shared_ptr<IRenderableAudio> mOutputStage; | ||
MonoToStereo mConverter = MonoToStereo(&mMixer); | ||
IRenderableAudio *mOutputStage; // This will point to either the mixer or converter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be declared const? The pointer will not change after the constructor.
IRenderableAudio * const mOutputStage; // const pointer to mutable object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a const ptr is a little bit messy because of the need to initialize prior to the constructor.
If it is clearer, we can use a non-const pointer and have it instantiated as before.
I see what you mean. This is messy. Feel free to go back to the original.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted back in latest commit
Using a const ptr is a little bit messy because of the need to initialize prior to the constructor. If it is clearer, we can use a non-const pointer and have it instantiated as before. |
Many thanks for fixing this. |
Fixes #521