Skip to main content

BluOS

Struct BluOS 

Source
pub struct BluOS { /* private fields */ }

Implementations§

Source§

impl BluOS

Source

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
Source

pub fn with_socket_addr(addr: SocketAddr) -> Result<BluOS, Error>

Source

pub fn new_from_discovered(d: DiscoveredBluOSDevice) -> Result<BluOS, Error>

Create a new BluOS device from a discovered device

Source

pub async fn status(&self) -> Result<Status, Error>

Get the current status of the BluOS device

Source

pub async fn browse(&self, key: Option<&str>) -> Result<Browse, Error>

Source

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

Source

pub async fn play(&self) -> Result<State, Error>

Plays whatever source is currently active

Source

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.
Source

pub async fn pause(&self, toggle: bool) -> Result<State, Error>

Pause playback

  • toggle: If set to 1, then the current pause state is toggled.
Source

pub async fn stop(&self) -> Result<State, Error>

Stop playback

Source

pub async fn skip(&self) -> Result<IdResponse, Error>

Skip: Skip to the next audio track in the play queue

Source

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.

Source

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.

Source

pub async fn repeat(&self, setting: RepeatSetting) -> Result<(), Error>

Repeat… repeats

Takes RepeatSetting enum which defines what kind of repeat you need

Source

pub async fn queue( &self, pagination: Option<Pagination>, ) -> Result<Playlist, Error>

Get the current play queue from the BluOS device

Source

pub async fn queue_delete_song(&self, position: u64) -> Result<(), Error>

Delete a song at POSITION

Source

pub async fn queue_clear(&self) -> Result<(), Error>

Clear the play queue

Trait Implementations§

Source§

impl Debug for BluOS

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for BluOS

§

impl !UnwindSafe for BluOS

§

impl Freeze for BluOS

§

impl Send for BluOS

§

impl Sync for BluOS

§

impl Unpin for BluOS

§

impl UnsafeUnpin for BluOS

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more