about summary refs log tree commit homepage
path: root/lib/dtas/tracklist.rb
DateCommit message (Collapse)
2016-01-05tracklist: fix off-by-one error on track removal
@pos is an array index, and should never go beyond the last element.
2016-01-02copyright updates for 2016
Using the 'update-copyright' script from gnulib[1]: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright [1] git://git.savannah.gnu.org/gnulib.git
2015-12-25enable "frozen_string_literal: true"
While we're in the area, make a wording change from "GPLv3 or later" to "GPL-3.0+", as the latter is favored by SPDX.org
2015-12-14player: show "tracklist" hash with summary info with "current"
This allows clients to quickly query tracklist size/position/shuffle/random info.
2015-12-14tracklist: swap functionality
This (from the point of the client) will atomically swap two tracks. This should allow easily implementing of a tracklist editor.
2015-12-13player: support "tl clear" internally
It is orders of magnitude more efficient to implement this in the player and very noticeable when using large playlists.
2015-12-13tracklist: fixup idempotent "tl shuffle false"
Disabling shuffle should be idempotent.
2015-12-07tracklist: support limiting maximum tracklist size
This defaults to 16384? This is what mpd uses by default as well. Of course folks interacting with dtas-player directly can override this: dtas-tl max INTEGER dtas-tl max This is NOT meant to be a hard security measure for local users talking to dtas-player directly. It is only to prevent accidentally stupid things like flooding the playlist with a broken script and to prevent remote users from DoS-ing us via the to-be-written mpd proxy/emulation layer. Remember: dtas-player itself will ALWAYS remain capable of executing arbitrary code :)
2015-12-07tracklist: shuffle support
This is in the MPRIS 2.0 TrackList spec and also in mpd (as "repeat" mode), so we can probably support it directly in player to ease implementations of future wrappers.
2015-12-06tracklist: avoid needlessly building a hash for track IDs
Building this hash is a linear operation anyways, so there's no point in doing it when Array#index can stop early if the track is found, to avoid unnecessary work.
2015-12-05tracklist: do not mutate @list when serializing
This happens when "dtas-ctl state dump" is invoked manually; causing "dtas-tl cat" to break afterwards. Fixes: commit 7b065706d37df9e54c8b3299ce696545c6159fa4 ("tracklist: use lower number unique track IDs")
2015-12-05tracklist: use lower number unique track IDs
This is easier for users to read and type; and _might_ help with race conditions due to fast object recycling from GC. We'll also be implementing playist versioning on top of this in the next commits for MPD protocol compatibility. Unfortunately this adds an additional 40 bytes of per-track overhead (on 64-bit systems, its only 20 bytes on 32-bit). However, we may be able to save memory in the future by supporting dtas-mlib node IDs if we integrate dtas-player with DTAS::Mlib. While we're at it, include a minor speedup for DTAS::Tracklist#remove_track by using Array#delete_at instead of relying on Array#compact! after assignment This should improve "dtas-tl cat" output readability dramatically. The state file (~/.dtas/player_state.yml) remains compatible between dtas-player before and after this change.
2015-05-10tracklist: fix inf loop on ENOENT with repeat==1
If a file is missing, we must not respect the repeat option set by the user to avoid infinite looping
2015-01-20doc: describe most classes a bit
Hopefully this makes the code less daunting to newcomers
2015-01-19update copyright years and links to mailing list archives
The documentation part is managed by the new Documentation/update-copyright script. For the future, the rest may be managed by the update-copyright tool in gnulib
2014-12-08tracklist: favor &:sym_to_proc style
This is terser, reads better and generates smaller bytecode.
2014-06-06update copyrights and email address for 2014
I'm still normal, and still trolling, but 80x24.org will be epic :)
2013-10-10tracklist: fix off-by-one when adding track
Otherwise we end up going past the end of the list.
2013-10-10tracklist: update position when track is added
We don't want to repeat tracks if a track was added to a spot before the current position on the tracklist.
2013-10-09tracklist: remove_track updates tracklist position
We should not have the position point too far past the end of the list. This allows playback to start when we do "tl add" on an idle player after removing something from the tracklist.
2013-09-09doc: nodoc new classes
We have no public Ruby API, only socket protocols and data formats.
2013-09-09tracklist: implement single-track repeat
Because sometimes a song is just stuck in our head. Or MPRIS 2.0 wants us to implement it this way...
2013-09-09tracklist: previous! only wraps around when repeat is enabled
Non-repeating tracklists should stop playing when there's nothing to go back to.
2013-09-09player: "tl goto" takes optional offset arg in HHMMSS.SUBSEC
This should make implementing SetPosition in the MPRIS 2.0 spec possible.
2013-09-09player: implement previous/next commands
This means we can go back and forth in the tracklist like a normal music player. This will allow an easier MPRIS 2.0 implementation.
2013-09-09tracklist: next_track -> advance_track
This is a more accurate depiction of what happens, and we'll implement "next" and "previous" commands in the future.
2013-09-09player: reset tracklist when idle stat is detected
We should return to the starting position of the tracklist if we are idle.
2013-09-09tracklist: fix go_to functionality
We need to preserve the go_to-specified position for next_track, doing otherwise would cause us to always be off-by-one.
2013-09-09player/client_handler: "tl add" returns track_id of added track
This allows easier scripting if we want to add a bunch of tracks
2013-09-09tracklist: preliminary tracklist class
This should allow us to eventually implement a MPRIS 2.0-compliant tracklist.