File indexing completed on 2024-04-21 04:47:50

0001 /***************************************************************************************
0002 * Copyright (c) 2009 Dan Meltzer <parallelgrapefruit@gmail.com>                        *
0003 *                                                                                      *
0004 * This program is free software; you can redistribute it and/or modify it under        *
0005 * the terms of the GNU General Public License as published by the Free Software        *
0006 * Foundation; either version 2 of the License, or (at your option) any later           *
0007 * version.                                                                             *
0008 *                                                                                      *
0009 * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011 * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012 *                                                                                      *
0013 * You should have received a copy of the GNU General Public License along with         *
0014 * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015 ****************************************************************************************/
0016 
0017 
0018 #ifndef LASTFMREADLABELCAPABILITY_H
0019 #define LASTFMREADLABELCAPABILITY_H
0020 
0021 #include "core/meta/forward_declarations.h"
0022 #include "core/capabilities/Capability.h"
0023 #include "core/capabilities/ReadLabelCapability.h"
0024 
0025 #include <QStringList>
0026 
0027 class QNetworkReply;
0028 
0029 namespace Capabilities
0030 {
0031 
0032 class LastfmReadLabelCapability : public Capabilities::ReadLabelCapability
0033 {
0034     Q_OBJECT
0035     public:
0036         explicit LastfmReadLabelCapability( Meta::Track *track );
0037         void fetchLabels() override;
0038         void fetchGlobalLabels() override;
0039         QStringList labels() override;
0040 
0041     private:
0042         QStringList m_labels;
0043         Meta::TrackPtr m_track;
0044         QNetworkReply *m_job;
0045 
0046     private Q_SLOTS:
0047         void onTagsFetched();
0048 };
0049 }
0050 
0051 #endif // LASTFMREADLABELCAPABILITY_H