Yamaha MusicCast™ v0.2.0 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

Returns the value(s) for the given lookup 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

Begins playback of the given URL

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 playback state from :play to :pause and vice versa

Toggles repeat settings

Toggles repeat settings

Unmutes the volume

Types

ip_address()
ip_address() :: {0..255, 0..255, 0..255, 0..255}
lookup_key()
lookup_key ::
  :host |
  :device_id |
  :upnp |
  :upnp_service |
  :upnp_session_id |
  :network_name |
  :available_inputs |
  :status |
  :playback
lookup_query()
lookup_query() :: :all | [lookup_key] | lookup_key
t()
t() :: %MusicCast.Network.Entity{available_inputs: [String.t], device_id: String.t, host: String.t, network_name: String.t, playback: %{}, status: %{}, upnp: MusicCast.UPnP.AVTransport.t, upnp_service: MusicCast.UPnP.Service.t, upnp_session_id: String.t}

Functions

__lookup__(pid, keys \\ :all)
__lookup__(pid, lookup_query) :: any

Returns the value(s) for the given lookup 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_play_url(pid, url, meta \\ nil)
playback_play_url(pid, String.t, Enum.t) ::
  :ok |
  {:error, term}

Begins playback of the given URL.

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, String.t) :: :ok | {:error, term}

Selects the given input.

To get a list of available inputs from a specific device, see __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_play_pause(pid)
toggle_play_pause(pid) :: :ok | {:error, term}

Toggles playback state from :play to :pause and vice versa.

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.