[][src]Struct sonos::Speaker

pub struct Speaker {
    pub ip: IpAddr,
    pub model: String,
    pub model_number: String,
    pub software_version: String,
    pub hardware_version: String,
    pub serial_number: String,
    pub name: String,
    pub uuid: String,
}

Fields

ip: IpAddrmodel: Stringmodel_number: Stringsoftware_version: Stringhardware_version: Stringserial_number: Stringname: Stringuuid: String

Methods

impl Speaker[src]

pub fn from_ip(ip: IpAddr) -> Result<Speaker>[src]

Create a new instance of this struct from an IP address

pub fn coordinator(&self) -> Result<IpAddr>[src]

Get the coordinator for this speaker.

pub fn soap(
    &self,
    endpoint: &str,
    service: &str,
    action: &str,
    payload: &str,
    coordinator: bool
) -> Result<Element>
[src]

Call the Sonos SOAP endpoint

Arguments

  • endpoint - The SOAP endpoint to call (eg. MediaRenderer/AVTransport/Control)
  • service - The SOAP service to call (eg. urn:schemas-upnp-org:service:AVTransport:1)
  • action - The action to call on the soap service (eg. Play)
  • payload - XML doc to pass inside the action call body
  • coordinator - Whether this SOAP call should be performed on the group coordinator or the speaker it was called on

pub fn play(&self) -> Result<()>[src]

Play the current track

pub fn pause(&self) -> Result<()>[src]

Pause the current track

pub fn stop(&self) -> Result<()>[src]

Stop the current queue

pub fn next(&self) -> Result<()>[src]

Skip the current track

pub fn previous(&self) -> Result<()>[src]

Go to the previous track

pub fn seek(&self, time: &Duration) -> Result<()>[src]

Seek to a time on the current track

pub fn play_queue_item(&self, track: &u64) -> Result<()>[src]

Change the track, beginning at 1

pub fn remove_track(&self, track: &u64) -> Result<()>[src]

Remove track at index from queue, beginning at 1

pub fn queue_track(&self, uri: &str) -> Result<()>[src]

Add a new track to the end of the queue

pub fn queue_next(&self, uri: &str) -> Result<()>[src]

Add a track to the queue to play next

pub fn play_track(&self, uri: &str) -> Result<()>[src]

Replace the current track with a new one

pub fn clear_queue(&self) -> Result<()>[src]

Remove every track from the queue

pub fn volume(&self) -> Result<u8>[src]

Get the current volume

pub fn set_volume(&self, volume: u8) -> Result<()>[src]

Set a new volume from 0-100.

pub fn muted(&self) -> Result<bool>[src]

Check if this player is currently muted

pub fn mute(&self) -> Result<()>[src]

Mute the current player

pub fn unmute(&self) -> Result<()>[src]

Unmute the current player

pub fn transport_state(&self) -> Result<TransportState>[src]

Get the transport state of the current player

pub fn track(&self) -> Result<Track>[src]

Get information about the current track

Trait Implementations

impl Debug for Speaker[src]

Auto Trait Implementations

impl Send for Speaker

impl Sync for Speaker

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> Erased for T