Yamaha MusicCast™ v0.1.5 MusicCast.Network.Entity

A module for managing MusicCast™ enabled devices.

A network entity is automatically started when a MusicCast enabled device is discovered. See the MusicCast.UPnP.SSDPClient for implementation details. Once started, the entity process is available to the network registry via it MusicCast device ID. See MusicCast.whereis/1 and MusicCast.which_devices/1 for more details about the network registry.

Each entity process keeps it state synchronized with the device it is paired with. This task is acomplished by the MusicCast.Network.EventListener process which forwards incoming YXC unicast messages to the affected entity processes. See MusicCast.subscribe/1 and MusicCast.unsubscribe/1 for more details.

Summary

Functions

Looks-up the value(s) for the given key(s)

Decreases the volume by step

Increases the volume by step

Mutes the volume

Plays the next track in the playback queue

Pauses playback of the current track

Begins playback of the current track

Plays the previous track in the playback queue

Stops playback

Selects the given input

Sets the volume to the given volume

Starts an entity as part of a supervision tree

Toggles repeat settings

Toggles repeat settings

Unmutes the volume

Pauses playback of the current UPnP A/V transport URL

Begins playback of the current UPnP A/V transport URL

Sets the UPnP A/V transport URL to the given url

Stops playback of the current UPnP A/V transport URL

Types

device_id()
device_id() :: String.t
ip_address()
ip_address() :: {0..255, 0..255, 0..255, 0..255}
lookup_key()
lookup_key ::
  :host |
  :upnp |
  :device_id |
  :network_name |
  :available_inputs |
  :status |
  :playback
lookup_keys()
lookup_keys() :: [lookup_key] | lookup_key
upnp_desc()
upnp_desc() :: Map.t

Functions

__lookup__(pid, keys \\ :all)
__lookup__(GenServer.server, lookup_keys) :: [term] | term

Looks-up the value(s) for the given key(s).

decrease_volume(pid, step \\ 10)
decrease_volume(pid, Integer.t) :: :ok | {:error, term}

Decreases the volume by step.

increase_volume(pid, step \\ 10)
increase_volume(pid, Integer.t) :: :ok | {:error, term}

Increases the volume by step.

mute(pid)
mute(pid) :: :ok | {:error, term}

Mutes the volume.

playback_next(pid)
playback_next(pid) :: :ok | {:error, term}

Plays the next track in the playback queue.

playback_pause(pid)
playback_pause(pid) :: :ok | {:error, term}

Pauses playback of the current track.

playback_play(pid)
playback_play(pid) :: :ok | {:error, term}

Begins playback of the current track.

playback_previous(pid)
playback_previous(pid) :: :ok | {:error, term}

Plays the previous track in the playback queue.

playback_stop(pid)
playback_stop(pid) :: :ok | {:error, term}

Stops playback.

select_input(pid, input)
select_input(pid, Atom.t) :: :ok | {:error, term}

Selects the given input.

To get a list of available inputs for a specific device, pass :available_inputs to __lookup__/2.

set_volume(pid, volume)
set_volume(pid, Integer.t) :: :ok | {:error, term}

Sets the volume to the given volume.

start_link(addr, upnp_desc, options \\ [])

Starts an entity as part of a supervision tree.

stop(pid)

See GenServer.stop/1.

toggle_repeat(pid)
toggle_repeat(pid) :: :ok | {:error, term}

Toggles repeat settings.

toggle_shuffle(pid)
toggle_shuffle(pid) :: :ok | {:error, term}

Toggles repeat settings.

unmute(pid)
unmute(pid) :: :ok | {:error, term}

Unmutes the volume.

upnp_pause(pid)
upnp_pause(pid) :: :ok | {:error, term}

Pauses playback of the current UPnP A/V transport URL.

upnp_play(pid)
upnp_play(pid) :: :ok | {:error, term}

Begins playback of the current UPnP A/V transport URL.

upnp_set_av_transport_url(pid, url)
upnp_set_av_transport_url(pid, String.t) :: :ok | {:error, term}

Sets the UPnP A/V transport URL to the given url.

upnp_stop(pid)
upnp_stop(pid) :: :ok | {:error, term}

Stops playback of the current UPnP A/V transport URL.