qtmobility/examples/player/player.h
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 5 453da2cfceef
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    47 #include <qmediaplayer.h>
    47 #include <qmediaplayer.h>
    48 #include <qmediaplaylist.h>
    48 #include <qmediaplaylist.h>
    49 #include <qvideowidget.h>
    49 #include <qvideowidget.h>
    50 
    50 
    51 #ifdef Q_OS_SYMBIAN
    51 #ifdef Q_OS_SYMBIAN
       
    52 #include <QtGui/QDialog>
       
    53 #include <QtGui/QLineEdit>
       
    54 #include <QtGui/QListWidget>
       
    55 #include <QtNetwork/QHttp>
    52 #include "mediakeysobserver.h"
    56 #include "mediakeysobserver.h"
    53 #endif
    57 #endif
    54 
    58 
    55 QT_BEGIN_NAMESPACE
    59 QT_BEGIN_NAMESPACE
    56 class QAbstractItemView;
    60 class QAbstractItemView;
    82     void open();
    86     void open();
    83     void durationChanged(qint64 duration);
    87     void durationChanged(qint64 duration);
    84     void positionChanged(qint64 progress);
    88     void positionChanged(qint64 progress);
    85     void metaDataChanged();
    89     void metaDataChanged();
    86 
    90 
       
    91     void previousClicked();
       
    92 
    87     void seek(int seconds);
    93     void seek(int seconds);
    88     void jump(const QModelIndex &index);
    94     void jump(const QModelIndex &index);
    89     void playlistPositionChanged(int);
    95     void playlistPositionChanged(int);
    90 
    96 
    91     void statusChanged(QMediaPlayer::MediaStatus status);
    97     void statusChanged(QMediaPlayer::MediaStatus status);
    92     void bufferingProgress(int progress);
    98     void bufferingProgress(int progress);
    93 
    99 
       
   100     void displayErrorMessage();
       
   101 
    94 #ifdef Q_OS_SYMBIAN
   102 #ifdef Q_OS_SYMBIAN
    95     void handleFullScreen(bool isFullscreen);
   103     void handleFullScreen(bool isFullscreen);
       
   104     void handleAspectRatio(bool aspectRatio);
    96     void handleStateChange(QMediaPlayer::State state);
   105     void handleStateChange(QMediaPlayer::State state);
    97     void handleMediaKeyEvent(MediaKeysObserver::MediaKeys key);
   106     void handleMediaKeyEvent(MediaKeysObserver::MediaKeys key);
    98     void showPlayList();
   107     void showPlayList();
       
   108     void hideOrShowCoverArt();
       
   109     void launchYoutubeDialog();
       
   110     void youtubeHttpRequestFinished(int requestId, bool error);
       
   111     void youtubeReadResponseHeader(const QHttpResponseHeader& responseHeader);
       
   112     void searchYoutubeVideo();
       
   113     void addYoutubeVideo();
    99 #else
   114 #else
   100     void showColorDialog();
   115     void showColorDialog();
   101 #endif
   116 #endif
   102 
   117 
   103 private:
   118 private:
   104     void setTrackInfo(const QString &info);
   119     void setTrackInfo(const QString &info);
   105     void setStatusInfo(const QString &info);
   120     void setStatusInfo(const QString &info);
       
   121     void handleCursor(QMediaPlayer::MediaStatus status);
       
   122 
       
   123 #ifdef Q_OS_SYMBIAN
       
   124     void createMenus();
       
   125 #endif
   106 
   126 
   107     QMediaPlayer *player;
   127     QMediaPlayer *player;
   108     QMediaPlaylist *playlist;
   128     QMediaPlaylist *playlist;
   109     QVideoWidget *videoWidget;
   129     QVideoWidget *videoWidget;
   110     QLabel *coverLabel;
   130     QLabel *coverLabel;
   111     QSlider *slider;
   131     QSlider *slider;
   112     PlaylistModel *playlistModel;
   132     PlaylistModel *playlistModel;
   113     QAbstractItemView *playlistView;
   133     QAbstractItemView *playlistView;
   114     QString trackInfo;
   134     QString trackInfo;
   115     QString statusInfo;
   135     QString statusInfo;
   116 #ifdef Q_OS_SYMBIAN    
   136 #ifdef Q_OS_SYMBIAN
   117     MediaKeysObserver *mediaKeysObserver;
   137     MediaKeysObserver *mediaKeysObserver;
   118     QDialog *playlistDialog;
   138     QDialog *playlistDialog;
       
   139     QAction *toggleAspectRatio;
       
   140     QAction *showYoutubeDialog;
       
   141     QDialog *youtubeDialog;
       
   142     QHttp http;
       
   143     int httpGetId;
   119 #else
   144 #else
   120     QDialog *colorDialog;
   145     QDialog *colorDialog;
   121 #endif    
   146 #endif
   122 };
   147 };
   123 
   148 
   124 #endif
   149 #endif