shithub: cuefs

Download patch

ref: 9a8645b20bd5a5a4a4295b5116d09720d6bc6c8d
parent: 4dadedda79686743638d12b1ffa8ad96828adbc4
author: Tevo <estevan.cps@gmail.com>
date: Sat Jan 16 19:00:29 EST 2021

Manpages

--- a/BUGS	Sat Jan 16 17:42:18 2021
+++ b/BUGS	Sat Jan 16 19:00:29 2021
@@ -1,6 +1,9 @@
 • unsure if seeking on a file works correctly
 • current treatment of lossy sources is less than ideal
-• everything will get resampled to 44100kHz/16bit/2channel
+• everything will get resampled to 44100Hz/16bit/2channel
 • the codebase is a mess
 • reading concurrently from the same fid might break decoding logic, or be unecessarily slow (does that ever happen?)
 • zuke causes wavserve to do a negative readdec() somehow
+• some parser/cuefs behavior might be non-standard or undesirable
+	- for example, there's currently no way to split tracks without including the pregap either at the end of the last track or beggining of current one
+• parser is incomplete
--- /dev/null	Thu Dec 31 12:39:09 2020
+++ b/cuefs.4.man	Sat Jan 16 19:00:29 2021
@@ -0,0 +1,65 @@
+.TH CUEFS 4
+.SH NAME
+cuefs \- cuesheet file system
+.SH SYNOPSYS
+.B cuefs
+[
+.B -Dv
+]
+[
+.B -m
+.I mtpt
+]
+[
+.B -f
+.I outfmt
+]
+[
+.B -i
+.I index
+]
+.I file
+.SH DESCRIPTION
+.I Cuefs
+serves tracks of one or more audio files, as described by the cuesheet specified by
+.IR file ,
+as a set of separate files under
+.I mtpt
+(defauts to
+.BR /mnt/cue ).
+The tracks are served in a flat directory structure with file names following the format "$number - $artist.$extension"; '/' in track names are replaced by '-'.
+It can handle OGG Vorbis, MP3, FLAC, WAVE and optionally OPUS and AAC (depending on the respective decoders being available) as inputs, and can output FLAC, WAVE or raw 44100Hz 16-bit 2 channel little-endian PCM data. By default, 
+.I cuefs
+tries to match the input format for output, falling back to WAVE if it can't be done. A specific output format can be specified with the
+.B -f
+flag; accepted values for
+.I outfmt
+include 'wave', 'flac' and 'pcm'. Only FLAC output contains any sort of metadata.
+.PP
+The
+.I -i
+flag specifies the preffered timestamp index to use when calculating the start and end of tracks; by convention, index 0 specifies the pre-gap of a track, while index 1 represents the actual start.
+.I Cuefs
+falls back to the first index, in case the specified index cannot be found on a specific track.
+.SH EXAMPLES
+Play the 2nd track specified on cuesheet camel.cue:
+.IP
+.EX
+cuefs camel.cue
+play /mnt/cue/02*
+.EE
+.SH SOURCE
+git://shithub.us/tevo/cuefs
+.SH SEE ALSO
+.IR cuesplit (1)
+.SH BUGS
+.IP •
+current treatment of lossy sources is less than ideal
+.IP •
+all audio data will get resampled to 44100Hz/16-bit/2 channels
+.IP •
+current treatment of metadata is less than ideal
+.IP •
+there's currently no way to split tracks without including the pregap either at the end of the last track or beggining of current one
+.IP •
+the cuesheet parser is incomplete
--- /dev/null	Thu Dec 31 12:39:09 2020
+++ b/cuesplit.1.man	Sat Jan 16 19:00:29 2021
@@ -0,0 +1,43 @@
+.TH CUESPLIT 1
+.SH NAME
+cuesplit \- split cuesheet into separate tracks
+.SH SYNOPSYS
+.B cuefs
+[
+.B -Dv
+]
+[
+.B -f
+.I outfmt
+]
+[
+.B -i
+.I index
+]
+.I cuesheet
+.SH DESCRIPTION
+.I Cuesplit
+uses
+.IR cuefs (4)
+to split a given cuesheet into a set of separate files in the current directory. The flags
+.IR -D ,
+.I -f
+and
+.IR -i ,
+as well as the file naming convention, are the same as the ones specified in
+.IR cuefs (4);
+the
+.I -v
+flag enables logging per-file progress to the screen.
+.SH EXAMPLES
+Split the tracks described in the cuesheet camel.cue to separate files:
+.IP
+.EX
+cuesplit camel.cue
+.EE
+.SH SOURCE
+git://shithub.us/tevo/cuefs
+.SH SEE ALSO
+.IR cuesplit (1)
+.SH BUGS
+There's currently no way to specify a set of tracks (rather than the entire sheet) to be split off.
--- a/fs.c	Sat Jan 16 17:42:18 2021
+++ b/fs.c	Sat Jan 16 19:00:29 2021
@@ -131,6 +131,7 @@
 	int fd[2], afd, devnull = -1;
 	char *dec;
 
+	/* FIXME check if decoder isn't nil */
 	dec = decoder[f->actual];
 
 	debug("decoding %s starting at %f\n", f->name, sec);
@@ -369,7 +370,7 @@
 			/* TODO better metadata handling */
 			char *argv[] =
 			{ 
-				enc, 
+				enc,
 				"-T", smprint("TITLE=%s", e->title),
 				"-T", smprint("ARTIST=%s", e->performer),
 				"-T", smprint("ALBUMARTIST=%s", e->sheet->performer),
--- a/mkfile	Sat Jan 16 17:42:18 2021
+++ b/mkfile	Sat Jan 16 19:00:29 2021
@@ -2,6 +2,14 @@
 
 TARG=cuefs
 BIN=/$objtype/bin
+RCBIN=/rc/bin
+
+RC=\
+	cuesplit
+
+MAN=\
+	4/cuefs	\
+	1/cuesplit
 
 LFILES=\
 	cue.l
@@ -24,3 +32,16 @@
 </sys/src/cmd/mkone
 
 LFLAGS=-9
+
+install:V: ${RC:%=$RCBIN/%} ${MAN:%=/sys/man/%}
+
+# TODO better automate manpage installation, etc
+
+/sys/man/4/cuefs: cuefs.4.man
+	cp $prereq $target
+
+/sys/man/1/cuesplit: cuesplit.1.man
+	cp $prereq $target
+
+$RCBIN/%: %
+	cp $prereq $target