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
30 #include <phonon/mediaobject.h>
31 #include <phonon/videowidget.h>
32 #include <phonon/seekslider.h>
40 class VideoAreaWidget;
47 QHash<QString, QAction*>* globalActions();
50 class MediaView : public QWidget, public View {
55 static MediaView* instance();
62 void setMediaObject(Phonon::MediaObject *mediaObject);
64 const QList<VideoSource*> & getHistory() { return history; }
65 int getHistoryIndex();
66 PlaylistModel* getPlaylistModel() { return playlistModel; }
67 const QString &getCurrentVideoId();
68 void updateSubscriptionAction(Video *video, bool subscribed);
69 VideoAreaWidget* getVideoArea() { return videoAreaWidget; }
72 void search(SearchParams *searchParams);
73 void setVideoSource(VideoSource *videoSource, bool addToHistory = true);
83 void shareViaTwitter();
84 void shareViaFacebook();
85 void shareViaBuffer();
87 void removeSelected();
88 void moveUpSelected();
89 void moveDownSelected();
90 bool isPlaylistVisible();
91 void setPlaylistVisible(bool visible=true);
92 void saveSplitterState();
96 void findVideoParts();
102 void toggleSubscription();
106 void itemActivated(const QModelIndex &index);
107 void selectionChanged (const QItemSelection & selected, const QItemSelection & deselected);
108 void activeRowChanged(int);
109 void selectVideos(QList<Video*> videos);
110 void gotStreamUrl(QUrl streamUrl);
111 void handleError(QString message);
114 void stateChanged(Phonon::State newState, Phonon::State oldState);
116 void aboutToFinish();
117 #ifdef APP_ACTIVATION
119 void updateContinueButton(int);
122 void downloadStatusChanged();
123 void playbackFinished();
124 void playbackResume();
125 void authorPushed(QModelIndex);
127 void sliderMoved(int value);
128 qint64 offsetToTime(qint64 offset);
129 void startDownloading();
132 MediaView(QWidget *parent = 0);
133 SearchParams* getSearchParams();
135 static QRegExp wordRE(QString s);
138 SidebarWidget *sidebar;
139 PlaylistView *playlistView;
140 PlaylistModel *playlistModel;
141 VideoAreaWidget *videoAreaWidget;
142 LoadingWidget *loadingWidget;
145 Phonon::MediaObject *mediaObject;
146 Phonon::VideoWidget *videoWidget;
152 QString currentVideoId;
154 #ifdef APP_ACTIVATION
158 DownloadItem *downloadItem;
159 QList<VideoSource*> history;
160 QList<QAction*> currentVideoActions;
162 qint64 currentVideoSize;
165 #endif // __MEDIAVIEW_H__