[Webkit-unassigned] [Bug 34660] audio engine: add audio resources abstraction
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Feb 5 14:07:21 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=34660
Darin Adler <darin at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #48257|review? |review-
Flag| |
--- Comment #2 from Darin Adler <darin at apple.com> 2010-02-05 14:07:22 PST ---
(From update of attachment 48257)
I have no idea what a spatialization resource is, so please take the feedback
with a grain of salt.
> +const char* GetAudioSpatializationResourcePath();
WebKit function names begin with a lower case letter.
WebKit function names use "get" in their names only if the use out arguments.
Functions with return values are named after their return values.
> + // First look in Resources directory for application's main bundle
> + NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
> +
> + NSString* spatializationPath = [resourcePath stringByAppendingPathComponent:@"AudioSpatialization"];
> +
> + if ([[NSFileManager defaultManager] fileExistsAtPath:spatializationPath]) {
> + return [spatializationPath UTF8String];
> + }
> +
> + // Impulse responses are not found in browser application's resources directory
> + // fallback to looking in WebCore.framework
> +
> + NSString* webCorePath = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] resourcePath];
> +
> + spatializationPath = [webCorePath stringByAppendingPathComponent:@"AudioSpatialization"];
> +
> + if ([[NSFileManager defaultManager] fileExistsAtPath:spatializationPath]) {
> + return [spatializationPath UTF8String];
> + }
WebKit project uses a space between NSString and *, although we are talking
about changing that guideline, because it's inconsistent with what we do for
C++ types. Please follow our current guideline.
WebKit project uses no braces around a single line if statement body.
The correct method to use for a path is fileSystemRepresentation rather than
UTF8String.
> + return NULL; // not found anywhere
WebKit project uses 0 for this.
In general this code seems to have so little to do with audio that I think it
should be calling some shared functions that can get at resources. It shouldn’t
be doing all the bundle stuff directly
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list