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