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

musicfilenamelayout.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           musicfilenamelayout.h  -  description
00003                              -------------------
00004     begin                : Fri May 30 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 MUSICFILENAMELAYOUT_H
00019 #define MUSICFILENAMELAYOUT_H
00020 
00021 class QString;
00022 class QRegExp;
00023 class MusicInfo;
00024 
00025 #include <qvaluelist.h>
00026 
00027 
00035 class MusicFilenameLayout {
00036     public: 
00037         MusicFilenameLayout(QString _name, QRegExp _exp,int _artistPos=-1, int _albumPos=-1, int _trackPos=-1, int _titlePos=-1);
00038         MusicFilenameLayout(QString _name, QString _exp, bool minimal=false,int _artistPos=-1, int _albumPos=-1, int _trackPos=-1, int _titlePos=-1);
00039         MusicFilenameLayout();
00040         ~MusicFilenameLayout();
00045         bool match(const QString &filename);
00046 
00047         
00048 
00054         MusicInfo getInfo(const QString &filename);
00055 
00056 
00059         static QString toggleUnderscore(const QString &filename,bool underscore=false);
00060 
00066         static bool normalize(QString &filename);
00067 
00068     public: // Public attributes
00070         QString name;
00071 
00072 
00074         int trackPos,titlePos,artistPos,albumPos;
00075 
00076 
00077     private: // Private attributes
00079         QRegExp regexp;
00080 
00081         
00083         static QString extensions;
00084 
00086         void addExtensions();
00087 };
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 class FilenameMiner : public QValueList<MusicFilenameLayout> {
00097     public:
00098         FilenameMiner();
00099         ~FilenameMiner();
00100         bool match(const QString &filename);
00101         MusicInfo mine(const QString &filename);
00103   QStringList getLayouts();
00104 private: // Private methods
00106   void initLayouts();
00107 };
00108 
00109 #endif

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