Copiste  0.1
 All Classes Functions Variables Enumerations Friends Pages
graphique.h
1 #ifndef INCLUDEDGRAPHIQUEH
2 #define INCLUDEDGRAPHIQUEH
3 
4 #include <QPainter>
5 #include <QWidget>
6 #include <QTimer>
7 #include <QMutex>
8 #include <QTime>
9 #include <vector>
10 #include <iostream>
11 #include <cmath>
12 #include <vlc/vlc.h>
13 
14 #define GRAPHIQUE_DATA_MAX_SIZE 5000
15 #define GRAPHIQUE_PAS 1
16 #define GRAPHIQUE_ECHELLE 50 // pixels par seconde
17 
22 class Graphique : public QWidget
23 {
24  Q_OBJECT
25  public:
27  Graphique(QWidget *parent = 0);
28 
30  void paintEvent(QPaintEvent *);
31 
33  void appendData(uint16_t *data, int size);
35  void appendData(std::vector<int> data);
37  void setData(uint16_t *data, int size);
39  void setData(std::vector<int> data);
41  void cleanData();
42 
44  void appendDummyData();
45 
47  void setDrawBars(bool drawBars) { mDrawBars = drawBars; }
48 
49  public slots:
51  void updateScrolling();
52 
53  private:
54  QPainter mPainter;
55  QTimer mRefreshTimer;
56 
57  int mFrequence;
58  std::vector<int> mData;
59  bool mDrawBars;
60 
61  // Scrolling
62  int mScroll;
63  QTime mTime;
64  QMutex mScrollMutex;
65 };
66 
67 #endif