PageRenderTime 203ms CodeModel.GetById 161ms app.highlight 5ms RepoModel.GetById 35ms app.codeStats 0ms

/src/libtomahawk/playlist/AlbumModel.h

http://github.com/tomahawk-player/tomahawk
C Header | 68 lines | 34 code | 16 blank | 18 comment | 0 complexity | 9dc2ef857bd78a306a3c88abd25cd8b6 MD5 | raw file
 1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 2 *
 3 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
 4 *   Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
 5 *
 6 *   Tomahawk is free software: you can redistribute it and/or modify
 7 *   it under the terms of the GNU General Public License as published by
 8 *   the Free Software Foundation, either version 3 of the License, or
 9 *   (at your option) any later version.
10 *
11 *   Tomahawk is distributed in the hope that it will be useful,
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *   GNU General Public License for more details.
15 *
16 *   You should have received a copy of the GNU General Public License
17 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef ALBUMMODEL_H
21#define ALBUMMODEL_H
22
23#include <QPixmap>
24
25#include "Album.h"
26#include "PlaylistInterface.h"
27#include "database/DatabaseCommand_AllAlbums.h"
28#include "PlayableModel.h"
29
30#include "DllMacro.h"
31
32class PlayableItem;
33class QMetaData;
34
35class DLLEXPORT AlbumModel : public PlayableModel
36{
37Q_OBJECT
38
39public:
40    explicit AlbumModel( QObject* parent = 0 );
41    virtual ~AlbumModel();
42
43    Tomahawk::collection_ptr collection() const { return m_collection; }
44
45    void addCollection( const Tomahawk::collection_ptr& collection, bool overwrite = false );
46    void addFilteredCollection( const Tomahawk::collection_ptr& collection, unsigned int amount, Tomahawk::DatabaseCommand_AllAlbums::SortOrder order, bool overwrite = false );
47
48    PlayableItem* findItem( const Tomahawk::artist_ptr& artist ) const;
49    PlayableItem* findItem( const Tomahawk::album_ptr& album ) const;
50
51public slots:
52    void addAlbums( const QList<Tomahawk::album_ptr>& albums );
53    void addArtists( const QList<Tomahawk::artist_ptr>& artists );
54    void addQueries( const QList<Tomahawk::query_ptr>& queries );
55
56signals:
57
58private slots:
59    void onSourceAdded( const Tomahawk::source_ptr& source );
60    void onCollectionChanged();
61
62private:
63    bool m_overwriteOnAdd;
64
65    Tomahawk::collection_ptr m_collection;
66};
67
68#endif // ALBUMMODEL_H