File indexing completed on 2021-12-21 13:33:28

0001 /*
0002  * Kscd - A simple cd player for the KDE Project
0003  *
0004  * Copyright (c) 1997 Bernd Johannes wuebben@math.cornell.edu
0005  * Copyright (c) 2002-2003 Aaron J. Seigo <aseigo@kde.org>
0006  * Copyright (c) 2004 Alexander Kern <alex.kern@gmx.de>
0007  * Copyright (c) 2003-2006 Richard Lärkäng <nouseforaname@home.se>
0008  *
0009  * --------------
0010  * ISI KsCD Team :
0011  * --------------
0012  * Stanislas KRZYWDA <stanislas.krzywda@gmail.com>
0013  * Sovanramy Var <mastasushi@gmail.com>
0014  * Bouchikhi Mohamed-Amine <bouchikhi.amine@gmail.com>
0015  * Gastellu Sylvain<sylvain.gastellu@gmail.com>
0016  * -----------------------------------------------------------------------------
0017  *
0018  * This program is free software; you can redistribute it and/or modify
0019  * it under the terms of the GNU General Public License as published by
0020  * the Free Software Foundation; either version 2, or (at your option)
0021  * any later version.
0022  *
0023  * This program is distributed in the hope that it will be useful,
0024  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0025  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0026  * GNU General Public License for more details.
0027  *
0028  * You should have received a copy of the GNU General Public License
0029  * along with this program; if not, write to the Free Software
0030  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0031  *
0032  */
0033 
0034 #ifndef MBMANAGER_H
0035 #define MBMANAGER_H
0036 
0037 // KDE includes
0038 #include <kdebug.h>
0039 #include <klocalizedstring.h>
0040 
0041 // QT includes
0042 #include <qstring.h>
0043 #include <qlist.h>
0044 
0045 // musicbrainz discid
0046 #include <discid/discid.h>
0047 
0048 struct DiscInfo
0049 {
0050     QString Title;
0051     QString Artist;
0052 };
0053 
0054 struct MBTrackInfo
0055 {
0056     QString Title;
0057     QString Artist;
0058     int Duration; // in milliseconds
0059 };
0060 
0061 class MBManager : public QObject
0062 {
0063     Q_OBJECT
0064 
0065 private:
0066     DiscInfo m_discInfo;                /// Contains the album's information
0067     QList <MBTrackInfo> m_trackList;    /// List of tracks information
0068 
0069     bool m_validInfo;                   /// Tells whether the lookup query succeeded
0070     DiscId *m_discid;
0071 
0072 public:
0073     MBManager();
0074     ~MBManager();
0075 
0076 /**
0077 * Getters/Setters
0078 */
0079     /** Returns the disc information */
0080     DiscInfo getDiscInfo() const { return this->m_discInfo; }
0081     QList <MBTrackInfo> getTrackList() const { return this->m_trackList; }
0082     bool isValidInfo() const { return this->m_validInfo; }
0083 
0084 public slots:
0085     /** Gets information about the disc inserted */
0086     void discLookup(const QString& device);
0087 
0088     /** Uploads information */
0089     void discUpload(const QString& device=QString());
0090 
0091 signals:
0092     void showArtistLabel(QString&);
0093 
0094     void discLookupFinished();
0095 };
0096 
0097 #endif
0098