Remove unused ChannelPosition API (update all backends and examples accordingly) (#198)

* Remove ChannelPosition API

This removes the ChannelPosition API from the lib root and updates the
ALSA backend and examples accordingly. The other backends have not yet
been updated.

Related discussion at #187.

* Update windows backend to removal of ChannelPosition API

The windows backend now assumes the channel position order is equal to
the channel position mask order. E.g. channel 0 will always be front
left, channel 1 will always be front right, etc.

Compiled and ran both examples successfully.

* Update coreaudio backend to removal of ChannelPosition API

Compiled and ran both examples successfully.

* Update emscriptem backend for removal of ChannelPosition API

* Update CHANGELOG for ChannelPosition removal
This commit is contained in:
mitchmindtree 2018-02-04 20:38:06 +11:00 • committed by Pierre Krieger
parent 6bf65f589d
commit f2728f6bdf
8 changed files with 45 additions and 172 deletions

View file

@ -25,7 +25,7 @@ fn main() {
event_loop.run(move |_, buffer| {
match buffer {
cpal::UnknownTypeBuffer::U16(mut buffer) => {
for sample in buffer.chunks_mut(format.channels.len()) {
for sample in buffer.chunks_mut(format.channels as usize) {
let value = ((next_value() * 0.5 + 0.5) * std::u16::MAX as f32) as u16;
for out in sample.iter_mut() {
*out = value;
@ -34,7 +34,7 @@ fn main() {
},
cpal::UnknownTypeBuffer::I16(mut buffer) => {
for sample in buffer.chunks_mut(format.channels.len()) {
for sample in buffer.chunks_mut(format.channels as usize) {
let value = (next_value() * std::i16::MAX as f32) as i16;
for out in sample.iter_mut() {
*out = value;
@ -43,7 +43,7 @@ fn main() {
},
cpal::UnknownTypeBuffer::F32(mut buffer) => {
for sample in buffer.chunks_mut(format.channels.len()) {
for sample in buffer.chunks_mut(format.channels as usize) {
let value = next_value();
for out in sample.iter_mut() {
*out = value;