]> git.sur5r.net Git - minitube/blobdiff - src/video.h
Big 2.1 commit
[minitube] / src / video.h
index 7fd1cb960781cc5acdffc44b533cc0ca59648c8f..5e8580ae1408bba82d59fe818f560e99d7804f09 100644 (file)
@@ -1,3 +1,23 @@
+/* $BEGIN_LICENSE
+
+This file is part of Minitube.
+Copyright 2009, Flavio Tordini <flavio.tordini@gmail.com>
+
+Minitube is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Minitube is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Minitube.  If not, see <http://www.gnu.org/licenses/>.
+
+$END_LICENSE */
+
 #ifndef VIDEO_H
 #define VIDEO_H
 
@@ -12,29 +32,29 @@ public:
     Video();
     Video* clone();
 
-    const QString title() const { return m_title; }
+    const QString title() const { return m_title; }
     void setTitle( QString title ) { m_title = title; }
 
-    const QString description() const { return m_description; }
+    const QString description() const { return m_description; }
     void setDescription( QString description ) { m_description = description; }
 
-    const QString author() const { return m_author; }
+    const QString author() const { return m_author; }
     void setAuthor( QString author ) { m_author = author; }
 
-    const QString authorUri() const { return m_authorUri; }
-    void setAuthorUri( QString authorUri ) { m_authorUri = authorUri; }
+    const QString & userId() const { return m_userId; }
+    void setUserId( QString userId ) { m_userId = userId; }
 
-    const QUrl webpage() const { return m_webpage; }
+    const QUrl webpage() const { return m_webpage; }
     void setWebpage(QUrl webpage);
 
     void loadThumbnail();
     const QPixmap & thumbnail() const { return m_thumbnail; }
 
-    QString thumbnailUrl() { return m_thumbnailUrl; }
+    const QString & thumbnailUrl() { return m_thumbnailUrl; }
     void setThumbnailUrl(QString url) { m_thumbnailUrl = url; }
 
     void loadMediumThumbnail();
-    QString mediumThumbnailUrl() { return m_mediumThumbnailUrl; }
+    const QString & mediumThumbnailUrl() { return m_mediumThumbnailUrl; }
     void setMediumThumbnailUrl(QString url) { m_mediumThumbnailUrl = url; }
 
     int duration() const { return m_duration; }
@@ -44,15 +64,16 @@ public:
     int viewCount() const { return m_viewCount; }
     void setViewCount( int viewCount ) { m_viewCount = viewCount; }
 
-    const QDateTime published() const { return m_published; }
+    const QDateTime published() const { return m_published; }
     void setPublished( QDateTime published ) { m_published = published; }
 
     int getDefinitionCode() const { return definitionCode; }
 
     void loadStreamUrl();
-    QUrl getStreamUrl() { return m_streamUrl; }
+    const QUrl & getStreamUrl() { return m_streamUrl; }
 
-    QString id() { return videoId; }
+    void setId(QString id) { videoId = id; }
+    const QString & id() const { return videoId; }
 
 signals:
     void gotThumbnail();
@@ -71,11 +92,12 @@ private:
     void getVideoInfo();
     void findVideoUrl(int definitionCode);
     void foundVideoUrl(QString videoToken, int definitionCode);
+    void parseFmtUrlMap(QString fmtUrlMap, bool fromWebPage = false);
 
     QString m_title;
     QString m_description;
     QString m_author;
-    QString m_authorUri;
+    QString m_userId;
     QUrl m_webpage;
     QUrl m_streamUrl;
     QPixmap m_thumbnail;