~sebastien-amardeilh/yarock/trunk

« back to all changes in this revision

Viewing changes to src3party/libechonest/CatalogItem.h

  • Committer: sebastien-amardeilh
  • Date: 2014-03-02 08:23:30 UTC
  • Revision ID: sebastien-amardeilh@gmail.com-20140302082330-71utrfssybo3gx11
remove Echonest library

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************************
2
 
  * Copyright (c) 2010 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_CATALOG_ITEM_H
18
 
#define ECHONEST_CATALOG_ITEM_H
19
 
 
20
 
#include "CatalogUpdateEntry.h"
21
 
#include "echonest_export.h"
22
 
#include "Util.h"
23
 
 
24
 
#include <QMetaType>
25
 
#include <QSharedPointer>
26
 
#include <QDateTime>
27
 
 
28
 
class CatalogItemData;
29
 
 
30
 
namespace Echonest {
31
 
    
32
 
/**
33
 
* Since catalog items can be artists or songs, and we don't know sometimes until after we parse them,
34
 
*  but we need to gather a list of them. A poor man's traits class? A rich man's interface? Far from either.
35
 
*/
36
 
 
37
 
class ECHONEST_EXPORT CatalogItem
38
 
{
39
 
public:
40
 
    CatalogItem();
41
 
    CatalogItem( const CatalogItem& other );
42
 
    CatalogItem& operator=( const CatalogItem& other );
43
 
    virtual ~CatalogItem();
44
 
    
45
 
    /**
46
 
     * The type of this item.
47
 
     */
48
 
    virtual Echonest::CatalogTypes::Type type() const = 0;    
49
 
    
50
 
    /**
51
 
     * The foreign id of this item in the catalog. e.g. CAOFUDS12BB066268E:artist:ARUI8651187B9ACF52
52
 
     * 
53
 
     * See The Echo Nest API docs for more information.
54
 
     */
55
 
    QByteArray foreignId() const;
56
 
    void setForeignId( const QByteArray& id );
57
 
    
58
 
    /**
59
 
     * The request that generated this catalog item
60
 
     */
61
 
    CatalogUpdateEntry request() const;
62
 
    void setRequest( const CatalogUpdateEntry& request );
63
 
        
64
 
    /**
65
 
     * The date and time when this item was added to the catalog
66
 
     */
67
 
    QDateTime dateAdded() const;
68
 
    void setDateAdded( const QDateTime& dt );
69
 
    
70
 
    /**
71
 
     * The rating of this item.
72
 
     */
73
 
    int rating() const;
74
 
    void setRating( int rating );
75
 
    
76
 
    /**
77
 
     * The play count of this item.
78
 
     */
79
 
    int playCount() const;
80
 
    void setPlayCount( int count );
81
 
    
82
 
protected:
83
 
    QSharedPointer<CatalogItemData> dd;
84
 
};
85
 
 
86
 
typedef QVector< CatalogItem > CatalogItems;
87
 
}
88
 
 
89
 
 
90
 
#endif