Cretin: Documentation

Cretin Documentation


NAME

Cretin - CD Ripper, Encoder and Tagger with an Inoffensive Name


SYNOPSIS

cretin [options] [mode]


DESCRIPTION

Cretin is a high-performance CD reencoder, handling the ripping, encoding and tagging of audio compact discs to multiple file formats. Cretin can operate standalone; however, its power and purpose are unleashed in distributed and multiprocessed environments. Cretin is highly customizable and supports the use of many encoding and ripping utilities.

Cretin is a command-line application, for maximum flexibility, portability and purity of design.


SUPPORTED TOOLS

Rippers
cdp (cdparanoia)
Encoders
lame, flac, ogg, faac, shn (shorten)


MODES

Cretin has four modes of operation, between zero and one of which must be specified last on the command line:

rip

Rip a CD, queue it for encoding, and eject the disc. Repeat.

enc

Encode songs from the queue until the queue is empty. Exit.

both

Rip a cd, queue it for encoding, launch encoder subprocess, eject the disc. Repeat. This is the default mode of operation.

nop

No operation. Do nothing and exit. This mode is mostly useful in conjunction with the ``-recover'' option.


OPTIONS

Here is a summary of the options the ``cretin'' command accepts:

-h, -help, --help, ---HEEELLLLLP and anything else matching /-h/i

Print a short help message and exit.

-c cfg.var value

Set configuration variable cfg.var to value. May be specified multiple times.

-f cfgfile

Read config file cfgfile. May be specified multiple times.

-recover

Recover from a crashed or interrupted session. This option will requeue songs which did not finish encoding. A warning: do not use this option when there are running encoders. There will be no lasting damage, but unnecessary computation will be performed.


CONFIGURATION VARIABLES

Config variables enable heavy customization of Cretin's operation. Here is a list of variables which may be set by the user:

cfg.rootdir

Root directory, under which all Cretin operations take place.

cfg.encq

Filename, within cfg.rootdir, of encoding queue.

cfg.enclog

Filename, within cfg.rootdir, of in-process encoding log.

cfg.ripdir

Directory, within cfg.rootdir, under which all ripping operations take place.

cfg.encdir

Directory, within cfg.rootdir, under which all encoding operations take place.

cfg.ripdir

Directory, within cfg.rootdir, under which all ripping operations take place.

cfg.rip

Selected ripper.

cfg.enc

Comma-separated list of selected encoders.

cfg.maxenc

Number of encoding processes to spawn at once.

cfg.dirfmt

Format string for artist and album directory names.

cfg.filefmt

Format string for song filenames.

cfg.ejectcmd

Command to eject a CD. Defaults to the empty string (no ejection).

cfg.repeat

Set to 1 to start ripping next disc immediately after a disc finishes, without pressing Return. Note: make sure you have specified a valid ejectcmd above!

cfg.keep_encoder_running

Set to 1 to prevent the encoder engine from exiting when the encoding queue is empty

rips.XXX.cmd, encs.XXX.cmd

Command path for ripper or encoder XXX.

rips.XXX.flags, encs.XXX.flags

Command flags for ripper or encoder XXX.

rips.XXX.dir, encs.XXX.dir

Directory, within cfg.ripdir or cfg.encdir, under which all opera- tions for ripper or encoder XXX take place.

rips.XXX.ext, encs.XXX.ext

Filename extension for ripper or encoder XXX.


CONFIG FILES

By default, Cretin reads /etc/cretinrc and ~/.cretinrc as config files at startup. Other config files may be specified by the -f option.

Config files must adhere to the following syntax:

  • Lines consisting only of whitespace and lines beginning with # are ignored.

  • All other lines begin with the name of the config variable.

  • If the variable is being set to a non-empty value, the variable name is followed by one or more tab characters, followed by the value. Quoting or backslashing is unnecessary.

    If the variable is being set to an empty value, the line may end after the variable name.


FORMAT STRINGS

Naming of directories and files may be controlled by customizing Cretin's format strings, config variables ``cfg.dirfmt'' and ``cfg.filefmt''. Format strings are string containing tokens which obey the following grammar:

  • All tokens begin with a % character.

  • The next character in the token is one of the following letters:

    a, A

    Artist name.

  • l, L

    Album name.

    t, T

    Track name.

    n, N

    Track number.

    The case of the letter is significant; a lowercase letter will force items into lowercase, while an uppercase letter will leave capitalization untouched.

  • Optionally, the character _ may be specified next. This will replace space characters with underscores.

  • Optionally, a length of the form [nn] may be specified last. In the case of letters A, L and T, the length will be enforced as a maximum; in the case of N, the length will be enforced as a minimum.

    Cretin's default cfg.dirfmt is ``%A[64]/%L[64]'', and cfg.filefmt defaults to ``%n[2] %T[64]''.


TIPS AND TRICKS

Distributed Ripping and Encoding

Using the networked filesystem of your choice (NFS, AFP, SMB, etc.), share a directory among all desired computers. Set cfg.rootdir on each computer to point to the directory (or a subdirectory). Ensure that all directory-related variables among machines are set in unison. You may now rip and encode on multiple computers.

Multiprocessing

On each machine, set the cfg.maxenc variable equal to (or just higher than) the number of CPU cores you'd like to keep busy.

Delayed Encoding

Run ``cretin rip'' first, then don't run ``cretin enc'' until you are ready.


AUTHOR

Pete Gamache, gamache!@#$%gmail.com.


COPYRIGHT AND LICENSE

Cretin is copyright 2007, Pete Gamache.

Cretin is released under the Perl Artistic License, whose text is available at: http://dev.perl.org/licenses/artistic.html.


BUGS AND KNOWN ISSUES

FreeDB lookup may be incorrect if there are multiple records returned from the database.