diff options
author | Eric Wong <e@80x24.org> | 2015-12-13 13:01:06 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-12-13 13:01:06 +0000 |
commit | 15fc2b737ea5fe7e4c8b21eb6395721ba9522ab4 (patch) | |
tree | 609c265935f12483c1b6afd4d605bc15921b61f3 /lib/dtas/tracklist.rb | |
parent | fc00838faa4480a03e8a33fedc80c4648817bb93 (diff) | |
download | dtas-15fc2b737ea5fe7e4c8b21eb6395721ba9522ab4.tar.gz |
It is orders of magnitude more efficient to implement this in the player and very noticeable when using large playlists.
Diffstat (limited to 'lib/dtas/tracklist.rb')
-rw-r--r-- | lib/dtas/tracklist.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/dtas/tracklist.rb b/lib/dtas/tracklist.rb index b1cdc1e..b9abe55 100644 --- a/lib/dtas/tracklist.rb +++ b/lib/dtas/tracklist.rb @@ -195,6 +195,12 @@ class DTAS::Tracklist # :nodoc: track.to_path end + def clear + @list.clear + @shuffle.clear if @shuffle + reset + end + def go_to(track_id, offset_hhmmss = nil) list = @shuffle || @list if idx = _idx_of(list, track_id) |