source: pacpusframework/branches/2.0-beta1/include/Pacpus/DbitePlayer/DbtPlyUserInterface.h@ 89

Last change on this file since 89 was 89, checked in by morasjul, 11 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

  • 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
76private:
77 /// Configures the component.
78 virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
79
80 /// Starts component activity.
81 virtual void startActivity();
82
83 /// Stops component activity.
84 virtual void stopActivity();
85
86 void closeEvent(QCloseEvent * e);
87
88 void connectButtons();
89 void connectDisplay();
90 void connectSlider();
91 QLayout * createMainLayout();
92 QGroupBox * createControlGroupBox();
93 QGroupBox * createComponentListGroupBox();
94 void updateComponentList();
95
96private:
97 DbtPlyEngine * mEngine;
98
99 QWidget * wTel_ ;
100 QButtonGroup * butGroup;
101 QPushButton * playBut ;
102 QPushButton * pauseBut ;
103 QPushButton * stopBut ;
104 QPushButton * speedUpBut ;
105 QPushButton * speedDownBut ;
106 QLabel * lab;
107 QCheckBox * rev;
108 QSlider * timeSlider;
109 QLabel * timeMinTitle;
110 QLabel * timeMinValue;
111 QLabel * timeMaxTitle;
112 QLabel * timeMaxValue;
113 QLabel * timeCurTitle;
114 QLabel * timeCurValue;
115
116 QTableWidget * componentTableWidget;
117
118 // current max time
119 road_time_t tMax_;
120 // current min time
121 road_time_t tMin_;
122 // current absolute time
123 road_time_t absTime_;
124 // current relative time
125 int relTime_;
126};
127
128} // namespace pacpus
129
130#endif // DEF_PACPUS_DBTPLYUSERINTERFACE_H
Note: See TracBrowser for help on using the repository browser.