pub struct BluOS { /* private fields */ }Implementations§
Source§impl BluOS
impl BluOS
Sourcepub fn new(addr: Ipv4Addr, custom_port: Option<u16>) -> Result<BluOS, Error>
pub fn new(addr: Ipv4Addr, custom_port: Option<u16>) -> Result<BluOS, Error>
Create a new BluOS device from an Ipv4Addr
- If you for some reason managed to make your BluOS device listen on another port, define it using custom_port
pub fn with_socket_addr(addr: SocketAddr) -> Result<BluOS, Error>
Sourcepub fn new_from_discovered(d: DiscoveredBluOSDevice) -> Result<BluOS, Error>
pub fn new_from_discovered(d: DiscoveredBluOSDevice) -> Result<BluOS, Error>
Create a new BluOS device from a discovered device
pub async fn browse(&self, key: Option<&str>) -> Result<Browse, Error>
Sourcepub async fn update_library(&self) -> Result<(), Error>
pub async fn update_library(&self) -> Result<(), Error>
Re-indexes the library
This function is why I wrote this wrapper and once that worked I figured why not just keep going and write the rest LOL
Sourcepub async fn play_with_options(
&self,
seek: Option<i64>,
input_type: Option<String>,
index: Option<i64>,
) -> Result<State, Error>
pub async fn play_with_options( &self, seek: Option<i64>, input_type: Option<String>, index: Option<i64>, ) -> Result<State, Error>
Play with the ability to define options
- seek: time to seek in the track, max is total_length from status of the track
- input_type: Selects an input before starting playback. Possible values for inputType are: analog, spdif, hdmi or bluetooth.
- index: For players with more than one input, this indicates which input of the specified type to play. Used only with inputType parameter. Default value is 1.
Sourcepub async fn pause(&self, toggle: bool) -> Result<State, Error>
pub async fn pause(&self, toggle: bool) -> Result<State, Error>
Pause playback
- toggle: If set to 1, then the current pause state is toggled.
Sourcepub async fn skip(&self) -> Result<IdResponse, Error>
pub async fn skip(&self) -> Result<IdResponse, Error>
Skip: Skip to the next audio track in the play queue
Sourcepub async fn back(&self) -> Result<IdResponse, Error>
pub async fn back(&self) -> Result<IdResponse, Error>
Back: If a track is playing and has been playing for more than four seconds, then back, will return to the start of the track. Otherwise, the back command will go to the previous song in the current playlist. If on the first song in the playlist calling back will go to the last song. It will go to the previous or first track in the queue regardless of the state of the repeat setting.
Sourcepub async fn shuffle(&self, enable: bool) -> Result<(), Error>
pub async fn shuffle(&self, enable: bool) -> Result<(), Error>
Shuffle The shuffle command creates a new queue by shuffling the current queue. The original (not shuffled) queue is retained for restore when shuffle is disabled.
Sourcepub async fn repeat(&self, setting: RepeatSetting) -> Result<(), Error>
pub async fn repeat(&self, setting: RepeatSetting) -> Result<(), Error>
Repeat… repeats
Takes RepeatSetting enum which defines what kind of repeat you need
Sourcepub async fn queue(
&self,
pagination: Option<Pagination>,
) -> Result<Playlist, Error>
pub async fn queue( &self, pagination: Option<Pagination>, ) -> Result<Playlist, Error>
Get the current play queue from the BluOS device
Sourcepub async fn queue_delete_song(&self, position: u64) -> Result<(), Error>
pub async fn queue_delete_song(&self, position: u64) -> Result<(), Error>
Delete a song at POSITION
Sourcepub async fn queue_clear(&self) -> Result<(), Error>
pub async fn queue_clear(&self) -> Result<(), Error>
Clear the play queue