Rename SamplesRate to SampleRate and ChannelsCount to ChannelCount (#199)

* Rename SamplesRate to SampleRate and samples_rate to sample_rate

* Rename ChannelsCount to ChannelCount

* Update CHANGELOG for SamplesRate and ChannelsCount renaming
This commit is contained in:
mitchmindtree 2018-02-04 23:02:16 +11:00 • committed by Pierre Krieger
parent f2728f6bdf
commit fcc75f4566
8 changed files with 44 additions and 42 deletions

View file

@ -1,13 +1,13 @@
extern crate coreaudio;
extern crate core_foundation_sys;
use ChannelsCount;
use ChannelCount;
use CreationError;
use Format;
use FormatsEnumerationError;
use Sample;
use SampleFormat;
use SamplesRate;
use SampleRate;
use SupportedFormat;
use UnknownTypeBuffer;
@ -151,9 +151,9 @@ impl Endpoint {
let mut fmts = vec![];
for range in ranges {
let fmt = SupportedFormat {
channels: n_channels as ChannelsCount,
min_samples_rate: SamplesRate(range.mMinimum as _),
max_samples_rate: SamplesRate(range.mMaximum as _),
channels: n_channels as ChannelCount,
min_sample_rate: SampleRate(range.mMinimum as _),
max_sample_rate: SampleRate(range.mMaximum as _),
data_type: sample_format,
};
fmts.push(fmt);
@ -282,7 +282,7 @@ impl EventLoop {
// Set the stream in interleaved mode.
let n_channels = format.channels as usize;
let sample_rate = format.samples_rate.0;
let sample_rate = format.sample_rate.0;
let bytes_per_channel = format.data_type.sample_size();
let bits_per_channel = bytes_per_channel * 8;
let bytes_per_frame = n_channels * bytes_per_channel;