diff options
Diffstat (limited to 'libmpd.rb')
-rw-r--r-- | libmpd.rb | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -68,7 +68,7 @@ class MPD end # Begins playing the playlist. If argument is supplied, begin at specified - # position. + # song position. def play songpos=false command = 'play' command << ' ' + songpos.to_s if songpos @@ -76,6 +76,15 @@ class MPD return send_request command end + # Begins playing the playlist. If argument is supplied, begin at specified + # song id. + def playid songid=false + command = 'playid' + command << ' ' + songid.to_s if songid + + return send_request command + end + # Toggles pause. (1 = pause, 0 = play) def pause pause return send_request 'pause ' + pause.to_s @@ -101,6 +110,11 @@ class MPD return send_request 'seek %s %s' % [songpos, time] end + # Seeks to the given position of the given song id. + def seekid songid, time + return send_request 'seekid %s %s' % [songid, time] + end + # Adds the specified file to the playlist. (Directories add recursively.) def add uri return send_request 'add "%s"' % uri |