1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/models/control.rb
2013-10-17 12:28:35 +01:00

34 lines
511 B
Ruby

require './models/mpd_connection'
class Control
class << self
def controls
[:play, :stop, :next, :previous, :pause]
end
def play
MPDConnection.mpd.play
end
def stop
MPDConnection.mpd.stop
end
def next
MPDConnection.mpd.next
end
def previous
MPDConnection.mpd.previous
end
def pause
MPDConnection.mpd.pause = !MPDConnection.mpd.paused?
end
def volume(value)
MPDConnection.mpd.volume = value
end
end
end