QTfrontend/ui/page/pagevideos.h
changeset 7280 fd707afbc3a2
parent 7235 baa69bd025d9
child 7353 0e55228e1303
equal deleted inserted replaced
7278:000e4543f204 7280:fd707afbc3a2
    18 
    18 
    19 
    19 
    20 #ifndef PAGE_VIDEOS_H
    20 #ifndef PAGE_VIDEOS_H
    21 #define PAGE_VIDEOS_H
    21 #define PAGE_VIDEOS_H
    22 
    22 
    23 #include <QPushButton>
    23 #include <QPixmap>
    24 #include <QTableWidget>
       
    25 #include "AbstractPage.h"
    24 #include "AbstractPage.h"
    26 
    25 
    27 class GameUIConfig;
    26 class GameUIConfig;
       
    27 class HWRecorder;
       
    28 class VideoItem;
    28 
    29 
    29 class PageVideos : public AbstractPage
    30 class PageVideos : public AbstractPage
    30 {
    31 {
    31         Q_OBJECT
    32         Q_OBJECT
    32 
    33 
    33     public:
    34     public:
    34         PageVideos(QWidget* parent = 0);
    35         PageVideos(QWidget* parent = 0);
    35 
    36 
    36         QComboBox *CBAVFormats;
       
    37         QComboBox *CBVideoCodecs;
       
    38         QComboBox *CBAudioCodecs;
       
    39         QSpinBox  *framerateBox;
    37         QSpinBox  *framerateBox;
    40         QLineEdit *widthEdit;
    38         QLineEdit *widthEdit;
    41         QLineEdit *heightEdit;
    39         QLineEdit *heightEdit;
    42         QCheckBox *CBUseGameRes;
    40         QCheckBox *checkUseGameRes;
    43         QCheckBox *CBRecordAudio;
    41         QCheckBox *checkRecordAudio;
    44 
    42 
    45         QString getFormat()
    43         GameUIConfig * config;
    46         { return CBAVFormats->itemData(CBAVFormats->currentIndex()).toString(); }
       
    47 
    44 
    48         QString getVideoCodec()
    45         QString format()
    49         { return CBVideoCodecs->itemData(CBVideoCodecs->currentIndex()).toString(); }
    46         { return comboAVFormats->itemData(comboAVFormats->currentIndex()).toString(); }
    50 
    47 
    51         QString getAudioCodec()
    48         QString videoCodec()
    52         { return CBAudioCodecs->itemData(CBAudioCodecs->currentIndex()).toString(); }
    49         { return comboVideoCodecs->itemData(comboVideoCodecs->currentIndex()).toString(); }
       
    50 
       
    51         QString audioCodec()
       
    52         { return comboAudioCodecs->itemData(comboAudioCodecs->currentIndex()).toString(); }
    53 
    53 
    54         void setDefaultCodecs();
    54         void setDefaultCodecs();
    55         bool tryCodecs(const QString & format, const QString & vcodec, const QString & acodec);
    55         bool tryCodecs(const QString & format, const QString & vcodec, const QString & acodec);
    56 
    56         void addRecorder(HWRecorder* pRecorder);
    57         GameUIConfig * config;
       
    58 
       
    59     signals:
       
    60 
    57 
    61     private:
    58     private:
       
    59         // virtuals from AbstractPage
    62         QLayout * bodyLayoutDefinition();
    60         QLayout * bodyLayoutDefinition();
    63         QLayout * footerLayoutDefinition();
    61         QLayout * footerLayoutDefinition();
    64         void connectSignals();
    62         void connectSignals();
    65 
    63 
    66         QPushButton *BtnDefaults;
    64         // virtual from QWidget
       
    65         void keyPressEvent(QKeyEvent * pEvent);
       
    66 
       
    67         void setName(VideoItem * item, const QString & newName);
       
    68         void updateSize(int row);
       
    69         int appendRow(const QString & name);
       
    70         VideoItem* nameItem(int row);
       
    71         void play(int row);
       
    72         void updateDescription();
       
    73 
       
    74         // options group
       
    75         QComboBox *comboAVFormats;
       
    76         QComboBox *comboVideoCodecs;
       
    77         QComboBox *comboAudioCodecs;
       
    78         QPushButton *btnDefaults;
       
    79 
       
    80         // file list group
    67         QTableWidget *filesTable;
    81         QTableWidget *filesTable;
       
    82         QPushButton *btnOpenDir;
       
    83 
       
    84         // description group
       
    85         QPushButton *btnPlay, *btnDelete;
       
    86         QLabel *labelDesc;
       
    87         QLabel *labelThumbnail;
       
    88         QPixmap picThumbnail;
       
    89 
       
    90         // this flag is used to distinguish if cell was changed from code or by user
       
    91         // (in signal cellChanged)
       
    92         bool nameChangedFromCode;
    68 
    93 
    69     private slots:
    94     private slots:
    70         void changeAVFormat(int index);
    95         void changeAVFormat(int index);
    71         void changeUseGameRes(int state);
    96         void changeUseGameRes(int state);
    72         void changeRecordAudio(int state);
    97         void changeRecordAudio(int state);
    73         void setDefaultOptions();
    98         void setDefaultOptions();
       
    99         void encodingFinished(bool success);
       
   100         void updateProgress(float value);
       
   101         void cellDoubleClicked(int row, int column);
       
   102         void cellChanged(int row, int column);
       
   103         void currentCellChanged(int row, int column, int previousRow, int previousColumn);
       
   104         void playSelectedFile();
       
   105         void deleteSelectedFiles();
       
   106         void openVideosDirectory();
       
   107         void updateFileList(const QString & path);
    74 };
   108 };
    75 
   109 
    76 #endif // PAGE_VIDEOS_H
   110 #endif // PAGE_VIDEOS_H