Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

MusicIndexGenerator Class Reference

#include <musicindexgenerator.h>

List of all members.

Public Slots

void createIndexes ()

Public Methods

 MusicIndexGenerator (const KURL &_base, QWidget *_parent, QString &_htmlTemplate, QString &_coverTemplate)
 MusicIndexGenerator (const KURL &_base, QWidget *_parent)
virtual ~MusicIndexGenerator ()
void createHTML ()
void createCover ()
void setCDName (const QString &_newVal)
const QString & getCDName ()
void setbase (const KURL &_newVal)
const KURL & getbase ()
QString dirName (const QString &path)
QString dirName (const KIO::UDSEntry &path)
bool isMusic (const QString &path)
bool isMusic (const KIO::UDSEntry &path)
void createText ()

Static Public Methods

QString baseName (const QString &path)

Public Attributes

bool userAccepted
bool dialogFinished
bool haveAllFilesInfo

Private Slots

void buildMusicListFase1 (KIO::Job *job, const KIO::UDSEntryList &list)
void buildMusicListFase2 (KIO::Job *job)
void prepareCDLayout ()
void createCoverStage2 (KIO::Job *)
void collectCoverFiles (KIO::Job *job, const KIO::UDSEntryList &list)
void updateFromDialog ()
void setDialogFinished ()
void createAll ()

Private Methods

void subConstructor (const KURL &_base, QString &_htmlTemplate, QString &_coverTemplate)
QString clean (QString s)
QString nicePlayingTime (unsigned long secs)
void userDialog ()
QStringList getSubItems (const QString &rel)
void infoBuilderFinished ()

Private Attributes

QString CDName
KURL base
MusicList musicList
FoldersInfo foldersInfo
QStringList fileNames
QString htmlTemplate
QString coverTemplate
QString root
QStringList coverFiles
QString coverTemplateDir
QString coverFilenameExtension
QString coverFolderTemplate
QString coverListFolderTemplate
QString coverListSongTemplate
DialogIndexerInfo * dialogIndexerInfo
QWidget * parent


Detailed Description

Many algorithms for HTML, XML, KWord, Text format MP3 CD index creation
Author:
Avi Alkalay


Constructor & Destructor Documentation

MusicIndexGenerator::MusicIndexGenerator const KURL &    _base,
QWidget *    _parent,
QString &    _htmlTemplate,
QString &    _coverTemplate
 

MusicIndexGenerator::MusicIndexGenerator const KURL &    _base,
QWidget *    _parent
 

virtual MusicIndexGenerator::~MusicIndexGenerator   [virtual]
 


Member Function Documentation

void MusicIndexGenerator::createHTML  
 

Create the nice HTML index

void MusicIndexGenerator::createCover  
 

Create the KWord document with full music files listing to be printed and used as CD cover. Additionally, runs KWord to let the user make final adjustements and generate PDF.

void MusicIndexGenerator::setCDName const QString &    _newVal
 

Write property of QString CDName.

const QString& MusicIndexGenerator::getCDName  
 

Read property of QString CDName.

void MusicIndexGenerator::setbase const KURL &    _newVal
 

Write property of KURL base.

const KURL& MusicIndexGenerator::getbase  
 

Read property of KURL base.

QString MusicIndexGenerator::baseName const QString &    path [static]
 

Returns the basename of a full path, similar to the basename(1) unix command.

baseName("/dir1/dir2/file.txt") == "file.txt"

QString MusicIndexGenerator::dirName const QString &    path
 

Returns the dirname of a full path, similar to the dirname(1) unix command.

dirName("/dir1/dir2/file.txt") == "/dir1/dir2"

QString MusicIndexGenerator::dirName const KIO::UDSEntry &    path
 

bool MusicIndexGenerator::isMusic const QString &    path
 

bool MusicIndexGenerator::isMusic const KIO::UDSEntry &    path
 

void MusicIndexGenerator::createText  
 

Create the text indexes in info/ folder

collections.txt: Only the folder names musicdb.txt: Full music files listing with file size, duration and quality music.txt: Almost human readable listing of files per folder

void MusicIndexGenerator::subConstructor const KURL &    _base,
QString &    _htmlTemplate,
QString &    _coverTemplate
[private]
 

The real constructor. All other constructors actually call this method

QString MusicIndexGenerator::clean QString    s [private]
 

Cleans a raw filename to a nicer representations, substituting _s to spaces, "/" to " :: ", removing file extensions, etc

QString MusicIndexGenerator::nicePlayingTime unsigned long    secs [private]
 

Returns the string for the playing time represented as hh:mm:ss

void MusicIndexGenerator::userDialog   [private]
 

Details of creating the user supplied info dialog.

QStringList MusicIndexGenerator::getSubItems const QString &    rel [private]
 

Return the list of all resources inside the rel directories. Same functionality as KStandardDirs::findAllResources, but didn't worked for a konqueror plugin.

void MusicIndexGenerator::infoBuilderFinished   [private]
 

Called when all files info was retrieved, and now we are ready to generate indexes.

void MusicIndexGenerator::buildMusicListFase1 KIO::Job *    job,
const KIO::UDSEntryList &    list
[private, slot]
 

Called after each sub-folder list job finishes. It will build the musicList and folderList vars.

void MusicIndexGenerator::buildMusicListFase2 KIO::Job *    job [private, slot]
 

void MusicIndexGenerator::prepareCDLayout   [private, slot]
 

Given a folder, will create all necessary static files for a nice CD. Like images, the basic diretories resource and info, CD icon, Windows autorun.inf, etc

void MusicIndexGenerator::createCoverStage2 KIO::Job *    [private, slot]
 

Second stage of the cover creation. Will be called after the template copy job finishes.

void MusicIndexGenerator::collectCoverFiles KIO::Job *    job,
const KIO::UDSEntryList &    list
[private, slot]
 

void MusicIndexGenerator::updateFromDialog   [private, slot]
 

Called when the user accepts the DialogIndexerInfo. Will update some internal vars to correctly generate the indexes.

void MusicIndexGenerator::setDialogFinished   [private, slot]
 

Called when the user finished interacting the the dialog.

void MusicIndexGenerator::createAll   [private, slot]
 

The starting point to create all music indexes, prepare CD layout, and destructors.

void MusicIndexGenerator::createIndexes   [slot]
 

Encapsulates all index files creation methods


Member Data Documentation

QString MusicIndexGenerator::CDName [private]
 

The CD title, to be used in cover, HTML, etc

KURL MusicIndexGenerator::base [private]
 

The base folder we'll index

MusicList MusicIndexGenerator::musicList [private]
 

Holds a list of all MP3/Ogg files in a subdirectory

FoldersInfo MusicIndexGenerator::foldersInfo [private]
 

Holds the folders statistical info

QStringList MusicIndexGenerator::fileNames [private]
 

An internal filenames list, used in the process of creating the complex structure for the indexes.

QString MusicIndexGenerator::htmlTemplate [private]
 

Name of the template to use for the HTML index

QString MusicIndexGenerator::coverTemplate [private]
 

Name of the template to use for the CD cover

QString MusicIndexGenerator::root [private]
 

A string representation of the CD root directory.

QStringList MusicIndexGenerator::coverFiles [private]
 

The list of template files that instegrates the KWord file for the cover.

QString MusicIndexGenerator::coverTemplateDir [private]
 

Point the the template dir we'll use for the cover

QString MusicIndexGenerator::coverFilenameExtension [private]
 

The cover filename extension. Since KOffice and OpenOffice docs are all zip files, the template-based cover-generation engine is the same, so we need the filename extension to generate a correct filename, based on the template.

QString MusicIndexGenerator::coverFolderTemplate [private]
 

A KWord template for a table of contents entry

QString MusicIndexGenerator::coverListFolderTemplate [private]
 

A KWord template for a folder entry in the long song list

QString MusicIndexGenerator::coverListSongTemplate [private]
 

A KWord template for a song entry in the long song list

DialogIndexerInfo* MusicIndexGenerator::dialogIndexerInfo [private]
 

The dialog to ask user some questions regarding how to build the indexes.

QWidget* MusicIndexGenerator::parent [private]
 

bool MusicIndexGenerator::userAccepted
 

True if the user clicked OK in the dialog.

bool MusicIndexGenerator::dialogFinished
 

True if user finished to interact with the dialog.

bool MusicIndexGenerator::haveAllFilesInfo
 

True if all music files info-gathering engines are over.


The documentation for this class was generated from the following file:
Generated on Sat Jul 26 08:03:49 2003 for MusicMan by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002