X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fmediaview.h;h=84146d7d2e105918b4ec832682fcdd79eb7111ea;hb=5ecc9c04fb173c5693bcded5191d29816304d12c;hp=8277707e4a4be3f26df1fc86c045c2e0cb9323fd;hpb=a8e005af0aa72f809f823bbd741bb3d0def00ced;p=minitube diff --git a/src/mediaview.h b/src/mediaview.h index 8277707..84146d7 100644 --- a/src/mediaview.h +++ b/src/mediaview.h @@ -1,11 +1,36 @@ +/* $BEGIN_LICENSE + +This file is part of Minitube. +Copyright 2009, Flavio Tordini + +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 . + +$END_LICENSE */ + #ifndef __MEDIAVIEW_H__ #define __MEDIAVIEW_H__ #include +#if QT_VERSION >= 0x050000 +#include +#endif #include +#ifdef APP_PHONON #include #include #include +#endif #include "view.h" class Video; @@ -17,9 +42,12 @@ class DownloadItem; class PlaylistView; class SidebarWidget; class VideoSource; +#ifdef APP_SNAPSHOT +class SnapshotSettings; +#endif namespace The { - QHash* globalActions(); +QHash* globalActions(); } class MediaView : public QWidget, public View { @@ -33,15 +61,19 @@ public: void appear(); void disappear(); +#ifdef APP_PHONON void setMediaObject(Phonon::MediaObject *mediaObject); +#endif const QList & getHistory() { return history; } int getHistoryIndex(); PlaylistModel* getPlaylistModel() { return playlistModel; } - Video* getCurrentVideo(); + const QString &getCurrentVideoId(); + void updateSubscriptionAction(Video *video, bool subscribed); + VideoAreaWidget* getVideoArea() { return videoAreaWidget; } public slots: void search(SearchParams *searchParams); - void setVideoSource(VideoSource *videoSource, bool addToHistory = true); + void setVideoSource(VideoSource *videoSource, bool addToHistory = true, bool back = false); void pause(); void stop(); void skip(); @@ -50,6 +82,7 @@ public slots: void openWebPage(); void copyWebPage(); void copyVideoLink(); + void openInBrowser(); void shareViaTwitter(); void shareViaFacebook(); void shareViaBuffer(); @@ -61,7 +94,9 @@ public slots: void setPlaylistVisible(bool visible=true); void saveSplitterState(); void downloadVideo(); +#ifdef APP_SNAPSHOT void snapshot(); +#endif void fullscreen(); void findVideoParts(); void relatedVideos(); @@ -69,6 +104,7 @@ public slots: void goBack(); bool canGoForward(); void goForward(); + void toggleSubscription(); private slots: // list/model @@ -79,8 +115,9 @@ private slots: void gotStreamUrl(QUrl streamUrl); void handleError(QString message); // phonon +#ifdef APP_PHONON void stateChanged(Phonon::State newState, Phonon::State oldState); - void currentSourceChanged(const Phonon::MediaSource source); +#endif void aboutToFinish(); #ifdef APP_ACTIVATION void demoMessage(); @@ -92,16 +129,14 @@ private slots: void playbackResume(); void authorPushed(QModelIndex); void searchAgain(); - - /* - void downloadProgress(int percent); void sliderMoved(int value); - void seekTo(int value); - */ + qint64 offsetToTime(qint64 offset); + void startDownloading(); private: MediaView(QWidget *parent = 0); SearchParams* getSearchParams(); + static QRegExp wordRE(QString s); QSplitter *splitter; @@ -111,13 +146,15 @@ private: VideoAreaWidget *videoAreaWidget; LoadingWidget *loadingWidget; - // phonon +#ifdef APP_PHONON Phonon::MediaObject *mediaObject; Phonon::VideoWidget *videoWidget; +#endif - bool reallyStopped; + bool stopped; QTimer *errorTimer; Video *skippedVideo; + QString currentVideoId; #ifdef APP_ACTIVATION QTimer *demoTimer; @@ -125,6 +162,13 @@ private: DownloadItem *downloadItem; QList history; + QList currentVideoActions; + + qint64 currentVideoSize; + +#ifdef APP_SNAPSHOT + SnapshotSettings *snapshotSettings; +#endif }; #endif // __MEDIAVIEW_H__