X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fmediaview.h;h=ea3400bfc4393972039ab1579e8357f2e31029c6;hb=fe9d17324e88a65d4f28afccf21857c5a5e60649;hp=2bc3f29e3a3e380822ff59abe6320f93df84d46d;hpb=7cdd5bd476021ec84d54c4ec5be02280e1e9e548;p=minitube diff --git a/src/mediaview.h b/src/mediaview.h index 2bc3f29..ea3400b 100644 --- a/src/mediaview.h +++ b/src/mediaview.h @@ -18,52 +18,51 @@ along with Minitube. If not, see . $END_LICENSE */ -#ifndef __MEDIAVIEW_H__ -#define __MEDIAVIEW_H__ +#ifndef MEDIAVIEW_H +#define MEDIAVIEW_H -#include #include -#include -#include -#include +#include + +#include "media.h" + #include "view.h" class Video; class PlaylistModel; class SearchParams; class LoadingWidget; -class VideoAreaWidget; -class DownloadItem; +class VideoArea; class PlaylistView; class SidebarWidget; class VideoSource; +#ifdef APP_SNAPSHOT +class SnapshotSettings; +#endif -namespace The { - QHash* globalActions(); -} - -class MediaView : public QWidget, public View { - +class MediaView : public View { Q_OBJECT public: - static MediaView* instance(); + static MediaView *instance(); void initialize(); void appear(); void disappear(); - void setMediaObject(Phonon::MediaObject *mediaObject); - const QList & getHistory() { return history; } + void setMedia(Media *media); + const QVector &getHistory() { return history; } int getHistoryIndex(); - PlaylistModel* getPlaylistModel() { return playlistModel; } + PlaylistModel *getPlaylistModel() { return playlistModel; } const QString &getCurrentVideoId(); - void updateSubscriptionAction(Video *video, bool subscribed); - VideoAreaWidget* getVideoArea() { return videoAreaWidget; } + void updateSubscriptionActionForVideo(Video *video, bool subscribed); + void updateSubscriptionActionForChannel(const QString & channelId); + VideoArea *getVideoArea() { return videoAreaWidget; } + void reloadCurrentVideo(); public slots: void search(SearchParams *searchParams); - void setVideoSource(VideoSource *videoSource, bool addToHistory = true); + void setVideoSource(VideoSource *videoSource, bool addToHistory = true, bool back = false); void pause(); void stop(); void skip(); @@ -75,16 +74,20 @@ public slots: void openInBrowser(); void shareViaTwitter(); void shareViaFacebook(); - void shareViaBuffer(); void shareViaEmail(); void removeSelected(); void moveUpSelected(); void moveDownSelected(); - bool isPlaylistVisible(); - void setPlaylistVisible(bool visible=true); + bool isSidebarVisible(); + void setSidebarVisibility(bool visible); + SidebarWidget *getSidebar() { return sidebar; } + void removeSidebar(); + void restoreSidebar(); void saveSplitterState(); void downloadVideo(); - // void snapshot(); +#ifdef APP_SNAPSHOT + void snapshot(); +#endif void fullscreen(); void findVideoParts(); void relatedVideos(); @@ -93,63 +96,64 @@ public slots: bool canGoForward(); void goForward(); void toggleSubscription(); + void adjustWindowSize(); + void updateSubscriptionAction(bool subscribed); private slots: - // list/model - void itemActivated(const QModelIndex &index); - void selectionChanged (const QItemSelection & selected, const QItemSelection & deselected); - void activeRowChanged(int); - void selectVideos(QList videos); - void gotStreamUrl(QUrl streamUrl); - void handleError(QString message); - // phonon - void stateChanged(Phonon::State newState, Phonon::State oldState); - void aboutToFinish(); -#ifdef APP_ACTIVATION - void demoMessage(); - void updateContinueButton(int); -#endif - void startPlaying(); - void downloadStatusChanged(); - void playbackFinished(); - void playbackResume(); - void authorPushed(QModelIndex); + void onItemActivated(const QModelIndex &index); + void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + void activeVideoChanged(Video *video, Video *previousVideo); + void selectVideos(const QVector