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__
26 #include <phonon/mediaobject.h>
27 #include <phonon/videowidget.h>
28 #include <phonon/seekslider.h>
35 class VideoAreaWidget;
42 QHash<QString, QAction*>* globalActions();
45 class MediaView : public QWidget, public View {
50 static MediaView* instance();
56 void setMediaObject(Phonon::MediaObject *mediaObject);
57 const QList<VideoSource*> & getHistory() { return history; }
58 int getHistoryIndex();
59 PlaylistModel* getPlaylistModel() { return playlistModel; }
60 const QString &getCurrentVideoId();
61 void updateSubscriptionAction(Video *video, bool subscribed);
62 VideoAreaWidget* getVideoArea() { return videoAreaWidget; }
65 void search(SearchParams *searchParams);
66 void setVideoSource(VideoSource *videoSource, bool addToHistory = true);
76 void shareViaTwitter();
77 void shareViaFacebook();
78 void shareViaBuffer();
80 void removeSelected();
81 void moveUpSelected();
82 void moveDownSelected();
83 bool isPlaylistVisible();
84 void setPlaylistVisible(bool visible=true);
85 void saveSplitterState();
89 void findVideoParts();
95 void toggleSubscription();
99 void itemActivated(const QModelIndex &index);
100 void selectionChanged (const QItemSelection & selected, const QItemSelection & deselected);
101 void activeRowChanged(int);
102 void selectVideos(QList<Video*> videos);
103 void gotStreamUrl(QUrl streamUrl);
104 void handleError(QString message);
106 void stateChanged(Phonon::State newState, Phonon::State oldState);
107 void aboutToFinish();
108 #ifdef APP_ACTIVATION
110 void updateContinueButton(int);
113 void downloadStatusChanged();
114 void playbackFinished();
115 void playbackResume();
116 void authorPushed(QModelIndex);
118 void sliderMoved(int value);
119 qint64 offsetToTime(qint64 offset);
120 void startDownloading();
123 MediaView(QWidget *parent = 0);
124 SearchParams* getSearchParams();
126 static QRegExp wordRE(QString s);
129 SidebarWidget *sidebar;
130 PlaylistView *playlistView;
131 PlaylistModel *playlistModel;
132 VideoAreaWidget *videoAreaWidget;
133 LoadingWidget *loadingWidget;
136 Phonon::MediaObject *mediaObject;
137 Phonon::VideoWidget *videoWidget;
142 QString currentVideoId;
144 #ifdef APP_ACTIVATION
148 DownloadItem *downloadItem;
149 QList<VideoSource*> history;
150 QList<QAction*> currentVideoActions;
152 qint64 currentVideoSize;
155 #endif // __MEDIAVIEW_H__