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/>.
21 #ifndef __MEDIAVIEW_H__
22 #define __MEDIAVIEW_H__
25 #if QT_VERSION >= 0x050000
29 #include <phonon/mediaobject.h>
30 #include <phonon/videowidget.h>
31 #include <phonon/seekslider.h>
38 class VideoAreaWidget;
45 QHash<QString, QAction*>* globalActions();
48 class MediaView : public QWidget, public View {
53 static MediaView* instance();
59 void setMediaObject(Phonon::MediaObject *mediaObject);
60 const QList<VideoSource*> & getHistory() { return history; }
61 int getHistoryIndex();
62 PlaylistModel* getPlaylistModel() { return playlistModel; }
63 const QString &getCurrentVideoId();
64 void updateSubscriptionAction(Video *video, bool subscribed);
65 VideoAreaWidget* getVideoArea() { return videoAreaWidget; }
68 void search(SearchParams *searchParams);
69 void setVideoSource(VideoSource *videoSource, bool addToHistory = true);
79 void shareViaTwitter();
80 void shareViaFacebook();
81 void shareViaBuffer();
83 void removeSelected();
84 void moveUpSelected();
85 void moveDownSelected();
86 bool isPlaylistVisible();
87 void setPlaylistVisible(bool visible=true);
88 void saveSplitterState();
92 void findVideoParts();
98 void toggleSubscription();
102 void itemActivated(const QModelIndex &index);
103 void selectionChanged (const QItemSelection & selected, const QItemSelection & deselected);
104 void activeRowChanged(int);
105 void selectVideos(QList<Video*> videos);
106 void gotStreamUrl(QUrl streamUrl);
107 void handleError(QString message);
109 void stateChanged(Phonon::State newState, Phonon::State oldState);
110 void aboutToFinish();
111 #ifdef APP_ACTIVATION
113 void updateContinueButton(int);
116 void downloadStatusChanged();
117 void playbackFinished();
118 void playbackResume();
119 void authorPushed(QModelIndex);
121 void sliderMoved(int value);
122 qint64 offsetToTime(qint64 offset);
123 void startDownloading();
126 MediaView(QWidget *parent = 0);
127 SearchParams* getSearchParams();
129 static QRegExp wordRE(QString s);
132 SidebarWidget *sidebar;
133 PlaylistView *playlistView;
134 PlaylistModel *playlistModel;
135 VideoAreaWidget *videoAreaWidget;
136 LoadingWidget *loadingWidget;
139 Phonon::MediaObject *mediaObject;
140 Phonon::VideoWidget *videoWidget;
145 QString currentVideoId;
147 #ifdef APP_ACTIVATION
151 DownloadItem *downloadItem;
152 QList<VideoSource*> history;
153 QList<QAction*> currentVideoActions;
155 qint64 currentVideoSize;
158 #endif // __MEDIAVIEW_H__