Blame view

ModelView.h 1.32 KB
3f2992b2c   bostx   V1.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  #ifndef MODELVIEW_H
  #define MODELVIEW_H
  
  #include <QWidget>
  #include <QTreeView>
  #include <QItemSelectionModel>
  #include <QKeyEvent>
  
  #include "ProjectModel.h"
  #include "Segment.h"
  #include "Episode.h"
  
  class ModelView: public QWidget
  {
    Q_OBJECT
  
      public:
    ModelView(ProjectModel *project, int nVignettes = 5, QWidget *parent = 0);
    void adjust();
    void initPlayer();
    QString getCurrentEpisodeFName() const;
    void setDepth(int depth);
  
    public slots:
    void updatePlayer(const QModelIndex &current, const QModelIndex &previous);
    void positionChanged(qint64 position);
    void playerPaused(bool pause);
    void initShotAnnot(bool checked);
  
    signals:
    void setPlayer(const QString &fName, const QSize &resolution);
    void setPlayerPosition(qint64);
    void initShotLevel(Segment *segment);
    void insertShot(Segment *segment);
    void removeShot(Segment *segment);
    void editSimShots(Segment *segment);
    void currentShot(QList<qint64>);
    void displaySubtitle(const QString &subtitle);
  
   protected:
    void keyPressEvent(QKeyEvent *event);
    
   private:
    void updateCurrentEpisode(Segment *segment);
    QList<qint64> genPositionList(Segment *segment);
  
    Episode *m_currEpisode;
    ProjectModel *m_project;
    QTreeView *m_treeView;
    QItemSelectionModel *m_selection;
    int m_depth;
    int m_nVignettes;
    bool m_playerPaused;
  };
  
  #endif