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

musicindexgenerator.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           musicindexgenerator.h  -  description
00003                              -------------------
00004     begin                : Sun Jun 1 2003
00005     copyright            : (C) 2003 by Avi Alkalay
00006     email                : avi@unix.sh
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef MUSICINDEXGENERATOR_H
00019 #define MUSICINDEXGENERATOR_H
00020 
00021 #include <qstring.h>
00022 #include <kurl.h>
00023 #include <kio/jobclasses.h>
00024 #include <qdict.h>
00025 #include <kfileitem.h>
00026 #include "musicfolderinfo.h"
00027 
00028 typedef QMap<QString,KFileItemList> MusicList;
00029 typedef QMap<QString,MusicFolderInfo> FoldersInfo;
00030 class DialogIndexerInfo;
00031 
00036 class MusicIndexGenerator : public QObject {
00037     Q_OBJECT
00038 public: 
00039     MusicIndexGenerator(const KURL &_base, QWidget *_parent, QString &_htmlTemplate, QString &_coverTemplate);
00040     MusicIndexGenerator(const KURL &_base, QWidget *_parent);
00041     virtual ~MusicIndexGenerator();
00043     void createHTML();
00045     void createCover();
00047     void setCDName( const QString& _newVal);
00049     const QString& getCDName();
00051     void setbase( const KURL& _newVal);
00053     const KURL& getbase();
00057     static QString baseName(const QString &path);
00058 
00062     QString dirName(const QString &path);
00063     QString dirName(const KIO::UDSEntry &path);
00064 
00065     bool isMusic(const QString &path);
00066     bool isMusic(const KIO::UDSEntry &path);
00067 
00068 
00075     void createText();
00076   
00077 private:
00079     void subConstructor(const KURL &_base, QString &_htmlTemplate, QString &_coverTemplate);
00081     QString clean(QString s);
00083     QString nicePlayingTime(unsigned long secs);
00085     void userDialog();
00087     QStringList getSubItems(const QString &rel);
00088 
00090     void infoBuilderFinished();
00091 
00093     QString CDName;
00094 
00096     KURL base;
00097 
00099     MusicList musicList;
00100 
00102     FoldersInfo foldersInfo;
00103   
00105     QStringList fileNames;
00106 
00108     QString htmlTemplate;
00109 
00111     QString coverTemplate;
00112 
00114     QString root;
00115 
00117     QStringList coverFiles;
00118 
00120     QString coverTemplateDir;
00121 
00126     QString coverFilenameExtension;
00127 
00129     QString coverFolderTemplate;
00130 
00132     QString coverListFolderTemplate;
00133 
00135     QString coverListSongTemplate;
00136 
00138     DialogIndexerInfo * dialogIndexerInfo;
00139 
00140     QWidget * parent;
00141 
00142 private slots: // Private slots
00144     void buildMusicListFase1(KIO::Job *job,const KIO::UDSEntryList &list);
00145     void buildMusicListFase2(KIO::Job *job);
00146 
00148     void prepareCDLayout();
00149 
00151     void createCoverStage2(KIO::Job *);
00152 
00153     void collectCoverFiles(KIO::Job *job,const KIO::UDSEntryList &list);
00155     void updateFromDialog();
00157     void setDialogFinished();
00159     void createAll();
00160 
00161 signals: // Signals
00162 
00163 public slots: // Public slots
00165     void createIndexes();
00166 
00167 public: // Public attributes
00169     bool userAccepted;
00170 
00172     bool dialogFinished;
00173 
00175     bool haveAllFilesInfo;
00176 };
00177 
00178 #endif

Generated on Sat Jul 26 08:03:49 2003 for MusicMan by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002