1
/*****************************************************************************
2
* Copyright © 2012 John Maguire <john.maguire@gmail.com> *
3
* David Sansome <me@davidsansome.com> *
4
* This work is free. You can redistribute it and/or modify it under the *
5
* terms of the Do What The Fuck You Want To Public License, Version 2, *
6
* as published by Sam Hocevar. *
7
* See http://www.wtfpl.net/ for more details. *
8
*****************************************************************************/
13
#include <QFutureWatcher>
16
#include "musicbrainz/musicbrainzclient.h"
17
#include "musicbrainz/acoustidclient.h"
18
#include "trackinfoobject.h"
21
class TagFetcher : public QObject {
24
// High level interface to Fingerprinter, AcoustidClient and
28
TagFetcher(QObject* parent = 0);
30
void startFetch(const TrackPointer track);
36
void resultAvailable(const TrackPointer originalTrack,
37
const QList<TrackPointer>& tracksGuessed);
38
void fetchProgress(QString);
41
void fingerprintFound(int index);
42
void mbidFound(int index, const QString& mbid);
43
void tagsFetched(int index, const MusicBrainzClient::ResultList& result);
46
// has to be static so we can call it with QtConcurrent and have a nice
47
// responsive UI while the fingerprint is calculated
48
static QString getFingerprint(const TrackPointer tio);
50
QFutureWatcher<QString>* m_pFingerprintWatcher;
51
AcoustidClient m_AcoustidClient;
52
MusicBrainzClient m_MusicbrainzClient;
54
// Code can already be run on an arbitrary number of input tracks
55
QList<TrackPointer> m_tracks;
58
#endif // TAGFETCHER_H