diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-23 22:52:59 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-23 22:52:59 -0700 |
commit | a3b7470f0964fbb175aeb32713037ab64831fadb (patch) | |
tree | 3db810de7af1dea4277e3154d08f1e67d14af2e1 /libmpd.rb | |
parent | 173d9a183996e31f0ae9633d3b8ddbbc83971693 (diff) | |
download | ruby-libmpd-a3b7470f0964fbb175aeb32713037ab64831fadb.tar.gz ruby-libmpd-a3b7470f0964fbb175aeb32713037ab64831fadb.tar.xz |
More modularisation with playlist methods.
Diffstat (limited to 'libmpd.rb')
-rw-r--r-- | libmpd.rb | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -7,6 +7,7 @@ require 'socket' require 'libmpd/playbackcontrol' require 'libmpd/playbackoptions' +require 'libmpd/playlist' require 'libmpd/status' class TrueClass # :nodoc: @@ -24,6 +25,7 @@ end class MPD include MPDPlaybackControl include MPDPlaybackOptions + include MPDPlaylist include MPDStatus # Initialise an MPD object with the specified host and port. @@ -71,21 +73,6 @@ class MPD return hash end - # Adds the specified file to the playlist. (Directories add recursively.) - def add uri - return send_request 'add "%s"' % uri - end - - # Deletes a song from the playlist. - def delete songpos - return send_request 'delete ' + songpos.to_s - end - - # Clears the playlist. - def clear - return send_request 'clear' - end - def split_and_hash str songs = str.split(/(?!\n)(?=file:)/).map do |song| generate_hash song |