CL-Remi-XSPF
CL-Remi-XSPF
is a small library for reading and writing playlists in the
XSPF (XML Sharable Playlist Format) format and the
related JSPF format. It is written entirely in Common
Lisp.
Wanna support Remilia? Buy me a coffee on Ko-Fi, or support me through Liberapay.
How do I get set up?
Most dependencies can be installed via Quicklisp. The CL-SDM and CL-RemiMarshal dependencies cannot, however. These can be obtained from:
Once you have the dependencies, put them (and this library) somewhere where ASDF can find them, then run this in a REPL:
(asdf:load-system :cl-remi-xspf)
Usage
(asdf:load-system :cl-remi-xspf)
;; Open an XSPF file.
(let ((pls (cl-remi-xspf:parse-playlist #P"/path/to/file.xspf" :xml)))
;; Print the locations for every track
(dolist (track (cl-remi-xspf:playlist-tracks pls))
(print (cl-remi-xspf:track-locations track)))
;; Write the playlist to disk in JSON format
(with-open-file (out #P"/path/to/dest.json"
:direction :output
:if-does-not-exist :create
:if-exists :error) ;; Don't clobber existing file
(cl-remi-xspf:write-playist pls out :json)))
;; Also display in the REPL as XML
(cl-remi-xspf:write-playist-to-string pls :xml))
Development
Known Limitations
The current version does not support the <extension>
tag and simply ignores
it.
Style info
I use a slightly unorthodox style for my code. Aside from these differences, please use normal Lisp formatting.
- Keep lines 118 characters or shorter. Obviously sometimes you can't, but please try. Use 115 characters for Markdown files, though.
- I mark types using the form
T/....
. For example,T/SOME-NEAT-TYPE
. For predicates on these, useSOME-NEAT-TYPE-P
. - No tabs. Only spaces.
How do I contribute?
- Go to https://chiselapp.com/user/MistressRemilia/repository/cl-remi-xspf and clone the Fossil repository.
- Create a new branch for your feature.
- Push locally to the new branch.
- Create a bundle with Fossil that contains your changes.
- Get in contact with me.
Contributors
- Remilia Scarlet - creator and maintainer
- Homepage: https://remilia.sdf.org/
- Mastodon: @MistressRemilia@social.sdf.org
- Email: zremiliaz@postzeoz.jpz My real address does not contain Z's
Links and Licenses
CL-Remi-XSPF is under the GNU Affero General Public License version 3.