Module: MPD::Plugins::Controls
- Included in:
- MPD
- Defined in:
- lib/ruby-mpd/plugins/controls.rb
Overview
Instance Method Summary collapse
-
#next ⇒ Boolean
Plays the next song in the playlist.
-
#pause=(toggle) ⇒ Boolean
Resume/pause playback.
-
#play(pos = nil) ⇒ Boolean
Begin playing the playist.
-
#playid(songid = nil) ⇒ Boolean
Begin playing the playlist.
-
#previous ⇒ Boolean
Plays the previous song in the playlist.
-
#seek(time) ⇒ Object
Seeks to the position in seconds within the current song.
-
#seekid(songid, time) ⇒ Boolean
Seeks to the position
time
(in seconds) of the song with the id ofsongid
. -
#seekpos(pos, time) ⇒ Boolean
Seeks to the position
time
(in seconds) of the song atpos
in the playlist. -
#stop ⇒ Boolean
Stop playing.
Instance Method Details
#next ⇒ Boolean
Plays the next song in the playlist.
9 10 11 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 9 def next send_command :next end |
#pause=(toggle) ⇒ Boolean
The use of pause without an argument is deprecated in MPD.
Resume/pause playback.
16 17 18 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 16 def pause=(toggle) send_command :pause, toggle end |
#play(pos = nil) ⇒ Boolean
Begin playing the playist.
23 24 25 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 23 def play(pos = nil) send_command :play, pos end |
#playid(songid = nil) ⇒ Boolean
Begin playing the playlist.
30 31 32 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 30 def playid(songid = nil) send_command :playid, songid end |
#previous ⇒ Boolean
Plays the previous song in the playlist.
36 37 38 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 36 def previous send_command :previous end |
#seek(time) ⇒ Object
Seeks to the position in seconds within the current song. If prefixed by ‘+’ or ‘-’, then the time is relative to the current playing position.
Returns true if successful,
47 48 49 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 47 def seek(time) send_command :seekcur, time end |
#seekid(songid, time) ⇒ Boolean
Seeks to the position time
(in seconds) of the song with the id of songid
.
61 62 63 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 61 def seekid(songid, time) send_command :seekid, songid, time end |
#seekpos(pos, time) ⇒ Boolean
Seeks to the position time
(in seconds) of the song at pos
in the playlist.
54 55 56 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 54 def seekpos(pos, time) send_command :seek, pos, time end |
#stop ⇒ Boolean
Stop playing.
67 68 69 |
# File 'lib/ruby-mpd/plugins/controls.rb', line 67 def stop send_command :stop end |