Module: VLC::Client::PlaylistControls
- Included in:
- VLC::Client
- Defined in:
- lib/vlc-client/client/playlist_controls.rb
Instance Method Summary collapse
-
#add_to_playlist(media) ⇒ Object
Adds media to the playlist.
-
#clear ⇒ Object
Clears the playlist.
-
#next ⇒ Object
Plays the next element on the playlist.
-
#playlist ⇒ Object
Lists tracks on the playlist.
-
#previous ⇒ Object
Plays the previous element on the playlist.
Instance Method Details
#add_to_playlist(media) ⇒ Object
Adds media to the playlist
19 20 21 |
# File 'lib/vlc-client/client/playlist_controls.rb', line 19 def add_to_playlist(media) connection.write("enqueue #{media(media)}") end |
#clear ⇒ Object
Clears the playlist
46 47 48 |
# File 'lib/vlc-client/client/playlist_controls.rb', line 46 def clear connection.write("clear") end |
#next ⇒ Object
Plays the next element on the playlist
36 37 38 |
# File 'lib/vlc-client/client/playlist_controls.rb', line 36 def next connection.write("next") end |
#playlist ⇒ Object
Lists tracks on the playlist
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/vlc-client/client/playlist_controls.rb', line 24 def playlist connection.write("playlist") list = [] begin list << connection.read end while list.last != PLAYLIST_TERMINATOR parse_playlist(list) end |
#previous ⇒ Object
Plays the previous element on the playlist
41 42 43 |
# File 'lib/vlc-client/client/playlist_controls.rb', line 41 def previous connection.write("prev") end |