Not crap after all...
[amarok.git] / src / tagguesser.h
blobceb4b1eca615b7abd2802b5cf5fa5bbc3577e4d6
1 // (c) 2005 Alexandre Pereira de Oliveira <aleprj@gmail.com>
2 // (c) 2003 Frerich Raabe <raabe@kde.org>
3 // See COPYING file for licensing information.
5 #ifndef TAGGUESSER_H
6 #define TAGGUESSER_H
8 #include <QRegExp>
9 //Added by qt3to4:
10 #include <Q3ValueList>
12 class FileNameScheme
14 public:
15 typedef Q3ValueList<FileNameScheme> List;
17 FileNameScheme() { }
18 FileNameScheme( const QString &s );
20 bool matches( const QString &s ) const;
22 QString title() const;
23 QString artist() const;
24 QString album() const;
25 QString track() const;
26 QString comment() const;
27 QString year() const;
28 QString composer() const;
29 QString genre() const;
31 QString pattern() const { return m_cod; };
33 private:
34 QString composeRegExp( const QString &s ) const;
35 QString m_cod;
37 mutable QRegExp m_regExp;
39 int m_titleField;
40 int m_artistField;
41 int m_albumField;
42 int m_trackField;
43 int m_commentField;
44 int m_yearField;
45 int m_composerField;
46 int m_genreField;
49 class TagGuesser
51 public:
53 enum Type { FileName = 0, MusicBrainz = 1 };
55 static QStringList schemeStrings();
56 static void setSchemeStrings( const QStringList &schemes );
58 TagGuesser();
59 TagGuesser( const QString &absFileName );
61 void guess( const QString &absFileName );
63 QString title() const { return m_title; }
64 QString artist() const { return m_artist; }
65 QString album() const { return m_album; }
66 QString track() const { return m_track; }
67 QString comment() const { return m_comment; }
68 QString year() const { return m_year; }
69 QString composer() const { return m_composer; }
70 QString genre() const { return m_genre; }
72 private:
73 void loadSchemes();
74 QString capitalizeWords( const QString &s );
76 FileNameScheme::List m_schemes;
77 QString m_title;
78 QString m_artist;
79 QString m_album;
80 QString m_track;
81 QString m_comment;
82 QString m_year;
83 QString m_composer;
84 QString m_genre;
87 #endif /* TAGGUESSER_H */