Module: MPD::Client::Commands::PlaybackControl
- Defined in:
- lib/mpd/client/commands/playback_control.rb
Overview
Instance Method Summary collapse
- #next ⇒ Object
- #pause ⇒ Object
- #play(position: nil, id: nil) ⇒ Object
- #previous ⇒ Object
- #stop ⇒ Object
Instance Method Details
#next ⇒ Object
30 31 32 |
# File 'lib/mpd/client/commands/playback_control.rb', line 30 def next execute 'next' end |
#pause ⇒ Object
18 19 20 |
# File 'lib/mpd/client/commands/playback_control.rb', line 18 def pause execute 'pause 1' end |
#play(position: nil, id: nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/mpd/client/commands/playback_control.rb', line 6 def play(position: nil, id: nil) raise(ArgumentError, 'too many arguments') if position && id if position execute "play #{position}" elsif id execute "playid #{id}" else execute 'pause 0' end end |
#previous ⇒ Object
26 27 28 |
# File 'lib/mpd/client/commands/playback_control.rb', line 26 def previous execute 'previous' end |
#stop ⇒ Object
22 23 24 |
# File 'lib/mpd/client/commands/playback_control.rb', line 22 def stop execute 'stop' end |