2010-09-26 16:21:23 +02:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-09-26 16:21:23 +02:00
|
|
|
|
|
|
|
Clementine 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 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ULTIMATELYRICSREADER_H
|
|
|
|
#define ULTIMATELYRICSREADER_H
|
|
|
|
|
2010-10-10 18:09:20 +02:00
|
|
|
#include "ultimatelyricsprovider.h"
|
|
|
|
|
2010-09-26 16:21:23 +02:00
|
|
|
#include <QObject>
|
2010-09-27 19:27:08 +02:00
|
|
|
#include <QXmlStreamReader>
|
2010-09-26 16:21:23 +02:00
|
|
|
|
|
|
|
class QIODevice;
|
2013-07-10 20:00:52 +02:00
|
|
|
class QThread;
|
2010-09-26 16:21:23 +02:00
|
|
|
|
|
|
|
class UltimateLyricsReader : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2010-10-16 19:20:54 +02:00
|
|
|
UltimateLyricsReader(QObject* parent = 0);
|
2010-09-26 16:21:23 +02:00
|
|
|
|
2010-10-10 18:09:20 +02:00
|
|
|
QList<SongInfoProvider*> Parse(const QString& filename) const;
|
|
|
|
QList<SongInfoProvider*> ParseDevice(QIODevice* device) const;
|
2010-09-26 16:21:23 +02:00
|
|
|
|
2013-07-10 13:24:23 +02:00
|
|
|
void SetThread(QThread* thread);
|
|
|
|
|
2010-09-26 16:21:23 +02:00
|
|
|
private:
|
2010-10-10 18:09:20 +02:00
|
|
|
SongInfoProvider* ParseProvider(QXmlStreamReader* reader) const;
|
|
|
|
UltimateLyricsProvider::Rule ParseRule(QXmlStreamReader* reader) const;
|
2010-09-26 16:21:23 +02:00
|
|
|
QString ParseInvalidIndicator(QXmlStreamReader* reader) const;
|
2013-07-10 13:24:23 +02:00
|
|
|
|
|
|
|
QThread* thread_;
|
2010-09-26 16:21:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ULTIMATELYRICSREADER_H
|