Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 66f935a6f847f0500d0163fcc283f080 > files > 29

kmusicdb-0.9.3-1mdk.ppc.rpm

<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1-Based Variant V1.0//EN"
 "dtd/kdex.dtd">

<book lang="&language;">

<bookinfo>
<title>The KmusicdB Handbook</title>

<authorgroup>
<author>
<firstname>Will</firstname>
<surname>DeRousse</surname>
<affiliation>
<address><email>badhack@users.sourceforge.net</email></address>
</affiliation>
</author>
</authorgroup>

<copyright>
<year>2001-2002</year>
<holder>Will DeRousse</holder>
</copyright>


<date>2002-11-23</date>
<releaseinfo>0.9.3</releaseinfo>

<abstract><para>KmusicdB is a music information manager for KDE with CDDB
support. It is used primarily for organizing your music collection.</para>
<para>This document describes KmusicdB version 0.9.3.</para></abstract>

<keywordset>
<keyword>KDE</keyword>
<keyword>KmusicdB</keyword>
<keyword>music</keyword>
<keyword>collection</keyword>
<keyword>audio</keyword>
<keyword>CDDB</keyword>
</keywordset>

</bookinfo>

<chapter id="introduction">
<title>Introduction</title>
<para>KmusicdB is a music information manager. With KmusicdB you can organize your
entire music collection (vinyl, tapes, CDs, DVDs) and conveniently
browse through it. Title and track editors, and CDDB
access make adding your collection easy.</para>
<para>After adding your collection you can browse through your collection and customize
your display.</para>
<para>After adding your collection you can run searches to find any
particular information, or run reports (like a list of all your
collected CDs sorted by year).</para>
<para>With KmusicdB you can also keep track of your wishlist of CDs. KmusicdB
also supports a wide range of settings like the ability to properly
format and capitalize CDDB information and local CDDB support via
KSCD.</para>
<para>KmusicdB can connect to any local or remote PostgreSQL server over TCP/IP, with authentication or without.</para>
</chapter>

<chapter id="server">
<title>Setting Up The Server</title>

<note><para>In order for KmusicdB to work
properly, PostgreSQL (version 7.2.x or later) must be properly installed and
running.</para></note>

<sect1 id="ovrvw">
<title>Overview</title>
<para>KmusicdB is a front-end to a SQL database. KmusicdB uses
PostgreSQL for its database services. KmusicdB makes queries and requests to
the server and formats the response in a way that is useable (i.e. the track
editor). This also applies for handling errors that might occur.</para>
<para>Before you can use KmusicdB, you must install and run PostgreSQL and
make sure that it is accepting connections. After that you need to add users
and then you can create databases for use with KmusicdB.</para>
</sect1>

<sect1 id="installandrun">
<title>Installing And Running PostgreSQL</title>

<important><para>Most distributions come with PostgreSQL preinstalled. Find
out which version it is and either uninstall or upgrade it if it's less than
7.2.x. You can use
<userinput><command>service</command></userinput> to enable
it during boot.</para></important>

<sect2 id="install">
<title>Installation</title>
<para>You can either obtain PostgreSQL from source or RPM at
http://www.postgresql.org/ or from custom made RPMs that your distribution
provides. I suggest using the RPMs that your distribution provides because
they are easy to use.</para>

<note><para>Before installing I suggest that you backup any old
databases and completely uninstall any existing versions of
PostgreSQL. In the very least, stop your existing server from
running while installing and configuring the new one.</para></note>

<sect3 id="rpm">
<title>RPM</title>
<para>Installing from RPM is quite easy. We'll assume the version you are installing is 7.2.1. At a command prompt (as root) in
the directory of the files type in <filename>rpm -Uvh
postgresql-7.2.1.i386.rpm</filename>,
<filename>postgresql-server-7.2.1.i386.rpm</filename> and
<filename>rpm -Uvh
postgresql-libs-7.2.1.i386.rpm</filename>. This should install the
server, clients and the C++ libraries needed to run KmusicdB. If you are
compiling KmusicdB from source you must install the devel RPM also.</para>
<para>After the installation, check to see if the server was automatically
started by typing <userinput><command>ps aux</command></userinput>. Look for
<userinput><command>postmaster</command></userinput>. It should be running
with the <userinput><command>-i</command></userinput> option enabling TCP/IP
connections.</para> <para>If the server is not running with the
<userinput><command>-i</command></userinput> option then it can be added by
editing the startup script in
<filename>/etc/rc.d/init.d/postgresql</filename></para>
<important><para>Enabling TCP/IP connections can be DANGEROUS! Most default
installs allow all connections regardless of where they come from. Check the
postgresql docs to lock down security. </para></important>
<para>Your server should now be properly configured.</para>
</sect3>

<sect3 id="src">
<title>Source</title>

<para>First, download the source files:
<filename>postgresql-base-7.2.1.tar.gz</filename>,
<filename>postgresql-docs-7.2.1.tar.gz</filename>,
<filename>postgresql-opt-7.2.1.tar.gz</filename>. After downloading, change to
the directory where you downloaded the files and run <userinput><command>tar
zxf filename</command></userinput> where filename is the name of each file.
Now we must change to the source directory, configure and build it. Enter
<userinput><command>cd postgresql-7.2.1</command></userinput>. Now we must
configure and build the server, so enter <userinput><command>./configure
--prefix=/usr --enable-locale --without-tk --with-openssl --enable-odbc
--with-CXX --enable-syslog</command></userinput>. I suggest building with
openssl and odbc, but it isn't a requirement. You can omit those two options.
Now enter <userinput><command>make</command></userinput>.</para>

<para>Now with a successful build of your server it is time to install.
Installing PostgreSQL requires more than just the usual make install. Still in
the source directory, enter the obligatory <userinput><command>make
install</command></userinput>. As a precursor to starting the server, we
need to create a directory to store the database. I like to put them in
<filename><replaceable>/usr/share</replaceable></filename>, but that may not be
 the safest thing in a
 secure environment.
At the prompt enter <userinput><command>mkdir
<replaceable>/usr/share</replaceable>/pgsql</command></userinput>, then
 <userinput><command>mkdir
<replaceable>/usr/share</replaceable>/pgsql/data</command></userinput>,
 <userinput><command>chown
postgres:postgres
 <replaceable>/usr/share</replaceable>/pgsql</command></userinput> and then do
 the
same for <filename><replaceable>/usr/share</replaceable>/pgsql/data</filename>.
 Now just in case user
postgres doesn't exist we try to add one with <userinput><command>adduser
postgres</command></userinput>. Now <userinput><command>su
postgres</command></userinput> and enter <userinput><command>initdb -D
<replaceable>/usr/share</replaceable>/pgsql/data</command></userinput>. This
 initializes the database and
finally, to start the server enter <userinput><command>postmaster -i -D
<replaceable>/usr/share</replaceable>/pgsql/data</command></userinput>. I
 suggest
writing a startup script to automatically start the server when you boot (one
of the props of an RPM is it comes with the script).</para>

<para>We are not quite done yet. With the server installed and running, we
still need to install the headers and this is done with
<userinput><command>make install-all-headers</command></userinput>. Now
for users trying to install versions before 7.1.3, there is a bug in the header
 files and you have to fix it.
Edit file
 <filename>/usr/src/include/postgresql/libpq++/pgconnection.h</filename>. Look
for a line (near the beginning) that says #include "config.h". Edit that line
to resemble #include "../config.h". Notice the ../ added. This will allow
KmusicdB to build from source.</para>
</sect3>
</sect2>

<sect2 id="users"> <title>Adding Users</title>
<para>Now that your server is up and running, it is time to add your
username to the PostgreSQL database. From this point on I will assume
that <replaceable>will</replaceable> is your username.</para>
<para>From the command prompt <userinput><command>su root</command></userinput>, put in the password and then
<userinput><command>su postgres</command></userinput>.
postgres is the username PostgreSQL runs under. As of now, it is the only user defined in the database so we need
to change to that user.</para>
<para>Now enter <userinput><command>psql template1</command></userinput>. This
will launch the SQL query tool and connect to the template1 database.
template1 is the database that stores all the information about all the other
databases in the system. You should receive a prompt. At the prompt enter
<userinput><command>CREATE USER <replaceable>will</replaceable> WITH PASSWORD
'<replaceable>password</replaceable>' CREATEDB;</command></userinput>. This will
 create the user 'will' with password 'password' and grant the ability to
 create databases. You need to be able to create databases in order to add new databases to the system.
Now enter <userinput><command>\q</command></userinput> to quit the program and
<userinput><command>exit</command></userinput> twice to un-su back to
you.</para>
<para>Your user is now installed and the server is running, you can now
install and run KmusicdB.</para>
</sect2>
</sect1>

</chapter>

<chapter id="interface">
<title>The Interface</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="interface.png"/></imageobject>
</mediaobject>
<sect1 id="intrfcwrppr">
<title>Interface</title>

<sect2 id="title">
<title><interface>Titlebar</interface></title>
<para>The title bar contains information on your current database. If you are not
connected to a database the title bar displays "Not Connected". If you are connected, it displays
"Connected", the name of the database, and host you are connected to. The title bar also contains
the version of KmusicdB you are running.</para>
</sect2>

<sect2 id="menubar"> <title><interface>Menubar</interface></title>
<para>Contains the following menus:</para>

<variablelist>

<varlistentry>
<term><guimenu>File</guimenu></term>
<listitem><para>For creating, opening, backup, etc., databases and quitting the
 program.</para></listitem>
</varlistentry>

<varlistentry>
<term><guimenu>Edit</guimenu></term>
<listitem><para>For creating, editing, deleting artist, titles and categories.
 Also included entries for submitting and retrieving CDDB
 information.</para></listitem>
</varlistentry>

<varlistentry>
<term><guimenu>Reports</guimenu></term>
<listitem><para>For running the various reports.</para></listitem>
</varlistentry>

<varlistentry>
<term><guimenu>Bands To Explore</guimenu></term>
<listitem><para>This is a place to jot down artist or bands that you might want
 to look into later (like a scratch pad).</para></listitem>
</varlistentry>

<varlistentry>
<term><guimenu>Settings</guimenu></term>
<listitem><para>To turn off and on menubar, statusbar and toolbars. Also has the
 entry to open the preferences dialog.</para></listitem>
</varlistentry>

<varlistentry>
<term><guimenu>Help</guimenu></term>
<listitem><para>Various information and this.</para></listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="toolbar">
<title><interface>Toolbar</interface></title>
<para>Contains buttons for convenient access to commonly used menu items.</para>
</sect2>

<sect2 id="searchbar">
<title><interface>Searchbars</interface></title>
<para>There are two search bars in KmusicdB (which can be toggled on and off).
 Look for more information on them in <link
 linkend="searches">Searches</link>.</para>
</sect2>

<sect2 id="mainview">
<title><interface>Music Browser</interface></title>
<para>This is the main focus in KmusicdB. In the top you have the artist
 combobox. Click on the box and choose the artist you wish to view. Right
 clicking opens the <link linkend="artists">artist properties</link>.</para>
<para>Below lists all the titles by the selected artist. The name is always
 listed on the left and custom information is listed on the right. The
 columns on the right are selected from preferences. <link linkend="editt">Double click a title</link> to
 view its properties.</para>
</sect2>

<sect2 id="statusbar">
<title><interface>Statusbar</interface></title>
<para>The statusbar is divided into 5 sections. The first section is the
 progress bar and gives you and indication of how far along something is going.
Just to the right of that is the information box. It lists what KmusicdB is
 trying to do. If an operation completes succesfully, the progress bar will be
 at 100% and the
information bar will say <guilabel>Ready...</guilabel>. If there is a problem, an error box will popup
 and you can check the information bar to see where to error occurred.</para>
<para>The last three boxes contain statistical information and supplement the
 main view. The "Total Artists" box contains the total amount of artists in the
 database. The "Titles" box contains two numbers separated by a /. The first
 number is how many titles you've collected and the second is the total number
 of titles (for the current artist). The last box, "Total Time", sums all the titles for
 the current artist and displays the total length.</para>
</sect2>
</sect1>
</chapter>

<chapter id="database">
<title>Managing Your Music Database</title>

<sect1 id="newopen">
<title>Creating and Opening KmusicdB Databases</title>

<sect2 id="new">
<title>Creating A New Database</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="opendb.png"/></imageobject>
</mediaobject>
<para>In order to use KmusicdB you have to create and then connect to the
 database. To create a new database click on
 <menuchoice><guimenu>File</guimenu><guimenuitem>New
 Database</guimenuitem></menuchoice> or <guibutton>New</guibutton> on the
 <interface>Toolbar</interface>. This opens the <guilabel>Create New
 Database</guilabel> dialog. You put in the name of the database, the port and
 address for your server and your username and password.</para>

<note><para>If your database or server does not use passwords, then that field
 is simply ignored.</para></note>
<para>Now, click <guibutton>Create</guibutton> and in a few moments the database
 should be formatted and ready for use.</para>

</sect2>

<sect2 id="open">
<title>Opening An Existing Database</title>
<para>Opening a database is very similar to creating a new database. Click on
 <menuchoice><guimenu>File</guimenu><guimenuitem>Open
 Database</guimenuitem></menuchoice> or <guibutton>Open</guibutton> on the
 <interface>Toolbar</interface> to bring up the open dialog. Fill in the
 information and click open.</para>
</sect2>

<sect2 id="close">
<title>Closing A Database</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="closedb.png"/></imageobject>
</mediaobject>
<para>When you want to close a database click on
 <menuchoice><guimenu>File</guimenu><guimenuitem>Close
 Database</guimenuitem></menuchoice> and KmusicdB will ask you if you want to
 close the database. Choose <guibutton>Yes</guibutton> or
 <guibutton>No</guibutton>.</para>
</sect2>
</sect1>

<sect1 id="backuprestore">
<title>Backing Up And Restoring</title>
<para>PostgreSQL supports backing up and restoring of databases. KmusicdB has a
 customized method of backing up and restoring music databases. It is compatible with pg_dump.</para>

<sect2 id="backup">
<title>Backup</title>
<para>Click on
 <menuchoice><guimenu>File</guimenu><guimenuitem>Backup</guimenuitem></menuchoice> and
 choose a location and filename to backup your database. The standard is
 to use the extension <filename>.dump</filename>.</para>
</sect2>

<sect2 id="restore">
<title>Restore</title>
<para>Click on
 <menuchoice><guimenu>File</guimenu><guimenuitem>Restore</guimenuitem></menuchoice>,
 select the file you want to restore and KmusicdB will delete the currectly open database
  and restore the one from backup.</para>
</sect2>

</sect1>

<sect1 id="opti">
<title>Optimizing</title>
<para>You should periodically optimize your database. Optimizing clears out old
garbage and in reorganizes data in a contiguous manner. This also optimizes PostgreSQL's planner,
 which optimizes queries. See the PostgreSQL documentation for more information on this.</para>
 <para>Optimize is available from
 <menuchoice><guimenu>File</guimenu><guimenuitem>Optimize</guimenuitem></menuchoice>.
 </para>
</sect1>

</chapter>

<chapter id="categories">
<title>Categories (And Bands To Explore)</title>
<sect1 id="catovervw">
<title>What Are Categories?</title>
<para>KmusicdB uses 6 different categories to catalog and define each title. When you
enter a <link linkend="titles">new title</link> into your database, you choose the
value in each category (for example you would use DVD-Audio instead of Vinyl if you are
putting in a music DVD).</para>
<para>The ability to add, edit and change categories is available from
<menuchoice><guimenu>Edit</guimenu><guisubmenu>Categories</guisubmenu></menuchoice>.</para
> </sect1>

<sect1 id="editcat">
<title>Adding, Editing and Deleting</title>
<para><mediaobject>
<imageobject><imagedata format="PNG" fileref="category.png"/></imageobject>
</mediaobject></para>
<note><para>Changing any values in a category automatically updates any entries in open
title dialogs and preferences dialogs.</para></note>
<important><para>You cannot edit or change any category entry named UNKNOWN. This is a
system value and cannot be renamed or removed.</para></important>

<sect2 id="add">
<title>Add</title>
<para>To add an entry into a category type the name in and click
<guibutton>Add</guibutton>.</para>
</sect2>

<sect2 id="update">
<title>Update</title>
<para>Click on the entry you want to update, make your changes then click
<guibutton>Update</guibutton>.</para> </sect2>

<sect2 id="delete">
<title>Delete</title>
<para>Click on the entry you want to delete then click
<guibutton>Delete</guibutton>.</para> </sect2>

</sect1>

<sect1 id="dndcat">
<title>Dragging And Dropping</title>
<para>You can drag and drop categories between themselves or between instances of KmusicdB. To move an item from one
place to another, click on the item, hold your mouse button and drag your mouse over to the other database, when the
'+' appears, let go and it will add the item to the database. You cannot drop an item to and from the same window.</para>
</sect1>

<sect1 id="difcats">
<title>Categories</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="category.png"/></imageobject>
</mediaobject>

<sect2 id="boxset">
<title>Boxsets</title>
<para>Boxsets are just that. Boxes of CDs which are overpriced but usually come
with cool stuff.</para>
<para>Boxsets is available from
<menuchoice><guimenu>Edit</guimenu><guisubmenu>Categories</guisubmenu><guimenuitem>Boxset
</guimenuitem></menuchoice>.</para>
</sect2>

<sect2 id="format">
<title>Formats</title>
<para>Formats are CDs, DVDs, Tapes, etc.</para>
<para>Formats is available from
<menuchoice><guimenu>Edit</guimenu><guisubmenu>Categories</guisubmenu><guimenuitem>Format
</guimenuitem></menuchoice>.</para>
</sect2>

<sect2 id="genre">
<title>Genres</title>
<para>Genres are Rock, Jazz, Country, Drum and Bass, etc.</para>
<para>Genres is available from
<menuchoice><guimenu>Edit</guimenu><guisubmenu>Categories</guisubmenu><guimenuitem>Genre
</guimenuitem></menuchoice>.</para>
</sect2>

<sect2 id="label">
<title>Labels</title>
<para>Labels are like Warner Brothers, Epic, Nothing, etc.</para>
<para>Labels is available from
<menuchoice><guimenu>Edit</guimenu><guisubmenu>Categories</guisubmenu><guimenuitem>Labels
</guimenuitem></menuchoice>.</para>
</sect2>

<sect2 id="method">
<title>Methods</title>
<para>Methods are live, remix, covers, etc.</para>
<para>Methods is available from
<menuchoice><guimenu>Edit</guimenu><guisubmenu>Categories</guisubmenu><guimenuitem>Methods
</guimenuitem></menuchoice>.</para>
</sect2>

<sect2 id="type">
<title>Types</title>
<para>Types are Singles, LPs, etc.</para>
<para>Types is available from
<menuchoice><guimenu>Edit</guimenu><guisubmenu>Categories</guisubmenu><guimenuitem>Types
</guimenuitem></menuchoice>.</para>
</sect2>
</sect1>

<sect1 id="bte">
<title>Bands To Explore</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="bte.png"/></imageobject>
</mediaobject>
<para>Bands To Explore is a kind of scratch pad you can write down artist and bands
you want to check out. That way you don't forget. This dialog is just like other dialogs
except it has the added <guibutton>Transfer</guibutton> button. Clicking on this allows
you to change a <guilabel>Bands To Explore</guilabel> entry into an
<guilabel>Artist</guilabel>.</para>
<para>Bands To Explore is available from
<menuchoice><guimenu>Bands To Explore</guimenu><guimenuitem>Explore List</guimenuitem></menuchoice>.</para>
</sect1>

</chapter>

<chapter id="artists">
<title>Artists</title>
<sect1 id="artovervw">
<title>Overview</title>
<para>KmusicdB is organized as a top down hierarchy with Artists at the top, then
Titles below it and Tracks below Titles at the bottom (Categories are properties of
Titles). You can have as many Artist dialogs open as you want.</para>
</sect1>

<sect1 id="artistadd">
<title>Adding And Editing</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="artist.png"/></imageobject>
</mediaobject>

<sect2 id="newa">
<title>New Artist</title>
<para>To create a new artist click on
<menuchoice><guimenu>Edit</guimenu><guimenuitem>New Artist</guimenuitem></menuchoice> or
click on the <guibutton>New Artist</guibutton> button.</para>
<para>After you open the <guilabel>New Artist</guilabel> dialog fill in the information
and click <guibutton>Add</guibutton> button.</para>
<note><para>Clicking the <guibutton>World</guibutton> button launches
Konqueror and goes to the website listed for your artist.</para></note>
</sect2>

<sect2 id="edita">
<title>Edit Artist</title>
<para>To edit an artist click on
<menuchoice><guimenu>Edit</guimenu><guimenuitem>Edit Artist</guimenuitem></menuchoice>
or click on the <guibutton>Edit Artist</guibutton> button. You can also right click
the artist combo box to open the edit dialog.</para>
<para>Editing an artist is just like adding a new one. Open the dialog, edit the content
 and then click
<guibutton>Update</guibutton>.</para>
</sect2>
</sect1>

<sect1 id="delartist">
<title>Deleting</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="del_artist.png"/></imageobject>
</mediaobject>
<para>Deleting artists is accessible by clicking on
<menuchoice><guimenu>Edit</guimenu><guimenuitem>Delete Artist</guimenuitem></menuchoice>
or by clicking on the <guibutton>Delete Artist</guibutton> button.</para>

<para>Deleting an artist is simple, but has a accident mechanism built in. In order to
delete an artist the artist combobox must be highlighted. Once it is highlighted then the
delete option will be enabled and you can delete the artist. When you delete an artist
all the subsequent titles and tracks are deleted as well.</para>
<para>Selecting <guibutton>Yes</guibutton> will delete the artist and
<guibutton>No</guibutton> cancels the action.</para>
</sect1>

<sect1 id="relistartists">
<title>Relisting Artists</title>
<para>If you at any time want or need to refresh the list of artists, select <menuchoice><guimenu>Edit</guimenu><guimenuitem>Relist Artists</guimenuitem></menuchoice>.</para>
</sect1>

</chapter>

<chapter id="titles">
<title>Titles</title>
<sect1 id="titleovrvw">
<title>Overview</title>
<para>A title consists of its name, yearstart and yearend, categories, and a number of other properties.</para>
<para>You can have as many <guilabel>Title</guilabel> dialogs open as you want.</para>
<para>Also, updating, adding or deleting a category will reflect the change in open dialog
boxes.</para>
<para>You must have at least one artist in the database before you can add any titles.</para>
<para>You can have more than one title with the same name, even for the same artist.</para>
</sect1>
<sect1 id="titleadd">
<title>Adding And Editing</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="title.png"/></imageobject>
</mediaobject>

<sect2 id="newt">
<title>New Title</title>
<para>To add a new title click on
<menuchoice><guimenu>Edit</guimenu><guimenuitem>New Title</guimenuitem></menuchoice> or by
clicking on the <guibutton>New Title</guibutton> button. After opening the
<guilabel>New Title</guilabel> dialog fill in the information and click
<guibutton>Add</guibutton>. When adding a new title you will notice the
<guilabel>Track Editor</guilabel> is disabled. You must add the title first before
adding <link linkend="tracks">tracks</link>.</para>




<note><para>You must have at least one artist already added to the
database before you can add a title.</para></note>

<sect3 id="pic">
<title>Adding A Picture To Your Title</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="title_pic.png"/></imageobject>
</mediaobject>
<para>On a <guilabel>New Title</guilabel> click on <guibutton>Add Picture</guibutton> to
add a picture.</para>
<para>In the <guilabel>Picture</guilabel> dialog click on <guibutton>Change</guibutton> to
specify the location of the picture. KmusicdB supports all the formats KDE
supports.</para>
<para>Click on <guibutton>Save As</guibutton> to save your pic as a PNG image.</para>
<note><para>The default picture size is 250x230. Anything bigger will be
cropped and anything smaller will be anchored in the top left corner.</para></note>

</sect3>


</sect2>

<sect2 id="editt">
<title>Edit Title</title>
<para>Editing a title is very similar to adding one. Click on
<menuchoice><guimenu>Edit</guimenu><guimenuitem>Edit Title</guimenuitem></menuchoice>
or <guibutton>Edit Title</guibutton> button or double-click the title. After you are done
updating the information, click on <guibutton>Update</guibutton> to update the database
and close the dialog.</para>
<para>The <link linkend="tracks"><guilabel>Track Editor</guilabel></link> is available in this window.</para>


</sect2>

</sect1>
<sect1 id="deltitle">
<title>Deleting</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="del_title.png"/></imageobject>
</mediaobject>
<para>To delete a title, it must be highlighted and then you can click on
<menuchoice><guimenu>Edit</guimenu><guimenuitem>Delete Title</guimenuitem></menuchoice>
or by clicking on the <guibutton>Delete Title</guibutton> button. In the <guilabel>Delete
Title</guilabel> dialog choose <guibutton>Yes</guibutton> to remove the title or
<guibutton>No</guibutton> to cancel.</para>
</sect1>

<sect1 id="dndtitle">
<title>Dragging And Dropping</title>
<para>KmusicdB supports dragging and dropping titles between instances. To move a title from one database to another,
click on the item, hold your mouse button and drag your mouse over to the other database, when the '+' appears, let go
and it will add the item to the database. You cannot drop a title to and from the same window.</para>
</sect1>

<sect1 id="relisttitles">
<title>Relisting Titles</title>
<para>If you at any time want or need to refresh the list of titles, select <menuchoice><guimenu>Edit</guimenu><guimenuitem>Relist Titles</guimenuitem></menuchoice>.</para>
</sect1>

</chapter>

<chapter id="tracks">
<title>Using The Track Editor</title>
<sect1 id="trackoverview">
<title>Overview</title>
<para>The track editor allows you to edit and add track information for each title.
It is accessible via the <guilabel>Edit Title</guilabel> dialog by clicking on
<guibutton>Edit Tracks</guibutton>.</para>
<para>You can only have one <guilabel>Track Editor</guilabel> open per title and it will
automatically close if the <guilabel>Edit Track</guilabel> dialog is closed.</para>
</sect1>

<sect1 id="trackeditor">
<title>Using The Track Editor</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="trackeditor.png"/></imageobject>
</mediaobject>
<para>The Track Editor consists of three buttons on the right:
<guibutton>Add</guibutton>, <guibutton>Update</guibutton>, and
<guibutton>Delete</guibutton>. The center consists of the list of tracks (their
track number, name, and length). All the way to the left are the up and down
buttons for rearranging tracks. Finally, at the top you can enter the track name
and set the length with spin boxes.</para>

<sect2 id="addtrack">
<title>Adding And Updating</title>
<para>To add a track simply put the name of the track in <guilabel>Name</guilabel>,
set the length of the track and click <guibutton>Add</guibutton> or press
<keycombo><keycap>Enter</keycap></keycombo>. To update a track select it, the information
will appear above, edit it, then click <guibutton>Update</guibutton>.</para>
</sect2>

<sect2 id="deltrack">
<title>Deleting</title>
<para>Highlight the track you want to remove and click
<guibutton>Delete</guibutton>.</para>
</sect2>

<sect2 id="updowntrack">
<title>Changing Order</title>
<para>Highlight the track you want to move, the click on the up or down <guibutton>Arrow</guibutton>
buttons.</para>
</sect2>

</sect1>

<sect1 id="dndtrack">
<title>Dragging And Dropping</title>
<para>You can drag and drop tracks between titles. To move an item from one
place to another, click on the item, hold your mouse button and drag your mouse over to the other database, when the
'+' appears, let go and it will add the item to the database. You cannot drop a track to and from the same window.</para>
</sect1>
</chapter>

<chapter id="cddb">
<title>Using CDDB</title>
<sect1 id="dlcddb">
<title>Adding Titles via CDDB</title>
<para>KmusicdB supports adding new titles with the help of the popular CDDB. To do
this, put your CD in your CD-ROM drive and click
<menuchoice><guimenu>Edit</guimenu><guimenuitem>New From CDDB</guimenuitem></menuchoice>
or by clicking on the <guibutton>Add Title From CDDB</guibutton> button. This will
check for a CD in the drive and retrieve the track information. Next, KmusicdB will
contact the CDDB database and retrieve the track information and add the title to
the database. It is important to note that adding a title with KmusicdB
automatically enters the default data for a title. After adding a title to the database,
by default KmusicdB will open the title for you to view.</para>
<para>If no CD is found in the drive, KmusicdB will ask you to put a CD in and retry, or
cancel if you want.</para>
<para>You need to have at least one artist added before this feature is enabled.</para>
</sect1>

<sect1 id="llcddb">
<title>Local CDDB via KSCD</title>
<para>KSCD is the CD Player that comes with the KDE desktop. If you have previously
used KSCD with the CD you are adding to the database, and it has already downloaded the
track names from CDDB, KmusicdB can search for that information on your drive
and use that instead. This is great for avoiding the internet and can be MUCH
faster.</para>
<note><para>This option is enabled by default in KmusicdB.</para></note>
<note><para>Because of implementation differences between the two programs,
KmusicdB only finds a match between 60-80% of the time.</para></note>
</sect1>

<sect1 id="ulcddb">
<title>Uploading Track Information To CDDB</title>
<para>The ability to submit information to CDDB exists in KmusicdB. Currently
this requires highlighting the title, putting the disc in your CD-ROM drive and
clicking on
<menuchoice><guimenu>Edit</guimenu><guimenuitem>Submit To CDDB</guimenuitem></menuchoice>.
This will read the information from your CD-ROM and your database to compile an
E-Mail to be sent to CDDB.</para>
<note><para>It is important that you setup your E-Mail server in
<guilabel>Preferences</guilabel> first, otherwise you can't submit data.</para></note>
</sect1>

</chapter>

<chapter id="reports">
<title>Reports</title>

<sect1 id="ovrvwreport">
<title>Overview, Concepts, And Common Report Interface</title>

<sect2 id="ovrvwrep">
<title>Overview</title>
<para>KmusicdB can generate several different reports in the form of an HTML document. The
process starts with opening the <link linkend="cri"><guilabel>Common Report
Interface</guilabel></link>. There you select your report options and can click either
<guibutton>Generate</guibutton> or <guibutton>Close</guibutton>. After generating the
report, the result is displayed in a window, similar to below.</para>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="htmlreport.png"/></imageobject>
</mediaobject>
<para>You can view your report and close it when you are done. If you want to save it as a
web page, click <guibutton>Save</guibutton> and if you want to print it click
<guibutton>Print</guibutton>.</para>
</sect2>

<sect2 id="cri">
<title>Common Report Interface</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="cri.png"/></imageobject>
</mediaobject>

<sect3 id="order">
<title><guilabel>Order</guilabel></title>
<para>Either sort your database alphabetically <guilabel>Ascending</guilabel> or
<guilabel>Descending</guilabel>. A check in <guilabel>By Year Not Name</guilabel>
means it will sort by the year, rather than the name (artist or title).</para>
</sect3>

<sect3 id="select">
<title><guilabel>Selection</guilabel></title>
<para>Either display <guilabel>All</guilabel> titles, only the ones you've
collected (<guilabel>Only Collected</guilabel>) or the ones you have not collected
(<guilabel>Not Collected</guilabel>).</para>
</sect3>

<sect3 id="dr">
<title><guilabel>Date Range</guilabel></title>
<para>Choose to display all titles, or just from a range of titles. The dates you
pick are inclusive.</para>
</sect3>

<sect3 id="colors">
<title><guilabel>Colors</guilabel></title>
<para>Select the different colors for your report. Text is for changing the color of the test.
 <guilabel>Misc</guilabel> is for totals and some headers. To change
the color click on the color and choose the new one from the palette.</para>
</sect3>

<sect3 id="font">
<title><guilabel>Font</guilabel></title>
<para>Select your font type, size and weight.</para>
</sect3>
</sect2>

</sect1>

<sect1 id="reporttypes">
<title>Report Types</title>

<sect2 id="tbya">
<title>Titles By Artist</title>
<para>Available from <menuchoice><guimenu>Reports</guimenu><guimenuitem>Titles By
 Artist</guimenuitem></menuchoice>.</para>
<para>Displays a table of artist information, then lists the titles by the artist.</para>
</sect2>
<sect2 id="trbyt">
<title>Tracks By Title</title>
<para>Available from <menuchoice><guimenu>Reports</guimenu><guimenuitem>Tracks By
 Title</guimenuitem></menuchoice>.</para>
<para>You must select a title before this report is enabled. This report displays
the title information, then lists the tracks.</para>
<para>Ordering <guilabel>Ascending</guilabel> or <guilabel>Descending</guilabel> arranges
the track order, and <guilabel>Years</guilabel> orders smallest to largest by time.
<guilabel>Selection</guilabel> and <guilabel>Date Range</guilabel> have no effect on this
report.</para>
</sect2>
<sect2 id="artistr"> <title>Artists</title>
<para>Available from
<menuchoice><guimenu>Reports</guimenu><guimenuitem>Artists</guimenuitem></menuchoice>.
</para>
<para>This report gives a list of artists. <guilabel>Ordering</guilabel> by
<guilabel>Ascending</guilabel> or <guilabel>Descending</guilabel> alphabetizes by name,
<guilabel>Years</guilabel> allows for sorting by <guilabel>Conception</guilabel> rather than name.
<guilabel>Selection</guilabel> picks selects whether you follow the artists or not, and
<guilabel>Date Range</guilabel> discriminates by comparing first release and last release (inclusive).</para>
</sect2>
<sect2 id="bter">
<title>Bands To Explore</title>
<para>Available from <menuchoice><guimenu>Reports</guimenu><guimenuitem>Bands To
 Explore</guimenuitem></menuchoice>.</para>
<para>Bands To Explore will list the artists in your BTE list.
<guilabel>Ascending</guilabel> and <guilabel>Descending</guilabel> ordering are the only
available options on this report.</para>
</sect2>
<sect2 id="collr">
<title>Collection</title>
<para>Available from
 <menuchoice><guimenu>Reports</guimenu><guimenuitem>Collection</guimenuitem></menuchoice>.
</para>
<para>Collection will print a list of your Collection. You can order
<guilabel>Ascending</guilabel> or <guilabel>Descending</guilabel>, <guilabel>Years</guilabel>
sorts by <guilabel>Year Start</guilabel>. You can choose
whether to print all, only collected, or just your wishlist (not collected) from
<guilabel>Selection</guilabel>, and you can choose a <guilabel>Date Range</guilabel> as
well.</para>
</sect2>
<sect2 id="drr">
<title>Date Range</title>
<para>Available from <menuchoice><guimenu>Reports</guimenu><guimenuitem>Date
 Range</guimenuitem></menuchoice>.</para>
<para>Date Range is identical to Collection except that Collection will display the
number of media for each title, Date Range will display the year it came out.</para>
</sect2>
<sect2 id="statsr">
<title>Statistics</title>
<para>Available from
 <menuchoice><guimenu>Reports</guimenu><guimenuitem>Statistics</guimenuitem></menuchoice>.
</para>
<para>Statistics will print several tables and many, many statistics. Order is
either <guilabel>Ascending</guilabel> or <guilabel>Descending</guilabel> by <guilabel>Name</guilabel>
or by <guilabel>Total</guilabel>. <guilabel>Selection</guilabel> is as you would expect, and the report can be narrowed by
<guilabel>Date Range</guilabel> as well.</para>
</sect2>

<sect2 id="catsrch">
<title>Category Search</title>
<para>Available from
 <menuchoice><guimenu>Settings</guimenu><guimenuitem>Show Category Search Toolbar</guimenuitem></menuchoice>.
</para>
<para>This allows you to list all the titles that belong to a particular category. You can limit the search by <guilabel>Selection</guilabel>,
<guilabel>Date Range</guilabel> and can be sorted.</para>
</sect2>

<sect2 id="namesrch">
<title>Name Search Report</title>
<para>Available from
 <menuchoice><guimenu>Settings</guimenu><guimenuitem>Show Name Search Toolbar</guimenuitem></menuchoice>.
</para>
<para>This allows you to search for a particular name in either Artists, Titles or Tracks. Same options apply here as in the
<guilabel>Category Search Toolbar</guilabel>.</para>
</sect2>

<sect2 id="topcdrep">
<title>Top Titles</title>
<para>Available from
 <menuchoice><guimenu>Reports</guimenu><guimenuitem>Top Title</guimenuitem></menuchoice>.
</para>
<para>This report will print the top 15 (or less if unavailable) highest rated titles in your collection. Narrowing down by <guilabel>Selection</guilabel>
and <guilabel>Date Range></guilabel> are available as well. <guilabel>Sorting</guilabel> is also available here.</para>
</sect2>

<sect2 id="customrep">
<title>Custom</title>
<para>Available from
 <menuchoice><guimenu>Reports</guimenu><guimenuitem>Custom</guimenuitem></menuchoice>.
</para>
<para>Running a custom report allows you to enter in a custom SQL statement and query the database. See the Appendix for information
on the database layout. All <guilabel>Sorting</guilabel>, <guilabel>Selection</guilabel> and <guilabel>Date Range</guilabel> options
are disabled, it is up to you to put them in your query. Select this option from the menu, and <guibutton>Generate</guibutton> this report
will cause a file dialog to appear. You select the text file your query is saved in and KmusicdB will run the query and return the output.
</para>
</sect2>

</sect1>

</chapter>

<chapter id="searches">
<title>Searching</title>
<sect1 id="ovrvws">
<title>Overview</title>
<para>There are two ways to search your database. The first way is to search for a
particular track, title or artist. The second is to search for a list of titles which belong
to a particular category.</para>
</sect1>
<sect1 id="cs">
<title>Category Search Toolbar</title>
<para>Enable the <guilabel>Category Search</guilabel> toolbar from
<menuchoice><guimenu>Settings</guimenu><guimenuitem>Show
Category Search Toolbar</guimenuitem></menuchoice>. In the toolbar select your
category and select the category entry and click the <guibutton>Find</guibutton>.
This will launch the familiar <guilabel>Common Report Interface</guilabel>.</para>
</sect1>
<sect1 id="nns">
<title>Name Search Toolbar</title>
<para>Enable the <guilabel>Name Search</guilabel> toolbar from <menuchoice><guimenu>Settings</guimenu><guimenuitem>Show
Name Search Toolbar</guimenuitem></menuchoice>. Enter the name you are searching
for, and then select artist, title or track. The search tries to return the closest
matches possible.</para>
</sect1>

</chapter>

<chapter id="preferences">
<title>Preferences And Settings</title>
<sect1 id="dbp">
<title>Database</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="pref_db.png"/></imageobject>
</mediaobject>

<sect2 id="defaultvalues">
<title><guilabel>Default Values</guilabel></title>
<para>Allows you to enter default values for opening and creating databases. This
is convenient if you are always connecting to the same host, for example. You can
also set it blank or use the information from the last connection made.</para>
</sect2>

<sect2 id="autoconnect">
<title><guilabel>Auto Connect</guilabel></title>
<para>Similar settings to above, putting a check here will allow you to
automatically connect to a particular server and database on startup.</para>
</sect2>

<sect2 id="information">
<title><guilabel>Information</guilabel></title>
<para>If you are currently connected to a database, this box will display
information on your server.</para>
</sect2>

</sect1>

<sect1 id="vp">
<title>Browser</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="pref_view.png"/></imageobject>
</mediaobject>

<sect2 id="display">
<title><guilabel>Display Columns</guilabel></title>
<para>Put a check in each column you wish to display in the main view.</para>
</sect2>

<sect2 id="sorting">
<title><guilabel>Sorting</guilabel></title>
<para>Use the combobox to choose the default sorting column. Click on <guilabel>Ascending</guilabel>
 or <guilabel>Descending</guilabel> to choose the direction. Choosing a column which isn't shown does nothing.</para>
</sect2>

</sect1>

<sect1 id="ap">
<title>Artists</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="pref_artist.png"/></imageobject>
</mediaobject>

<sect2 id="defaultvalues2">
<title><guilabel>Default Values</guilabel></title>
<para>Enter default values for a new artist. Can also set this to be blank
everytime, or use the information from the last artist added.</para>
</sect2>

<sect2 id="miscdefaults">
<title><guilabel>Misc Defaults</guilabel></title>
<sect3 id="currentyear">
<title>Auto Fill Conception With Current Year</title>
<para>For a new artist, putting a check here will automatically fill the conception
year with the current year.</para>
</sect3>
<sect3 id="copycat">
<title>Auto Fill End Year W/ Conception Year</title>
<para>Putting a check here will cause the end year to mirror the conception
year.</para> </sect3>
<sect3 id="follow">
<title>Default Follow Value</title>
<para>Allows a default follow to be set on any default option.</para>
</sect3>

</sect2>

</sect1>

<sect1 id="tp">
<title>Titles</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="pref_title.png"/></imageobject>
</mediaobject>

<sect2 id="defaultvalues3">
<title><guilabel>Default Values</guilabel></title>
<para>Enter default values for a new title. Can also set this to be blank
everytime, or use the information from the last title added.</para>
</sect2>

<sect2 id="miscdefaults2">
<title><guilabel>Misc Defaults</guilabel></title>
<sect3 id="currentyear2">
<title>Auto Fill Year Start With Current Year</title>
<para>For a new title, putting a check here will automatically fill the year start with the current year.</para>
</sect3>
<sect3 id="copycat2">
<title>Auto Fill Year End W/ Year Start</title>
<para>Putting a check here will cause the year end to mirror the year start.</para>
</sect3>
<sect3 id="collects">
<title>Default Collected Value</title>
<para>Allows a default collected to be set on any default option.</para>
</sect3>
</sect2>

</sect1>

<sect1 id="mp">
<title>Misc</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="pref_misc.png"/></imageobject>
</mediaobject>

<sect2 id="categorysort">
<title><guilabel>Category Sort Order</guilabel></title>
<para>Choose the default sorting order for category dialog boxes.</para>
</sect2>

<sect2 id="textformatting">
<title><guilabel>Text Formatting</guilabel></title>
<para>Text formatting applies to any artist, title, track or category entered into
the system. Does not effect existing items unless you update them.</para>
<para><guilabel>Simple Capitalization</guilabel> will capitalize the first letter of each
word and after a hyphen. <guilabel>Complete Formatting</guilabel> will lowercase the
whole string, then uppercase the first letter of each word and the first letter after any
punctuation. This is great for dealing with CDDB titles.</para>
</sect2>

<sect2 id="autoopen">
<title><guilabel>Dialog Settings</guilabel></title>
<para>Put a check in the box if you want to automatically open up the
<guilabel>Title Dialog</guilabel> after adding a title via CDDB or Drag and Drop.</para>
</sect2>

</sect1>

<sect1 id="rp">
<title>Reports</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="pref_report.png"/></imageobject>
</mediaobject>

<sect2 id="order2">
<title><guilabel>Order</guilabel></title>
<para>Set default value for report order.</para>
</sect2>

<sect2 id="selection">
<title><guilabel>Selection</guilabel></title>
<para>Set default value for report selection.</para>
</sect2>

<sect2 id="daterange">
<title><guilabel>Date Range</guilabel></title>
<para>Set default date range for reports.</para>
</sect2>

<sect2 id="colors2">
<title><guilabel>Colors</guilabel></title>
<para>Set default report colors.</para>
</sect2>

<sect2 id="font2">
<title><guilabel>Font</guilabel></title>
<para>Set default font used in reports.</para>
</sect2>
</sect1>

<sect1 id="cddbp">
<title>CDDB</title>
<mediaobject>
<imageobject><imagedata format="PNG" fileref="pref_cddb.png"/></imageobject>
</mediaobject>

<sect2 id="cdparaonia">
<title><guilabel>CD Paranoia Settings</guilabel></title>

<sect3 id="pathtoparanoia">
<title>Path To cdparanoia</title>
<para>If you have cdparanoia installed in a non standard location, or it isn't in the path, put the path here.</para>
</sect3>

<sect3 id="readdevice">
<title>Read Device</title>
<para>The CD-ROM read device.</para>
</sect3>

</sect2>

<sect2 id="cddbserver">
<title><guilabel>CDDB Server Settings</guilabel></title>
<sect3 id="kscd">
<title>Check KSCD For Local CDDB First</title>
<para>Check here if you want KmusicdB to search KSCD for a local CDDB entry first.</para>
</sect3>
<sect3 id="cddbpserver">
<title>CDDBP Server And Port</title>
<para>Choose this option to use the standard CDDBP protocol for adding media to your collection. Enter the CDDB server and port information.</para>
</sect3>
<sect3 id="httpserver">
<title>HTTP Server, Port And CGI</title>
<para>Choose this option to use the HTTP CDDB protocol for adding media to your collection. Enter the CDDB server, port and CGI information.</para>
</sect3>
<sect3 id="proxyserver">
<title>Proxy Server And Port</title>
<para>Choose this option if you have a proxy server. HTTP CDDB must be correctly setup as well. Enter the Proxy server and port information.</para>
</sect3>
<sect3 id="smtpserver">
<title>SMTP Server And Port</title>
<para>Enter your SMTP email server host and port information.</para>
</sect3>
<sect3 id="cddbemail">
<title>Submit Entries To</title>
<para>The CDDB email address to submit entries to.</para>
</sect3>
<sect3 id="emailprofile">
<title>Email Profile</title>
<para>The email profile to pull your email information from.</para>
</sect3>

</sect2>

</sect1>

</chapter>

<chapter id="clo">
<title>Command Line Options</title>
<para>There are several command line options available to KmusicdB. The first list defines
default startup parameters, the rest define different functions the command line
provides.</para>

<para>Startup Options:</para>
<variablelist>

<varlistentry>
<term><userinput><command>-d</command>
<replaceable>dbname</replaceable></userinput></term>
<listitem><para>Specify a startup
database.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput><command>-h</command> <replaceable>host</replaceable></userinput></term>
<listitem><para>Specify a startup hostname.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput><command>-p</command>
<replaceable>port</replaceable></userinput></term>
<listitem><para>Specify a startup
port.</para></listitem> </varlistentry>

<varlistentry>
<term><userinput><command>-u</command>
<replaceable>username</replaceable></userinput></term>
<listitem><para>Specify a
startup username.</para></listitem> </varlistentry>

<varlistentry>
<term><userinput><command>-s</command>
<replaceable>password</replaceable></userinput></term>
<listitem><para>Specify a
startup password.</para></listitem> </varlistentry>

<varlistentry>
<term><userinput><command>-f</command>
<replaceable>filename</replaceable></userinput></term>
<listitem><para>Some startup
functions require a filename to be specified with this option.</para></listitem>
</varlistentry>

</variablelist>

<para>Functions:</para>
<variablelist>

<varlistentry>
<term><userinput><command>-c</command></userinput></term>
<listitem><para>Connect to database.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput><command>-b</command></userinput></term>
<listitem><para>Backup database. Requires
<userinput><command>-f</command></userinput>.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput><command>-r</command></userinput></term>
<listitem><para>Restore database. Requires
<userinput><command>-f</command></userinput>.</para></listitem>
</varlistentry>

<varlistentry>
<term><userinput><command>-t</command>
<replaceable>reporttype</replaceable></userinput></term>
<listitem><para>Run a report. Valid report types are
artist, collection, daterange, statistics, bte. Requires
<userinput><command>-f</command></userinput>.</para></listitem>
</varlistentry>

</variablelist>

</chapter>

<chapter id="dbnittygritty">
<title>Database Layout (0.93)</title>
<sect1 id="sequences">
<title>Sequences</title>
<para>CREATE SEQUENCE format_fid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE genre_gid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE label_lid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE method_mid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE type_tid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE artist_aid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE title_cdid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE track_trackid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE explore_eid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>CREATE SEQUENCE boxset_grpid_seq start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1;</para>
<para>SELECT SETVAL('boxset_grpid_seq',(SELECT MAX(grpid) FROM boxset));</para>
<para>SELECT SETVAL('format_fid_seq',(SELECT MAX(fid) FROM format));</para>
<para>SELECT SETVAL('genre_gid_seq',(SELECT MAX(gid) FROM genre));</para>
<para>SELECT SETVAL('label_lid_seq',(SELECT MAX(lid) FROM label));</para>
<para>SELECT SETVAL('method_mid_seq',(SELECT MAX(mid) FROM method));</para>
<para>SELECT SETVAL('type_tid_seq',(SELECT MAX(tid) FROM type));</para>
<para>SELECT SETVAL('boxset_grpid_seq',(SELECT MAX(grpid) FROM boxset));</para>
<para>SELECT SETVAL('explore_eid_seq',(SELECT MAX(eid) FROM explore));</para>
<para>SELECT SETVAL('artist_aid_seq',(SELECT MAX(aid) FROM artist));</para>
<para>SELECT SETVAL('title_cdid_seq',(SELECT MAX(cdid) FROM title));</para>
<para>SELECT SETVAL('track_trackid_seq',(SELECT MAX(trackid) FROM track));</para>
</sect1>
<sect1 id="fdblayout">
<title>format</title>
<para>"fid" integer DEFAULT nextval('format_fid_seq'::text) NOT NULL</para>
<para>"name" character varying(20) NOT NULL UNIQUE</para>
<para>Constraint "format_pkey" Primary Key ("fid")</para>
</sect1>
<sect1 id="gdblayout">
<title>genre</title>
<para>"gid" integer DEFAULT nextval('genre_gid_seq'::text) NOT NULL</para>
<para>"name" character varying(20) NOT NULL UNIQUE</para>
<para>Constraint "genre_pkey" Primary Key ("gid")</para>
</sect1>
<sect1 id="ldblayout">
<title>label</title>
<para>"lid" integer DEFAULT nextval('label_lid_seq'::text) NOT NULL</para>
<para>"name" character varying(20) NOT NULL UNIQUE</para>
<para>Constraint "label_pkey" Primary Key ("lid")</para>
</sect1>
<sect1 id="mdblayout">
<title>method</title>
<para>"mid" integer DEFAULT nextval('method_mid_seq'::text) NOT NULL</para>
<para>"name" character varying(20) NOT NULL UNIQUE</para>
<para>Constraint "method_pkey" Primary Key ("mid")</para>
</sect1>
<sect1 id="tdblayout">
<title>type</title>
<para>"tid" integer DEFAULT nextval('type_tid_seq'::text) NOT NULL</para>
<para>"name" character varying(20) NOT NULL UNIQUE</para>
<para>Constraint "type_pkey" Primary Key ("tid")</para>
</sect1>
<sect1 id="expdblayout">
<title>explore</title>
<para>"eid" integer DEFAULT nextval('explore_eid_seq'::text) NOT NULL</para>
<para>"name" character varying(40) NOT NULL UNIQUE</para>
<para>Constraint "explore_pkey" Primary Key ("eid")</para>
</sect1>
<sect1 id="boxdblayout">
<title>boxset</title>
<para>"grpid" integer DEFAULT nextval('boxset_grpid_seq'::text) NOT NULL</para>
<para>"name" character varying(40) NOT NULL UNIQUE</para>
<para>Constraint "boxset_pkey" Primary Key ("grpid")</para>
</sect1>
<sect1 id="verdblayout">
<title>version</title>
<para>"version" character varying(10)</para>
</sect1>
<sect1 id="artdblayout">
<title>artist</title>
<para>"aid" integer DEFAULT nextval('artist_aid_seq'::text) NOT NULL</para>
<para>"follow" boolean</para>
<para>"notes" character varying(2000)</para>
<para>"first" smallint</para>
<para>"last" smallint</para>
<para>"homepage" character varying(60)</para>
<para>"name" character varying(40) NOT NULL UNIQUE</para>
<para>Constraint "artist_pkey" Primary Key ("aid")</para>
</sect1>
<sect1 id="titdblayout">
<title>title</title>
<para>"cdid" integer DEFAULT nextval('title_cdid_seq'::text) NOT NULL</para>
<para>"aid" integer NOT NULL DEFAULT 1</para>
<para>"fid" integer NOT NULL DEFAULT 1</para>
<para>"gid" integer NOT NULL DEFAULT 1</para>
<para>"lid" integer NOT NULL DEFAULT 1</para>
<para>"mid" integer NOT NULL DEFAULT 1</para>
<para>"tid" integer NOT NULL DEFAULT 1</para>
<para>"yearstart" smallint</para>
<para>"yearend" smallint</para>
<para>"nod" smallint</para>
<para>"notracks" smallint</para>
<para>"name" character varying(55) NOT NULL</para>
<para>"collected" boolean</para>
<para>"cdlen" interval</para>
<para>"grpid" integer NOT NULL DEFAULT 1</para>
<para>"notes" character varying(2000)</para>
<para>"pic" character varying(65)</para>
<para>"rating" smallint</para>
<para>"quality" smallint</para>
<para>Constraint "title_pkey" Primary Key ("cdid")</para>
</sect1>
<sect1 id="tradblayout">
<title>track</title>
<para>"trackid" integer DEFAULT nextval('track_trackid_seq'::text) NOT NULL</para>
<para>"cdid" integer NOT NULL</para>
<para>"name" character varying(60) NOT NULL</para>
<para>"length" interval</para>
<para>Constraint "track_pkey" Primary Key ("trackid")</para>
</sect1>
<sect1 id="indexes">
<title>Indexes</title>
<para>CREATE INDEX ta_index ON title USING btree (aid);</para>
<para>CREATE INDEX ttr_index ON track USING btree (cdid);</para>
</sect1>
<sect1 id="ri">
<title>Referential Integrity</title>
<para>ALTER TABLE title ADD CONSTRAINT title_aid_RI FOREIGN KEY (aid) REFERENCES artist(aid) ON UPDATE CASCADE ON DELETE CASCADE;</para>
<para>ALTER TABLE title ADD CONSTRAINT title_fid_RI FOREIGN KEY (fid) REFERENCES format(fid) ON UPDATE CASCADE ON DELETE SET DEFAULT;</para>
<para>ALTER TABLE title ADD CONSTRAINT title_gid_RI FOREIGN KEY (gid) REFERENCES genre(gid) ON UPDATE CASCADE ON DELETE SET DEFAULT;</para>
<para>ALTER TABLE title ADD CONSTRAINT title_lid_RI FOREIGN KEY (lid) REFERENCES label(lid) ON UPDATE CASCADE ON DELETE SET DEFAULT;</para>
<para>ALTER TABLE title ADD CONSTRAINT title_mid_RI FOREIGN KEY (mid) REFERENCES method(mid) ON UPDATE CASCADE ON DELETE SET DEFAULT;</para>
<para>ALTER TABLE title ADD CONSTRAINT title_tid_RI FOREIGN KEY (tid) REFERENCES type(tid) ON UPDATE CASCADE ON DELETE SET DEFAULT;</para>
<para>ALTER TABLE title ADD CONSTRAINT title_grpid_RI FOREIGN KEY (grpid) REFERENCES boxset(grpid) ON UPDATE CASCADE ON DELETE SET DEFAULT;</para>
<para>ALTER TABLE track ADD CONSTRAINT track_cdid_RI FOREIGN KEY (cdid) REFERENCES title(cdid) ON UPDATE CASCADE ON DELETE CASCADE;</para>
</sect1>
</chapter>
</book>