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);
75 void shareViaTwitter();
76 void shareViaFacebook();
77 void shareViaBuffer();
79 void removeSelected();
80 void moveUpSelected();
81 void moveDownSelected();
82 bool isPlaylistVisible();
83 void setPlaylistVisible(bool visible=true);
84 void saveSplitterState();
88 void findVideoParts();
94 void toggleSubscription();
98 void itemActivated(const QModelIndex &index);
99 void selectionChanged (const QItemSelection & selected, const QItemSelection & deselected);
100 void activeRowChanged(int);
101 void selectVideos(QList<Video*> videos);
102 void gotStreamUrl(QUrl streamUrl);
103 void handleError(QString message);
105 void stateChanged(Phonon::State newState, Phonon::State oldState);
106 void aboutToFinish();
107 #ifdef APP_ACTIVATION
109 void updateContinueButton(int);
112 void downloadStatusChanged();
113 void playbackFinished();
114 void playbackResume();
115 void authorPushed(QModelIndex);
119 void downloadProgress(int percent);
120 void sliderMoved(int value);
121 void seekTo(int value);
125 MediaView(QWidget *parent = 0);
126 SearchParams* getSearchParams();
128 static QRegExp wordRE(QString s);
131 SidebarWidget *sidebar;
132 PlaylistView *playlistView;
133 PlaylistModel *playlistModel;
134 VideoAreaWidget *videoAreaWidget;
135 LoadingWidget *loadingWidget;
138 Phonon::MediaObject *mediaObject;
139 Phonon::VideoWidget *videoWidget;
144 QString currentVideoId;
146 #ifdef APP_ACTIVATION
150 DownloadItem *downloadItem;
151 QList<VideoSource*> history;
152 QList<QAction*> currentVideoActions;
155 #endif // __MEDIAVIEW_H__