source: pacpusframework/trunk/include/Pacpus/DbitePlayer/DbtPlyUserInterface.h@ 351

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

Some clean-up.

  • 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{
38
39class DbtPlyEngine;
40class DbtPlyEngineState;
41
42class DBITE_PLAYER_API DbtPlyUserInterface
43 : public QWidget
44 , public ComponentBase
45{
46 Q_OBJECT
47
48public:
49 /// Constructor.
50 ///
51 /// @param name component name
52 /// @see ComponentBase::ComponentBase(QString)
53 DbtPlyUserInterface(QString name);
54
55 /// Destructor.
56 ~DbtPlyUserInterface();
57
58 /// @returns time slider value
59 int getTime();
60
61 /// sets time slider value to 0
62 void resetTime();
63
64public Q_SLOTS:
65 /// Slot.
66 /// Refreshes the state of the player.
67 void displayStateSlot(DbtPlyEngineState * state, float speed);
68
69 /// Slot.
70 /// Displays the max and min times.
71 void displayMinMaxTime(road_time_t min, road_time_t max);
72
73 /// Slot.
74 /// Displays the current time of the player.
75 void displayTime(road_time_t time);
76
77protected:
78 virtual void addInputs();
79 virtual void addOutputs();
80
81private:
82 /// Configures the component.
83 virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
84
85 /// Starts component activity.
86 virtual void startActivity();
87
88 /// Stops component activity.
89 virtual void stopActivity();
90
91 void closeEvent(QCloseEvent * e);
92
93 void connectButtons();
94 void connectDisplay();
95 void connectSlider();
96 QLayout * createMainLayout();
97 QGroupBox * createControlGroupBox();
98 QGroupBox * createComponentListGroupBox();
99 void updateComponentList();
100
101private:
102 boost::shared_ptr<DbtPlyEngine> mEngine;
103
104 QWidget * wTel_ ;
105 QButtonGroup * butGroup;
106 QPushButton * playBut ;
107 QPushButton * pauseBut ;
108 QPushButton * stopBut ;
109 QPushButton * speedUpBut ;
110 QPushButton * speedDownBut ;
111 QLabel * lab;
112 QCheckBox * rev;
113 QSlider * timeSlider;
114 QLabel * timeMinTitle;
115 QLabel * timeMinValue;
116 QLabel * timeMaxTitle;
117 QLabel * timeMaxValue;
118 QLabel * timeCurTitle;
119 QLabel * timeCurValue;
120
121 QTableWidget * componentTableWidget;
122
123 // current max time
124 road_time_t tMax_;
125 // current min time
126 road_time_t tMin_;
127 // current absolute time
128 road_time_t absTime_;
129 // current relative time
130 int relTime_;
131};
132
133} // namespace pacpus
134
135#endif // DEF_PACPUS_DBTPLYUSERINTERFACE_H
Note: See TracBrowser for help on using the repository browser.