~ubuntu-branches/ubuntu/trusty/tomahawk/trusty-proposed

« back to all changes in this revision

Viewing changes to src/libtomahawk/utils/ItunesParser.h

  • Committer: Package Import Robot
  • Author(s): Harald Sitter
  • Date: 2013-03-07 21:50:13 UTC
  • Revision ID: package-import@ubuntu.com-20130307215013-6gdjkdds7i9uenvs
Tags: upstream-0.6.0+dfsg
Import upstream version 0.6.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 
2
 *
 
3
 *   Written by Hugo Lindström <hugolm84@gmail.com>
 
4
 *   But based on Leo Franchi's work from spotifyParser
 
5
 *   Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
 
6
 *
 
7
 *   Tomahawk is free software: you can redistribute it and/or modify
 
8
 *   it under the terms of the GNU General Public License as published by
 
9
 *   the Free Software Foundation, either version 3 of the License, or
 
10
 *   (at your option) any later version.
 
11
 *
 
12
 *   Tomahawk is distributed in the hope that it will be useful,
 
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
15
 *   GNU General Public License for more details.
 
16
 *
 
17
 *   You should have received a copy of the GNU General Public License
 
18
 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
#ifndef ITUNES_PARSER_H
 
22
#define ITUNES_PARSER_H
 
23
 
 
24
#include "DllMacro.h"
 
25
#include "Typedefs.h"
 
26
#include "Query.h"
 
27
#include "DropJobNotifier.h"
 
28
 
 
29
#include <QObject>
 
30
#include <QSet>
 
31
#include <QtCore/QStringList>
 
32
 
 
33
class NetworkReply;
 
34
class TrackModel;
 
35
 
 
36
namespace Tomahawk
 
37
{
 
38
 
 
39
/**
 
40
 * Small class to parse itunes links into query_ptrs
 
41
 *
 
42
 * Connect to the signals to get the results
 
43
 */
 
44
class DLLEXPORT ItunesParser : public QObject
 
45
{
 
46
    Q_OBJECT
 
47
public:
 
48
    explicit ItunesParser( const QString& trackUrl, QObject* parent = 0 );
 
49
    explicit ItunesParser( const QStringList& trackUrls, QObject* parent = 0 );
 
50
    virtual ~ItunesParser();
 
51
 
 
52
signals:
 
53
    void track( const Tomahawk::query_ptr& track );
 
54
    void tracks( const QList< Tomahawk::query_ptr > tracks );
 
55
 
 
56
private slots:
 
57
    void itunesResponseLookupFinished();
 
58
 
 
59
private:
 
60
    QPixmap pixmap() const;
 
61
    void lookupItunesUri( const QString& track );
 
62
    void checkTrackFinished();
 
63
 
 
64
    bool m_single;
 
65
    QList< query_ptr > m_tracks;
 
66
    QSet< NetworkReply* > m_queries;
 
67
    QString m_title, m_info, m_creator;
 
68
    Tomahawk::playlist_ptr m_playlist;
 
69
 
 
70
    DropJobNotifier* m_browseJob;
 
71
    static QPixmap* s_pixmap;
 
72
};
 
73
 
 
74
}
 
75
 
 
76
#endif