Struct cpal::EventLoop [] [src]

pub struct EventLoop(_);

Collection of voices managed together.

Created with the new method.

Methods

impl EventLoop
[src]

[src]

Initializes a new events loop.

[src]

Creates a new input stream that will run from the given device and with the given format.

On success, returns an identifier for the stream.

Can return an error if the device is no longer valid, or if the input stream format is not supported by the device.

[src]

Creates a new output stream that will play on the given device and with the given format.

On success, returns an identifier for the stream.

Can return an error if the device is no longer valid, or if the output stream format is not supported by the device.

[src]

Instructs the audio device that it should start playing the stream with the given ID.

Has no effect is the stream was already playing.

Only call this after you have submitted some data, otherwise you may hear some glitches.

Panic

If the stream does not exist, this function can either panic or be a no-op.

[src]

Instructs the audio device that it should stop playing the stream with the given ID.

Has no effect is the stream was already paused.

If you call play afterwards, the playback will resume where it was.

Panic

If the stream does not exist, this function can either panic or be a no-op.

[src]

Destroys an existing stream.

Panic

If the stream does not exist, this function can either panic or be a no-op.

[src]

Takes control of the current thread and begins the stream processing.

Note: Since it takes control of the thread, this method is best called on a separate thread.

Whenever a stream needs to be fed some data, the closure passed as parameter is called. You can call the other methods of EventLoop without getting a deadlock.

Trait Implementations

Auto Trait Implementations

impl Send for EventLoop

impl Sync for EventLoop