From a3b7470f0964fbb175aeb32713037ab64831fadb Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Thu, 23 Jul 2009 22:52:59 -0700 Subject: More modularisation with playlist methods. --- libmpd/playlist.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 libmpd/playlist.rb (limited to 'libmpd') 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 +# 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 -- cgit v1.2.3-70-g09d2