Skip to content
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

Add underscore to audio engine v2 public internal class members #16375

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

docEdub
Copy link
Contributor

@docEdub docEdub commented Mar 20, 2025

Makes no changes to the documented public API.

@docEdub docEdub requested a review from Copilot March 20, 2025 22:09
@docEdub docEdub enabled auto-merge (squash) March 20, 2025 22:09
@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR renames a number of internal properties and methods in the Audio Engine V2 codebase by adding an underscore prefix so that the public API remains unchanged while internal members are clearly separated. Key changes include replacing references to engine.audioContext with engine._audioContext, renaming getters from inNode/outNode to _inNode/_outNode, and updating initialization methods (init → _init).

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/dev/core/src/AudioV2/webAudio/webAudioMainOut.ts Renamed engine property access and inNode getter to updated underscore names.
packages/dev/core/src/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.ts Updated usage of engine audioContext and inNode getter to their underscore counterparts.
packages/dev/core/src/AudioV2/webAudio/webAudioEngine.ts Replaced calls to init and node addition/removal methods with their underscore-prefixed versions and updated audioContext references.
packages/dev/core/src/AudioV2/webAudio/subNodes/volumeWebAudioSubNode.ts, stereoWebAudioSubNode.ts, spatialWebAudioSubNode.ts Updated constructors and getter names to access engine._audioContext and _inNode/_outNode consistently.
packages/dev/core/src/AudioV2/webAudio/webAudioStaticSound.ts & webAudioStreamingSound.ts Updated initialization methods and node connectivity to use underscore-prefixed internal members.
packages/dev/core/src/AudioV2/webAudio/webAudioBus.ts, subProperties/spatialWebAudioListener.ts, abstractAudio/subNodes/spatialAudioSubNode.ts, webAudioBusAndSoundSubGraph.ts, webAudioBaseSubGraph.ts, webAudioNode.ts Applied consistent renaming for internal members and getter interfaces across various modules.
Comments suppressed due to low confidence (2)

packages/dev/core/src/AudioV2/webAudio/webAudioStaticSound.ts:506

  • Consider verifying if the AudioBufferSourceNode should be created with this._sound._audioContext instead of this._sound.audioContext for consistency with the underscore naming convention.
this._sourceNode = new AudioBufferSourceNode(this._sound.audioContext, { buffer: this._sound.buffer._audioBuffer });

packages/dev/core/src/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.ts:136

  • [nitpick] Verify that renaming the internal input node to _inputNode and exposing it via the _inNode getter achieves the intended design, and consider whether a more consistent naming approach might improve clarity.
if (this._inputNode !== inNode) {

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2025

@docEdub docEdub merged commit 89b38bc into BabylonJS:master Mar 20, 2025
16 checks passed
@docEdub docEdub deleted the 250320-add-underscore-prefixes branch April 7, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants