Guest User

LibVLC Video Player Header

a guest
Jun 15th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. /*
  2.     *
  3.     * NBAVPlayer.hpp - Peek plugin to preview Video and Audio
  4.     *
  5. */
  6.  
  7. #pragma once
  8.  
  9. #include <QtGui>
  10. #include <QtCore>
  11.  
  12. #include <unistd.h>
  13. #include <vlc/vlc.h>
  14.  
  15. #if QT_VERSION > 0x050000
  16.     #include <QtWidgets>
  17. #endif
  18.  
  19. class NBAVPlayer : public QDialog {
  20.     Q_OBJECT
  21.  
  22.     public :
  23.         NBAVPlayer( QString path = QDir::homePath() );
  24.         ~NBAVPlayer();
  25.  
  26.     private :
  27.         void createGUI();
  28.         void setWindowProperties();
  29.  
  30.         void loadMedia();
  31.  
  32.         void togglePausePlay();
  33.         void stop();
  34.  
  35.         void seek( int ms, bool forward );
  36.  
  37.         QVBoxLayout *avLyt;
  38.         QLabel *lbl;
  39.  
  40.         QString mPath;
  41.         QWidget *peekWidgetBase;
  42.  
  43.         libvlc_instance_t * inst;
  44.         libvlc_media_player_t *mp;
  45.         libvlc_media_t *m;
  46.  
  47.         bool mIsPlaying;
  48.  
  49.     private slots :
  50.         void openInExternal();
  51.  
  52.     protected :
  53.         void keyPressEvent( QKeyEvent *keyEvent );
  54.         void changeEvent( QEvent *cEvent );
  55.  
  56.         void paintEvent( QPaintEvent *pEvent );
  57. };
Add Comment
Please, Sign In to add comment