Struct sdl2_mixer::Channel [] [src]

pub struct Channel(_);

Sound effect channel.

Methods

impl Channel
[src]

fn all() -> Channel

Represent for all channels (-1)

fn post() -> Channel

This is the MIX_CHANNEL_POST (-2)

fn set_volume(self, volume: isize) -> isize

Set the volume for any allocated channel.

fn get_volume(self) -> isize

Returns the channels volume on scale of 0 to 128.

fn play(self, chunk: &Chunk, loops: isize) -> SdlResult<Channel>

Play chunk on channel, or if channel is -1, pick the first free unreserved channel.

fn play_timed(self, chunk: &Chunk, loops: isize, ticks: isize) -> SdlResult<Channel>

fn fade_in(self, chunk: &Chunk, loops: isize, ms: isize) -> SdlResult<Channel>

Play chunk on channel, or if channel is -1, pick the first free unreserved channel.

fn fade_in_timed(self, chunk: &Chunk, loops: isize, ms: isize, ticks: isize) -> SdlResult<Channel>

fn pause(self)

Pause channel, or all playing channels if -1 is passed in.

fn resume(self)

Unpause channel, or all playing and paused channels if -1 is passed in.

fn halt(self)

Halt channel playback

fn expire(self, ticks: isize) -> isize

Halt channel playback, after ticks milliseconds.

fn fade_out(self, ms: isize) -> isize

Gradually fade out which channel over ms milliseconds starting from now.

fn is_playing(self) -> bool

if channel is playing, or not.

fn is_paused(self) -> bool

if channel is paused, or not.

fn get_fading(self) -> Fading

if channel is fading in, out, or not

fn get_chunk(self) -> Option<Chunk>

Get the most recent sample chunk pointer played on channel.

fn unregister_all_effects(self) -> SdlResult<()>

This removes all effects registered to channel.

fn set_panning(self, left: u8, right: u8) -> SdlResult<()>

Sets a panning effect, where left and right is the volume of the left and right channels. They range from 0 (silence) to 255 (loud).

fn unset_panning(self) -> SdlResult<()>

Unregisters panning effect.

fn set_distance(self, distance: u8) -> SdlResult<()>

This effect simulates a simple attenuation of volume due to distance. distance ranges from 0 (close/loud) to 255 (far/quiet).

fn unset_distance(self) -> SdlResult<()>

Unregisters distance effect.

fn set_position(self, angle: i16, distance: u8) -> SdlResult<()>

This effect emulates a simple 3D audio effect. angle ranges from 0 to 360 degrees going clockwise, where 0 is directly in front. distance ranges from 0 (close/loud) to 255 (far/quiet).

fn unset_position(self) -> SdlResult<()>

Unregisters position effect.

fn set_reverse_stereo(self, flip: bool) -> SdlResult<()>

Simple reverse stereo, swaps left and right channel sound. true for reverse, false to unregister effect.

Trait Implementations

impl PartialEq for Channel
[src]

fn eq(&self, __arg_0: &Channel) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Channel) -> bool

This method tests for !=.

impl Clone for Channel
[src]

fn clone(&self) -> Channel

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for Channel
[src]

impl Debug for Channel
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.