Information for a CD or list of audio files.
This is a class to contain a CD or playlist's information for a catalog database. It is only a container; it does nothing towards database maintainence or modification.NOTE 1: All class methods are inlined and defined after the class declaration. Please be sure you compile accordingly!
NOTE 2: Methods that access protected arrays do not check those indices to see if they are in range! That's your job as the programmer.
The magic number is calculated using Ti Kan's magic number algorithm, as presented in the source code for "wm2xmcd", part of his "xmcd" CD player program. See a source code distribution for "xmcd" for more info; direct all queries about the magic number to ti@amb.org.
---------------------------------------------------------- ----------------------------------------------------------
Do not deallocate this array; you'll cause ~Catalog() to crash.
The constructor initializes several internal arrays and
strings. These arrays must have some non-zero length,
specified by len0. The default is set to 2, to prevent
the destructor from segfaulting. The other two parameters are not quite as critical.
units specifies the unit of time you're using in this
Catalog. It defaults to units of frames [common on CD's]; if
you wanted to make a Catalog of sound files, you'd set
units to the number of bytes per second in each file. The initial names of each item are the string tag plus
the item number.
Each item has associated with it a unique time-index, which
typically specifies its position on the CD. If you are
cataloging a list of soundfiles, you should set val to
the time() of the previous item plus the length of that
item. val should always be in the units specifed when you
called the constructor [ This method automatically calls genMagic to update the
Catalog magic-number.
Based on the magic number generator by Ti Kan [ti@amb.org];
please direct all questions about it to him.
int pLen
Catalog(unsigned int len0=2, unsigned int units=FRAME_PER_SEC, char *tag="Track")
Catalog(Catalog& that)
~Catalog(void)
int len(void)
const char* title(void)
const char* artist(void)
const char* name(unsigned int idx)
int time(unsigned int idx)
char* plName(unsigned int idx)
int plTime(unsigned int idx)
void resetPlaylist(void)
unsigned long magic(void)
void setTime(unsigned int idx, int val)
void setName(unsigned int idx, const char *ostr)
void setTitle(const char *ostr)
void setArtist(const char *ostr)
void genMagic(void)
Catalog& operator=(Catalog& that)
bool operator==(Catalog that)
bool operator!=(Catalog that)
void operator<<=(int newmagick)
Copyright 1997 by John Weiss [John.Weiss@colorado.edu]
"generated by doc++"?! More like mangled generated by doc++