Trait alto::SourceTrait [] [src]

pub trait SourceTrait<'d> {
    fn context(&self) -> &Context<'d>;
    fn raw_source(&self) -> ALuint;
    fn state(&self) -> AltoResult<SourceState>;
    fn play(&mut self) -> AltoResult<()>;
    fn pause(&mut self) -> AltoResult<()>;
    fn stop(&mut self) -> AltoResult<()>;
    fn rewind(&mut self) -> AltoResult<()>;
    fn relative(&self) -> AltoResult<bool>;
    fn set_relative(&mut self, bool) -> AltoResult<()>;
    fn min_gain(&self) -> AltoResult<f32>;
    fn set_min_gain(&mut self, f32) -> AltoResult<()>;
    fn max_gain(&self) -> AltoResult<f32>;
    fn set_max_gain(&mut self, f32) -> AltoResult<()>;
    fn reference_distance(&self) -> AltoResult<f32>;
    fn set_reference_distance(&mut self, f32) -> AltoResult<()>;
    fn rolloff_factor(&self) -> AltoResult<f32>;
    fn set_rolloff_factor(&mut self, f32) -> AltoResult<()>;
    fn max_distance(&self) -> AltoResult<f32>;
    fn set_max_distance(&mut self, f32) -> AltoResult<()>;
    fn pitch(&self) -> AltoResult<f32>;
    fn set_pitch(&mut self, f32) -> AltoResult<()>;
    fn direction<V: From<[f32; 3]>>(&self) -> AltoResult<V>;
    fn set_direction<V: Into<[f32; 3]>>(&mut self, V) -> AltoResult<()>;
    fn cone_inner_angle(&self) -> AltoResult<f32>;
    fn set_cone_inner_angle(&mut self, f32) -> AltoResult<()>;
    fn cone_outer_angle(&self) -> AltoResult<f32>;
    fn set_cone_outer_angle(&mut self, f32) -> AltoResult<()>;
    fn cone_outer_gain(&self) -> AltoResult<f32>;
    fn set_cone_outer_gain(&mut self, f32) -> AltoResult<()>;
    fn sec_offset(&self) -> AltoResult<f32>;
    fn set_sec_offset(&mut self, f32) -> AltoResult<()>;
    fn sample_offset(&self) -> AltoResult<ALint>;
    fn set_sample_offset(&mut self, ALint) -> AltoResult<()>;
    fn byte_offset(&self) -> AltoResult<ALint>;
    fn set_byte_offset(&mut self, ALint) -> AltoResult<()>;
    fn soft_sec_offset_latency(&self) -> AltoResult<(f64, f64)>;
    fn soft_sample_offset_frac_latency(&self) -> AltoResult<(i32, i32, i64)>;
    fn soft_sec_length(&self) -> AltoResult<f32>;
    fn soft_sample_length(&self) -> AltoResult<ALint>;
    fn soft_byte_length(&self) -> AltoResult<ALint>;
    fn soft_direct_channels(&self) -> AltoResult<bool>;
    fn set_soft_direct_channels(&mut self, bool) -> AltoResult<()>;
    fn distance_model(&self) -> AltoResult<DistanceModel>;
    fn set_distance_model(&mut self, DistanceModel) -> AltoResult<()>;
}

Capabilities common to both static and streaming sources.

Required Methods

The context from which this source was created.

Raw handle as provided by OpenAL.

Current playback state of the source.

Begin playing audio, or resume playing if previously paused.

Pause playback while retaining playback position.

Stop playback and reset playback to the beginning of the audio data.

Reset playback to the beginning of the audio data.

Whether the source has a listener-relative position.

Minimum gain that will be applied by the distance model.

Maximum gain that will be applied by the distance model.

Distance at which the source will have unmodified gain.

Rolloff factor of the distance model.

Distance beyond which the source will no longer attenuate.

Relative playback speed of the source.

Direction vector of the source.

Angle from the direction vector within which the source will be fully heard.

Angle from the direction vector within which the source will be heard at all.

Gain factor to determine attenuation when the listener is within the outer cone but outiside the inner cone.

Read cursor position in seconds.

Read cursor position in samples.

Read cursor position in bytes.

A tuple of a playback position and the amount of time until that position is heard, in seconds. Requires AL_SOFT_source_latency.

A tuple of a fixed point playback position in samples, and the time until that position is heard, in nanoseconds. Requires AL_SOFT_source_latency.

Total length of the queued audio data in seconds. Requires AL_SOFT_source_length.

Total length of the queued audio data in samples. Requires AL_SOFT_source_length.

Total length of the queued audio data in bytes. Requires AL_SOFT_source_length.

Whether the audio data will be directly output to the corresponding output channels, bypassing any processing. Requires AL_SOFT_direct_channels.

Distance model specific to this source. Requires AL_EXT_source_distance_model.

Implementors