diff options
-rw-r--r-- | libmpd.rb | 17 | ||||
-rw-r--r-- | libmpd/status.rb | 22 |
2 files changed, 24 insertions, 15 deletions
@@ -6,6 +6,7 @@ require 'socket' require 'libmpd/playbackoptions' +require 'libmpd/status' class TrueClass # :nodoc: def to_i @@ -21,6 +22,7 @@ end class MPD include MPDPlaybackOptions + include MPDStatus # Initialise an MPD object with the specified host and port. # @@ -67,21 +69,6 @@ class MPD return hash end - # Returns a Hash containing information about the current song. - def currentsong - return generate_hash send_request 'currentsong' - end - - # Returns a Hash containing the current status. - def status - return generate_hash send_request 'status' - end - - # Returns a Hash containing statistics. - def stats - return generate_hash send_request 'stats' - end - # Begins playing the playlist. If argument is supplied, begin at specified # song position. def play songpos=false diff --git a/libmpd/status.rb b/libmpd/status.rb new file mode 100644 index 0000000..de00e07 --- /dev/null +++ b/libmpd/status.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 MPDStatus + # Returns a Hash containing information about the current song. + def currentsong + return generate_hash send_request 'currentsong' + end + + # Returns a Hash containing the current status. + def status + return generate_hash send_request 'status' + end + + # Returns a Hash containing statistics. + def stats + return generate_hash send_request 'stats' + end +end |