Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ If you have the possibility, you should try to match the format of the voice.
#![feature(unsafe_destructor)]
#![unstable]

#[cfg(all(not(windows), not(unix)))]
use this_platform_is_not_supported;

pub use samples_formats::{SampleFormat, Sample};

use std::ops::{Deref, DerefMut};
Expand All @@ -68,6 +65,10 @@ mod cpal_impl;
#[path="wasapi/mod.rs"]
mod cpal_impl;

#[cfg(all(not(windows), not(unix)))]
#[path="null/mod.rs"]
mod cpal_impl;

/// Controls a sound output. A typical application has one `Voice` for each sound
/// it wants to output.
///
Expand Down
39 changes: 39 additions & 0 deletions src/null/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pub struct Voice;
pub struct Buffer<'a, T>;

impl Voice {
pub fn new() -> Voice {
Voice
}

pub fn get_channels(&self) -> ::ChannelsCount {
2
}

pub fn get_samples_rate(&self) -> ::SamplesRate {
::SamplesRate(44100)
}

pub fn get_samples_format(&self) -> ::SampleFormat {
::SampleFormat::U16
}

pub fn append_data<'a, T>(&'a mut self, _: uint) -> Buffer<'a, T> {
Buffer
}

pub fn play(&mut self) {
}

pub fn pause(&mut self) {
}
}

impl<'a, T> Buffer<'a, T> {
pub fn get_buffer<'b>(&'b mut self) -> &'b mut [T] {
[].as_mut_slice()
}

pub fn finish(self) {
}
}