PageRenderTime 42ms CodeModel.GetById 20ms app.highlight 3ms RepoModel.GetById 17ms app.codeStats 0ms

/src/libtomahawk/database/DatabaseResolver.h

http://github.com/tomahawk-player/tomahawk
C Header | 52 lines | 25 code | 10 blank | 17 comment | 0 complexity | 7751bed6c9202ea2ca7829cf84d53319 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 *
 5 *   Tomahawk is free software: you can redistribute it and/or modify
 6 *   it under the terms of the GNU General Public License as published by
 7 *   the Free Software Foundation, either version 3 of the License, or
 8 *   (at your option) any later version.
 9 *
10 *   Tomahawk is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef DATABASERESOLVER_H
20#define DATABASERESOLVER_H
21
22#include "resolvers/Resolver.h"
23#include "Result.h"
24#include "Artist.h"
25#include "Album.h"
26
27#include "DllMacro.h"
28
29class DLLEXPORT DatabaseResolver : public Tomahawk::Resolver
30{
31Q_OBJECT
32
33public:
34    explicit DatabaseResolver( int weight );
35
36    QString name() const override;
37    virtual unsigned int weight() const override{ return m_weight; }
38    virtual unsigned int timeout() const override{ return 0; }
39
40public slots:
41    virtual void resolve( const Tomahawk::query_ptr& query ) override;
42
43private slots:
44    void gotResults( const Tomahawk::QID qid, QList< Tomahawk::result_ptr> results );
45    void gotAlbums( const Tomahawk::QID qid, QList< Tomahawk::album_ptr> albums );
46    void gotArtists( const Tomahawk::QID qid, QList< Tomahawk::artist_ptr> artists );
47
48private:
49    int m_weight;
50};
51
52#endif // DATABASERESOLVER_H