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