[76] | 1 | // %pacpus:license{
|
---|
[73] | 2 | // This file is part of the PACPUS framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[76] | 4 | // %pacpus:license}
|
---|
[73] | 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 |
|
---|
| 26 | class QButtonGroup;
|
---|
| 27 | class QCheckBox;
|
---|
| 28 | class QCloseEvent;
|
---|
| 29 | class QGroupBox;
|
---|
| 30 | class QLabel;
|
---|
| 31 | class QLayout;
|
---|
| 32 | class QPushButton;
|
---|
| 33 | class QSlider;
|
---|
| 34 | class QTableWidget;
|
---|
| 35 |
|
---|
| 36 | namespace pacpus {
|
---|
| 37 |
|
---|
| 38 | class DbtPlyEngine;
|
---|
| 39 | class DbtPlyEngineState;
|
---|
| 40 |
|
---|
| 41 | class DBITE_PLAYER_API DbtPlyUserInterface
|
---|
| 42 | : public QWidget
|
---|
| 43 | , public ComponentBase
|
---|
| 44 | {
|
---|
| 45 | Q_OBJECT
|
---|
| 46 |
|
---|
| 47 | public:
|
---|
| 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 |
|
---|
| 63 | public 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 |
|
---|
| 76 | private:
|
---|
| 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 |
|
---|
| 96 | private:
|
---|
| 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
|
---|