1 #ifndef __MEDIAVIEW_H__
2 #define __MEDIAVIEW_H__
6 #include <phonon/mediaobject.h>
7 #include <phonon/videowidget.h>
8 #include <phonon/seekslider.h>
10 #include "ListModel.h"
11 #include "segmentedcontrol.h"
12 #include "searchparams.h"
13 #include "loadingwidget.h"
14 #include "videoareawidget.h"
21 QMap<QString, QAction*>* globalActions();
24 class MediaView : public QWidget, public View {
28 MediaView(QWidget *parent);
34 QMap<QString, QVariant> metadata() {
35 QMap<QString, QVariant> metadata;
37 metadata.insert("title", "");
38 metadata.insert("description", "");
43 void setMediaObject(Phonon::MediaObject *mediaObject);
44 void setSlider(Phonon::SeekSlider *slider) { this->seekSlider = slider; }
47 void search(SearchParams *searchParams);
56 void shareViaTwitter();
57 void shareViaFacebook();
58 void shareViaBuffer();
60 void removeSelected();
61 void moveUpSelected();
62 void moveDownSelected();
63 bool isPlaylistVisible();
64 void setPlaylistVisible(bool visible=true);
65 void saveSplitterState();
69 void findVideoParts();
73 void itemActivated(const QModelIndex &index);
74 void selectionChanged (const QItemSelection & selected, const QItemSelection & deselected);
75 void activeRowChanged(int);
76 void selectVideos(QList<Video*> videos);
77 void gotStreamUrl(QUrl streamUrl);
78 void handleError(QString message);
80 void stateChanged(Phonon::State newState, Phonon::State oldState);
81 void currentSourceChanged(const Phonon::MediaSource source);
82 void showVideoContextMenu(QPoint point);
85 void searchMostRelevant();
86 void searchMostRecent();
87 void searchMostViewed();
92 void updateContinueButton(int);
95 void downloadStatusChanged();
96 void playbackFinished();
97 void playbackResume();
98 void authorPushed(QModelIndex);
102 void downloadProgress(int percent);
103 void sliderMoved(int value);
104 void seekTo(int value);
108 static QRegExp wordRE(QString s);
110 SearchParams *searchParams;
114 SidebarWidget *sidebar;
115 PlaylistView *listView;
116 ListModel *listModel;
119 SegmentedControl *sortBar;
120 QAction *mostRelevantAction;
121 QAction *mostRecentAction;
122 QAction *mostViewedAction;
125 Phonon::MediaObject *mediaObject;
126 Phonon::VideoWidget *videoWidget;
127 Phonon::SeekSlider *seekSlider;
130 VideoAreaWidget *videoAreaWidget;
131 LoadingWidget *loadingWidget;
137 QTimer *workaroundTimer;
140 #ifdef APP_ACTIVATION
144 DownloadItem *downloadItem;
148 #endif // __MEDIAVIEW_H__