1 /**************************************************************************************** 2 * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org> * 3 * * 4 * This program is free software; you can redistribute it and/or modify it under * 5 * the terms of the GNU General Public License as published by the Free Software * 6 * Foundation; either version 2 of the License, or (at your option) any later * 7 * version. * 8 * * 9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 11 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 12 * * 13 * You should have received a copy of the GNU General Public License along with * 14 * this program. If not, see <http://www.gnu.org/licenses/>. * 15 ****************************************************************************************/ 16 17 #ifndef ECHONEST_SONG_P_H 18 #define ECHONEST_SONG_P_H 19 20 #include "Track.h" 21 #include "AudioSummary.h" 22 23 #include <QSharedData> 24 #include <QString> 25 #include <QVector> 26 27 28 class SongData : public QSharedData 29 { 30 public: SongData()31 SongData() : hotttnesss( -1 ), artistHotttnesss( -1 ), artistFamiliarity( -1 ) { artistLocation.latitude = -1; artistLocation.longitude = -1; } 32 SongData(const SongData & other)33 SongData(const SongData& other) : QSharedData( other ) 34 { 35 id = other.id; 36 title = other.title; 37 artistName = other.artistName; 38 artistId = other.artistId; 39 40 audioSummary = other.audioSummary; 41 tracks = other.tracks; 42 hotttnesss = other.hotttnesss; 43 artistHotttnesss = other.artistHotttnesss; 44 artistFamiliarity = other.artistFamiliarity; 45 artistLocation = other.artistLocation; 46 songTypes = other.songTypes; 47 } 48 ~SongData()49 ~SongData() {} 50 51 QByteArray id; 52 QString title; 53 QString artistName; 54 QByteArray artistId; 55 QString release; 56 57 // The rest are optional that require manual fetching to populate 58 Echonest::AudioSummary audioSummary; 59 QVector<Echonest::Track> tracks; 60 qreal hotttnesss; 61 qreal artistHotttnesss; 62 qreal artistFamiliarity; 63 Echonest::ArtistLocation artistLocation; 64 QList<QString> songTypes; 65 66 }; 67 68 #endif 69