Struct libpulse_simple_binding::Simple
[−]
[src]
pub struct Simple { /* fields omitted */ }An opaque simple connection object. This acts as a safe Rust wrapper for the actual C object.
Methods
impl Simple[src]
fn new(
server: Option<&str>,
name: &str,
dir: Direction,
dev: Option<&str>,
stream_name: &str,
ss: &Spec,
map: Option<&Map>,
attr: Option<&BufferAttr>
) -> Result<Self, i32>[src]
server: Option<&str>,
name: &str,
dir: Direction,
dev: Option<&str>,
stream_name: &str,
ss: &Spec,
map: Option<&Map>,
attr: Option<&BufferAttr>
) -> Result<Self, i32>
Create a new connection to the server.
Params
server: Server name, orNonefor default.name: A descriptive name for this client (application name, ...).dir: Open this stream for recording or playback?dev: Sink (resp. source) name, orNonefor default.stream_name: A descriptive name for this stream (application name, song title, ...).ss: The sample type to use.map: The channel map to use, orNonefor default.attr: Buffering attributes, orNonefor default.
fn write(&self, data: &[u8]) -> Result<(), i32>[src]
Write some data to the server.
fn drain(&self) -> Result<(), i32>[src]
Wait until all data already written is played by the daemon.
fn read(&self, data: &mut [u8]) -> Result<(), i32>[src]
Read some data from the server.
This function blocks until data.len() amount of data has been received from the server,
or until an error occurs.
fn get_latency(&self) -> Option<Usecs>[src]
Return the playback or record latency.
fn flush(&self) -> Result<(), i32>[src]
Flush the playback or record buffer. This discards any audio in the buffer.