lib/sonos/endpoint/a_v_transport.rb
# Adds a track to the queue
# @param[String] uri Uri of track
# @param[String] didl Stanza of DIDL-Lite metadata (generally created by #add_spotify_to_queue)
# @param[Integer] position Optional queue insertion position. Leaving this blank inserts at the end.
# @return[Integer] Queue position of the added track
Adds a track to the queue
Adds a track to the queue
def add_to_queue(uri, didl = '', position = 0)
    response = send_transport_message('AddURIToQueue', "<EnqueuedURI>#{uri}</EnqueuedURI><EnqueuedURIMetaData>#{didl}</EnqueuedURIMetaData><DesiredFirstTrackNumberEnqueued>#{position}</DesiredFirstTrackNumberEnqueued><EnqueueAsNext>1</EnqueueAsNext>")
    pos = response.xpath('.//FirstTrackNumberEnqueued').text
    if pos.length != 0
      pos.to_i
    end
  end
def add_to_queue ( uri , didl = '' , position = 0 ) response = send_transport_message ( 'AddURIToQueue' , "<EnqueuedURI>#{uri}</EnqueuedURI><EnqueuedURIMetaData>#{didl}</EnqueuedURIMetaData><DesiredFirstTrackNumberEnqueued>#{position}</DesiredFirstTrackNumberEnqueued><EnqueueAsNext>1</EnqueueAsNext>" ) pos = response . xpath ( './/FirstTrackNumberEnqueued' ) . text if pos . length != 0 pos . to_i end end
Adds a track to the queue
Adds a track to the queue
# TODO yeah, this error handling is a bit soft. For consistency's sake :)
uri
<not_specific>
didl
<not_specific>
position
<not_specific>
param[String]
uri Uri of track
uri Uri of track
param[String]
didl Stanza of DIDL-Lite metadata (generally created by #add_spotify_to_queue)
didl Stanza of DIDL - Lite metadata ( generally created by #add_spotify_to_queue )
param[Integer]
position Optional queue insertion position. Leaving this blank inserts at the end.
position Optional queue insertion position . Leaving this blank inserts at the end .
return[Integer]
Queue position of the added track
Queue position of the added track