diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-22 08:21:08 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-22 08:21:08 -0700 |
commit | 7a5adb16225e564e06618539a24c0da818adf2c2 (patch) | |
tree | 15dba98ed989f8e0dc3b93da39d51d852a173c49 | |
parent | a3399c86fe3f55a269f288ad13da5b248b5de7f9 (diff) | |
download | ruby-libmpd-7a5adb16225e564e06618539a24c0da818adf2c2.tar.gz ruby-libmpd-7a5adb16225e564e06618539a24c0da818adf2c2.tar.xz |
Add playid and seekid methods.
-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 |