+/* $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 __MEDIAVIEW_H__
#define __MEDIAVIEW_H__
#include <QtGui>
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#endif
#include <QtNetwork>
+#ifdef APP_PHONON
#include <phonon/mediaobject.h>
#include <phonon/videowidget.h>
#include <phonon/seekslider.h>
+#endif
#include "view.h"
class Video;
class PlaylistView;
class SidebarWidget;
class VideoSource;
+#ifdef APP_SNAPSHOT
+class SnapshotSettings;
+#endif
namespace The {
- QHash<QString, QAction*>* globalActions();
+QHash<QString, QAction*>* globalActions();
}
class MediaView : public QWidget, public View {
void appear();
void disappear();
+#ifdef APP_PHONON
void setMediaObject(Phonon::MediaObject *mediaObject);
+#endif
const QList<VideoSource*> & 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();
void openWebPage();
void copyWebPage();
void copyVideoLink();
+ void openInBrowser();
void shareViaTwitter();
void shareViaFacebook();
void shareViaBuffer();
void setPlaylistVisible(bool visible=true);
void saveSplitterState();
void downloadVideo();
+#ifdef APP_SNAPSHOT
void snapshot();
+#endif
void fullscreen();
void findVideoParts();
void relatedVideos();
void goBack();
bool canGoForward();
void goForward();
+ void toggleSubscription();
private slots:
// list/model
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();
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;
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;
DownloadItem *downloadItem;
QList<VideoSource*> history;
+ QList<QAction*> currentVideoActions;
+
+ qint64 currentVideoSize;
+
+#ifdef APP_SNAPSHOT
+ SnapshotSettings *snapshotSettings;
+#endif
};
#endif // __MEDIAVIEW_H__