3 This file is part of Minitube.
4 Copyright 2009, Flavio Tordini <flavio.tordini@gmail.com>
6 Minitube 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.
11 Minitube 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.
16 You should have received a copy of the GNU General Public License
17 along with Minitube. If not, see <http://www.gnu.org/licenses/>.
29 class Video : public QObject {
37 enum License { LicenseYouTube = 1, LicenseCC };
40 const QString &getTitle() const { return title; }
41 void setTitle(const QString &value) { title = value; }
43 const QString &getDescription() const { return description; }
44 void setDescription(const QString &value) { description = value; }
46 const QString &getChannelTitle() const { return channelTitle; }
47 void setChannelTitle(const QString &value) { channelTitle = value; }
49 const QString &getChannelId() const { return channelId; }
50 void setChannelId(const QString &value) { channelId = value; }
52 const QString &getWebpage();
53 void setWebpage(const QString &value);
56 const QPixmap &getThumbnail() const { return thumbnail; }
58 const QString &getThumbnailUrl() const { return thumbnailUrl; }
59 void setThumbnailUrl(const QString &value) { thumbnailUrl = value; }
61 const QString &getMediumThumbnailUrl() const { return mediumThumbnailUrl; }
62 void setMediumThumbnailUrl(const QString &value) { mediumThumbnailUrl = value; }
64 const QString &getLargeThumbnailUrl() const { return largeThumbnailUrl; }
65 void setLargeThumbnailUrl(const QString &value) { largeThumbnailUrl = value; }
67 int getDuration() const { return duration; }
68 void setDuration(int value);
69 const QString &getFormattedDuration() const { return formattedDuration; }
71 int getViewCount() const { return viewCount; }
72 void setViewCount(int value) { viewCount = value; }
74 const QDateTime &getPublished() const { return published; }
75 void setPublished(const QDateTime &value);
76 const QString &getFormattedPublished() const { return formattedPublished; }
78 int getDefinitionCode() const { return definitionCode; }
81 const QUrl &getStreamUrl() { return streamUrl; }
83 const QString &getId() const { return id; }
84 void setId(const QString &value) { id = value; }
86 License getLicense() const { return license; }
87 void setLicense(License value) { license = value; }
91 void gotMediumThumbnail(const QByteArray &bytes);
92 void gotLargeThumbnail(const QByteArray &bytes);
93 void gotStreamUrl(const QUrl &streamUrl);
94 void errorStreamUrl(const QString &message);
97 void setThumbnail(const QByteArray &bytes);
98 void streamUrlLoaded(const QUrl &streamUrl);
103 QString channelTitle;
108 QString thumbnailUrl;
109 QString mediumThumbnailUrl;
110 QString largeThumbnailUrl;
112 QString formattedDuration;
115 QString formattedPublished;
121 bool loadingThumbnail;
126 // This is required in order to use QPointer<Video> as a QVariant
127 // as used by the Model/View playlist
128 typedef QPointer<Video> VideoPointer;
129 Q_DECLARE_METATYPE(VideoPointer)