1 | /*********************************************************************
|
---|
2 | // created: 2007/04/12 - 16:30
|
---|
3 | //
|
---|
4 | // author: Elie Al Alam & Gerald Dherbomez
|
---|
5 | // Heudiasyc UMR UTC/CNRS 6599 Copyright
|
---|
6 | //
|
---|
7 | // version: $Id: $
|
---|
8 | //
|
---|
9 | // purpose: Dbite Player User interface header file
|
---|
10 | *********************************************************************/
|
---|
11 |
|
---|
12 | #ifndef DBTPLYUSERINTERFACE_H
|
---|
13 | #define DBTPLYUSERINTERFACE_H
|
---|
14 |
|
---|
15 | #include <qwidget.h>
|
---|
16 |
|
---|
17 | #include "kernel/ComponentBase.h"
|
---|
18 | #include "kernel/ComponentFactory.h"
|
---|
19 | #include "DbitePlayerConfig.h"
|
---|
20 | #include "DbtPlyFileManager.h"
|
---|
21 | #include "DbtPlyEngine.h"
|
---|
22 |
|
---|
23 | class QButtonGroup;
|
---|
24 | class QCheckBox;
|
---|
25 | class QCloseEvent;
|
---|
26 | class QGroupBox;
|
---|
27 | class QLabel;
|
---|
28 | class QLayout;
|
---|
29 | class QPushButton;
|
---|
30 | class QSlider;
|
---|
31 | class QTableWidget;
|
---|
32 |
|
---|
33 | namespace pacpus {
|
---|
34 |
|
---|
35 | class DbtPlyEngine;
|
---|
36 | class DbtPlyEngineState;
|
---|
37 |
|
---|
38 | class DBITE_PLAYER_API DbtPlyUserInterface
|
---|
39 | : public QWidget
|
---|
40 | , public ComponentBase
|
---|
41 | {
|
---|
42 | Q_OBJECT
|
---|
43 |
|
---|
44 | public:
|
---|
45 | /// Constructor.
|
---|
46 | ///
|
---|
47 | /// @param name component name
|
---|
48 | /// @see ComponentBase::ComponentBase(QString)
|
---|
49 | DbtPlyUserInterface(QString name);
|
---|
50 |
|
---|
51 | /// Destructor.
|
---|
52 | ~DbtPlyUserInterface();
|
---|
53 |
|
---|
54 | /// @returns time slider value
|
---|
55 | int getTime();
|
---|
56 |
|
---|
57 | /// sets time slider value to 0
|
---|
58 | void resetTime();
|
---|
59 |
|
---|
60 | public Q_SLOTS:
|
---|
61 | /// Slot.
|
---|
62 | /// Refreshes the state of the player.
|
---|
63 | void displayStateSlot(DbtPlyEngineState * state, float speed);
|
---|
64 |
|
---|
65 | /// Slot.
|
---|
66 | /// Displays the max and min times.
|
---|
67 | void displayMinMaxTime(road_time_t min, road_time_t max);
|
---|
68 |
|
---|
69 | /// Slot.
|
---|
70 | /// Displays the current time of the player.
|
---|
71 | void displayTime(road_time_t time);
|
---|
72 |
|
---|
73 | private:
|
---|
74 | /// Configures the component.
|
---|
75 | virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
|
---|
76 |
|
---|
77 | /// Starts component activity.
|
---|
78 | virtual void startActivity();
|
---|
79 |
|
---|
80 | /// Stops component activity.
|
---|
81 | virtual void stopActivity();
|
---|
82 |
|
---|
83 | void closeEvent(QCloseEvent * e);
|
---|
84 |
|
---|
85 | void connectButtons();
|
---|
86 | void connectDisplay();
|
---|
87 | void connectSlider();
|
---|
88 | QLayout * createMainLayout();
|
---|
89 | QGroupBox * createControlGroupBox();
|
---|
90 | QGroupBox * createComponentListGroupBox();
|
---|
91 | void updateComponentList();
|
---|
92 |
|
---|
93 | private:
|
---|
94 | DbtPlyEngine * mEngine;
|
---|
95 |
|
---|
96 | QWidget * wTel_ ;
|
---|
97 | QButtonGroup * butGroup;
|
---|
98 | QPushButton * playBut ;
|
---|
99 | QPushButton * pauseBut ;
|
---|
100 | QPushButton * stopBut ;
|
---|
101 | QPushButton * speedUpBut ;
|
---|
102 | QPushButton * speedDownBut ;
|
---|
103 | QLabel * lab;
|
---|
104 | QCheckBox * rev;
|
---|
105 | QSlider * timeSlider;
|
---|
106 | QLabel * timeMinTitle;
|
---|
107 | QLabel * timeMinValue;
|
---|
108 | QLabel * timeMaxTitle;
|
---|
109 | QLabel * timeMaxValue;
|
---|
110 | QLabel * timeCurTitle;
|
---|
111 | QLabel * timeCurValue;
|
---|
112 |
|
---|
113 | QTableWidget * componentTableWidget;
|
---|
114 |
|
---|
115 | // current max time
|
---|
116 | road_time_t tMax_;
|
---|
117 | // current min time
|
---|
118 | road_time_t tMin_;
|
---|
119 | // current absolute time
|
---|
120 | road_time_t absTime_;
|
---|
121 | // current relative time
|
---|
122 | int relTime_;
|
---|
123 | };
|
---|
124 |
|
---|
125 | } // namespace pacpus
|
---|
126 |
|
---|
127 | #endif // DBTPLYUSERINTERFACE_H
|
---|