ripit version 1.1 24/02/99
Created by Simon Quinn <simon.quinn@bigfoot.com>
Web Site: http://www.netcomuk.co.uk/~squinn/ripit.html

WHAT IS IT?
ripit is used to create MPEG-1 Layer 3 (MP3) audio files from an Audio CD.
It is simply a front-end, written in perl, for 3 excellent programs:
    * "xmcd" for CDDB lookup (doesn't use the GUI stuff)
    * "cdparanoia" for ripping the Audio CD tracks
    * "bladeenc" for encoding the MP3 files

It runs in text mode (no fancy GUI here) and does everything required 
to produce a set of MP3 files without any user-intervention. 
This program does the following with an Audio CD:
    * Get the Audio CD Album/Artist/Tracks information from CDDB (using xmcd)
    * Rip the Audio CD Tracks (using cdparanoia)
    * Encode the MP3s (using bladeenc)
    * id3 tag the MP3s
    * Create an M3U file (lists MP3s created, used by various MP3 players)

Installation
------------
There is no installation required for the program itself, but the following
software MUST be installed and in your PATH: 
    perl v5 - will most probably already be installed

    cdparanoia vIII - http://www.mit.edu/afs/sipb/user/xiphmont/cdparanoia/

    bladeenc v0.72 or later - http://bladeenc.home.ml.org

    xmcd v2.4 - http://metalab.unc.edu/tkan/xmcd/
      (Only the CDDB libraries and "cda" program are used)

    HINTS for configuring XMCD:
    * environment variable XMCD_LIBDIR required or CDDB will fail.
    * set cddbRemoteAutoSave to True in $XMCD_LIBDIR/config/common.cfg 
    * To retrieve and store locally a number of CD titles quickly from CDDB
      use the following for each CD whilst on-line:
          cda on ; cda toc ; cda off

Configuring ripit
-----------------
There are only 4 user configurable parameters for the program and these are
located at the top of the program.
    $cddev         - is the cdrom device used for ripping
    $outputdir     - where the ripped & encoded files will go
    $bitrate       - bitrate for the encoder, 160 is recommended for bladeenc
    $tracktemplate - contains a template of the trackname that will be used

Of course being a perl program you can easily configure anything in the 
program to your taste.

Setting the Tracktemplate
-------------------------
The tracktemplate contains the format of the filename for the tracks. This
variable is later eval'd by perl so you can put any legal variables and 
characters in here you like. The '" and "' are important and MUST surround the
template.
Variables you may want to use: 
  $tracknum  - number of the current CD track
  $trackname - name of the current CD track
  $artist    - CD artist name
  $album     - CD album name
Example:
  '"$tracknum $artist - $trackname"' would produce:
  02 Mark Morrison - Return Of The Mac
  
Using ripit
-----------
Simply insert an Audio CD and type "ripit.pl". 
The program will then merrily go away and rip/encode the files from the 
first to the last track unless it encounters a problem. 

First the album/artist/track information is retrieved from CDDB either
locally or via the Internet, depending on your xmcd configuration.

The MP3 files will be put into a directory with the following format:
    $OUTPUTDIR/Artist - Album/
with the track name consisting of the track number and songname.

The MP3 files will automatically be id3 tagged if CDDB lookup was successful.

The following options are available:

ripit.pl [--halt] [--bitrate rate] [--year year] [--device cddevice] [start_track]

[start_track]       - Tracks to rip from. If not specified all tracks will be 
                      ripped. You can also specify a single track by using a 
                      single number, or a selection of tracks using numbers 
                      separated by commas, i.e. 2,6,10 
                      Using a number followed by only a comma will rip from 
                      that track to the end of the CD i.e. 3, (Rips from 
                      track 3 to the last one)
--halt              - Powers off the machine when finished
                      if your configuration supports it
--bitrate [rate]    - Encode MP3 at this bitrate (default 160)
--year [year]       - Tag MP3 with this year (included as CDDB
                      does not store this information)
--device [cddevice] - CD Audio device to rip from


Program Notes
-------------
Most of the output to the screen is produced by the cdparanoia program. The
bladeenc output goes to the output file /tmp/bladeenc.log as I considered
the cdparanoia information to be more important.

The only bladeenc information printed to the screen is its progress in the
format "Bladeenc Encoding track x of x". If you want to see what bladeenc
is doing "tail -f /tmp/bladeenc.log".

The encoding is started as a separate thread from the rest of the program
so that the encoder is never idle. 

A log of what ripit does is written to /tmp/ripit.log

Author's Comment
----------------
This is my first bit of perl code and I've only spent a few days writing it 
so I hope you won't be too critical. I wish I had got around to learning 
perl much earlier as it is a very powerful but easy to use language.

I would be grateful for any suggestions on how to improve the code or write
better perl.

Why did I write this when there are so many other CD ripper front ends?
There are some very good Linux programs out there that all do similar 
things but none of them did exactly what I wanted, which spurred me into
writing this and at the same time learn perl.

Cheers
Simon Quinn, Lancashire, UK

Send bugs/comments to: simon.quinn@bigfoot.com
