summaryrefslogtreecommitdiff
path: root/libmpd
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-23 22:52:59 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2009-07-23 22:52:59 -0700
commita3b7470f0964fbb175aeb32713037ab64831fadb (patch)
tree3db810de7af1dea4277e3154d08f1e67d14af2e1 /libmpd
parent173d9a183996e31f0ae9633d3b8ddbbc83971693 (diff)
downloadruby-libmpd-a3b7470f0964fbb175aeb32713037ab64831fadb.tar.gz
ruby-libmpd-a3b7470f0964fbb175aeb32713037ab64831fadb.tar.xz
More modularisation with playlist methods.
Diffstat (limited to 'libmpd')
-rw-r--r--libmpd/playlist.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/libmpd/playlist.rb b/libmpd/playlist.rb
new file mode 100644
index 0000000..9445625
--- /dev/null
+++ b/libmpd/playlist.rb
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+#
+# Copyright 2009 David Vazgenovich Shakaryan <dvshakaryan@gmail.com>
+# Distributed under the terms of the GNU General Public License v3.
+# See http://www.gnu.org/licenses/gpl.txt for the full license text.
+
+module MPDPlaylist
+ # 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
+end