diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch) | |
tree | 9047cf9e6b5c43878d5bf82660adae77ceee097a /juk/tagguesser.h | |
download | tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'juk/tagguesser.h')
-rw-r--r-- | juk/tagguesser.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/juk/tagguesser.h b/juk/tagguesser.h new file mode 100644 index 00000000..eb040a4b --- /dev/null +++ b/juk/tagguesser.h @@ -0,0 +1,74 @@ +/* + * tagguesser.h - (c) 2003 Frerich Raabe <raabe@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#ifndef TAGGUESSER_H +#define TAGGUESSER_H + +#include <qregexp.h> + +class FileNameScheme +{ + public: + typedef QValueList<FileNameScheme> List; + + FileNameScheme() { } + FileNameScheme(const QString &s); + + bool matches(const QString &s) const; + + QString title() const; + QString artist() const; + QString album() const; + QString track() const; + QString comment() const; + + private: + QString composeRegExp(const QString &s) const; + + mutable QRegExp m_regExp; + int m_titleField; + int m_artistField; + int m_albumField; + int m_trackField; + int m_commentField; +}; + +class TagGuesser +{ + public: + + enum Type { FileName = 0, MusicBrainz = 1 }; + + static QStringList schemeStrings(); + static void setSchemeStrings(const QStringList &schemes); + + TagGuesser(); + TagGuesser(const QString &absFileName); + + void guess(const QString &absFileName); + + QString title() const { return m_title; } + QString artist() const { return m_artist; } + QString album() const { return m_album; } + QString track() const { return m_track; } + QString comment() const { return m_comment; } + + private: + void loadSchemes(); + QString capitalizeWords(const QString &s); + + FileNameScheme::List m_schemes; + QString m_title; + QString m_artist; + QString m_album; + QString m_track; + QString m_comment; +}; + +#endif // TAGGUESSER_H +// vim:ts=4:sw=4:noet |