source: pacpusframework/branches/0.1.x/include/Pacpus/DbitePlayer/DbtPlyUserInterface.h@ 243

Last change on this file since 243 was 152, checked in by Marek Kurdej, 11 years ago

Major update.
Renamed: addInput -> addInputs, addOutput -> addOutputs and made pure virtual (=0).
Transformed macro definitions into template methods: ADD_INPUT -> ComponentBase::addInput, ADD_OUTPUT -> ComponentBase::addOutput, GET_INPUT -> ComponentBase::getTypedInput, GET_OUTPUT -> ComponentBase::getTypedOutput.
Fixed: added public/protected set/get methods in ComponentBase, made member fields private.

  • Property svn:executable set to *
File size: 3.3 KB
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5/// @file
6/// @author Elie Al Alam <firstname.surname@utc.fr>
7/// @author Gerald Dherbomez <firstname.surname@utc.fr>
8/// @date April, 2007
9/// @version $Id: DbtPlyUserInterface.h 76 2013-01-10 17:05:10Z kurdejma $
10/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
11/// @brief DbitePlayer graphical user interface.
12///
13/// Detailed description.
14
15#ifndef DEF_PACPUS_DBTPLYUSERINTERFACE_H
16#define DEF_PACPUS_DBTPLYUSERINTERFACE_H
17
18#include <QWidget>
19
20#include <Pacpus/kernel/ComponentBase.h>
21#include <Pacpus/kernel/ComponentFactory.h>
22#include <Pacpus/DbitePlayer/DbitePlayerConfig.h>
23#include <Pacpus/DbitePlayer/DbtPlyFileManager.h>
24#include <Pacpus/DbitePlayer/DbtPlyEngine.h>
25
26class QButtonGroup;
27class QCheckBox;
28class QCloseEvent;
29class QGroupBox;
30class QLabel;
31class QLayout;
32class QPushButton;
33class QSlider;
34class QTableWidget;
35
36namespace pacpus {
37
38class DbtPlyEngine;
39class DbtPlyEngineState;
40
41class DBITE_PLAYER_API DbtPlyUserInterface
42 : public QWidget
43 , public ComponentBase
44{
45 Q_OBJECT
46
47public:
48 /// Constructor.
49 ///
50 /// @param name component name
51 /// @see ComponentBase::ComponentBase(QString)
52 DbtPlyUserInterface(QString name);
53
54 /// Destructor.
55 ~DbtPlyUserInterface();
56
57 /// @returns time slider value
58 int getTime();
59
60 /// sets time slider value to 0
61 void resetTime();
62
63public Q_SLOTS:
64 /// Slot.
65 /// Refreshes the state of the player.
66 void displayStateSlot(DbtPlyEngineState * state, float speed);
67
68 /// Slot.
69 /// Displays the max and min times.
70 void displayMinMaxTime(road_time_t min, road_time_t max);
71
72 /// Slot.
73 /// Displays the current time of the player.
74 void displayTime(road_time_t time);
75
76protected:
77 virtual void addInputs();
78 virtual void addOutputs();
79
80private:
81 /// Configures the component.
82 virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
83
84 /// Starts component activity.
85 virtual void startActivity();
86
87 /// Stops component activity.
88 virtual void stopActivity();
89
90 void closeEvent(QCloseEvent * e);
91
92 void connectButtons();
93 void connectDisplay();
94 void connectSlider();
95 QLayout * createMainLayout();
96 QGroupBox * createControlGroupBox();
97 QGroupBox * createComponentListGroupBox();
98 void updateComponentList();
99
100private:
101 DbtPlyEngine * mEngine;
102
103 QWidget * wTel_ ;
104 QButtonGroup * butGroup;
105 QPushButton * playBut ;
106 QPushButton * pauseBut ;
107 QPushButton * stopBut ;
108 QPushButton * speedUpBut ;
109 QPushButton * speedDownBut ;
110 QLabel * lab;
111 QCheckBox * rev;
112 QSlider * timeSlider;
113 QLabel * timeMinTitle;
114 QLabel * timeMinValue;
115 QLabel * timeMaxTitle;
116 QLabel * timeMaxValue;
117 QLabel * timeCurTitle;
118 QLabel * timeCurValue;
119
120 QTableWidget * componentTableWidget;
121
122 // current max time
123 road_time_t tMax_;
124 // current min time
125 road_time_t tMin_;
126 // current absolute time
127 road_time_t absTime_;
128 // current relative time
129 int relTime_;
130};
131
132} // namespace pacpus
133
134#endif // DEF_PACPUS_DBTPLYUSERINTERFACE_H
Note: See TracBrowser for help on using the repository browser.