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

x/mobile/exp/audio/al: add missing generic accessors and setters #13912

Open
rakyll opened this issue Jan 11, 2016 · 3 comments
Open

x/mobile/exp/audio/al: add missing generic accessors and setters #13912

rakyll opened this issue Jan 11, 2016 · 3 comments
Labels
mobile Android, iOS, and x/mobile
Milestone

Comments

@rakyll
Copy link
Contributor

rakyll commented Jan 11, 2016

Continuing the discussion started at #11298 (comment)...

Source offset setters are missing from the package and the offset must represented in float32 for more precision. Suggested APIs are below.

// OffsetSeconds returns the current playback position of the source in seconds.
func (s Source) OffsetSeconds() float32 {
return getSourcef(s, paramSecOffset)
}

// SetOffsetSeconds sets the current playback position of the source in seconds.
func (s Source) SetOffsetSeconds(sec float32){
setSourcef(s, paramSecOffset,sec)
}

// OffsetSample returns the sample offset of the current playback position.
func (s Source) OffsetSample() int32 {
return getSourcei(s, paramSampleOffset)
}

// SetOffsetSample sets the sample offset of the current playback position.
func (s Source) SetOffsetSample(i int32){
setSourcei(s, paramSampleOffset,i)
}

// OffsetByte returns the byte offset of the current playback position.
func (s Source) OffsetByte() int32 {
return getSourcei(s, paramByteOffset)
}

// SetOffsetByte sets the byte offset of the current playback position.
func (s Source) SetOffsetByte(i int32){
setSourcei(s, paramByteOffset,i)
}

/cc @splace

@gopherbot
Copy link

CL https://golang.org/cl/18541 mentions this issue.

@splace
Copy link

splace commented Jan 12, 2016

i think it must be because openal is dynamically extensible, that it makes everything accessible via only a few general functions, that only vary by parameter type, and then uses another parameter to indicate the actual thing being set/read.
which is how offset could be int or float, when float includes the same functionality.

i did look through the spec briefly, looking for other omissions that might be sensibly added, and didn't find any more, but i guess there will be others that are effectively only present because of this extensibility.
the approach seems to have been to have anything that possibly makes sense, maybe also to lessen type conversions?

but, the Go wrapper's current approach of hiding the parametrised calls, by sending each through a separate function, stops the dynamic extension mechanism, in that, it means any extensions would require functions to be added statically.

gopherbot pushed a commit to golang/mobile that referenced this issue Jan 27, 2016
Updates golang/go#13912.

Change-Id: I2dadbba0c155c1f4b53663031069098d3f3b156a
Reviewed-on: https://go-review.googlesource.com/18541
Reviewed-by: David Crawshaw <crawshaw@golang.org>
@gopherbot
Copy link

CL https://golang.org/cl/19472 mentions this issue.

@rakyll rakyll changed the title x/mobile/exp/audio/al: offset setters are missing x/mobile/exp/audio/al: add missing generic accessors and setters Feb 13, 2016
gopherbot pushed a commit to golang/mobile that referenced this issue Feb 18, 2016
Updates golang/go#13912.

Change-Id: I0eb017513872c9d44364b8c96e632ce3d08c6e10
Reviewed-on: https://go-review.googlesource.com/19472
Reviewed-by: David Crawshaw <crawshaw@golang.org>
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Jul 20, 2017
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Updates golang/go#13912.

Change-Id: I2dadbba0c155c1f4b53663031069098d3f3b156a
Reviewed-on: https://go-review.googlesource.com/18541
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Updates golang/go#13912.

Change-Id: I0eb017513872c9d44364b8c96e632ce3d08c6e10
Reviewed-on: https://go-review.googlesource.com/19472
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Updates golang/go#13912.

Change-Id: I2dadbba0c155c1f4b53663031069098d3f3b156a
Reviewed-on: https://go-review.googlesource.com/18541
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Updates golang/go#13912.

Change-Id: I0eb017513872c9d44364b8c96e632ce3d08c6e10
Reviewed-on: https://go-review.googlesource.com/19472
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile
Projects
None yet
Development

No branches or pull requests

3 participants