[89] | 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 |
|
---|
| 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);
|
---|
[152] | 75 |
|
---|
| 76 | protected:
|
---|
| 77 | virtual void addInputs();
|
---|
| 78 | virtual void addOutputs();
|
---|
[89] | 79 |
|
---|
| 80 | private:
|
---|
| 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 |
|
---|
| 100 | private:
|
---|
| 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
|
---|