1 /*
2  * Cantata
3  *
4  * Copyright (c) 2011-2020 Craig Drummond <craig.p.drummond@gmail.com>
5  *
6  * ----
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; see the file COPYING.  If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef CANTATA_CDDB_H
25 #define CANTATA_CDDB_H
26 
27 #include <QObject>
28 #include <QString>
29 #include "config.h"
30 #include "cdalbum.h"
31 
32 class Thread;
33 typedef struct cddb_disc_s cddb_disc_t;
34 
35 class CddbInterface : public QObject
36 {
37     Q_OBJECT
38 
39 public:
40     static QString dataTrack();
41 
42     CddbInterface(const QString &device);
43     ~CddbInterface();
44 
45 public Q_SLOTS:
46     void lookup(bool full);
47 
48 Q_SIGNALS:
49     void error(const QString &error);
50     void initialDetails(const CdAlbum &);
51     void matches(const QList<CdAlbum> &);
52 
53 private:
54     void readDisc();
55     bool checkConnection();
56 
57 private:
58     Thread *thread;
59     QString dev;
60     cddb_disc_t *disc;
61     CdAlbum initial;
62 };
63 
64 #endif
65 
66