AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
PlaybackController.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXQT_PLAYBACKCONTROLLER_H
18#define AGXQT_PLAYBACKCONTROLLER_H
19
20#include <agx/TimeStamp.h>
21#include <agx/agx.h>
22#include <agxQt/export.h>
23#include <iostream>
24
25#include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
26#include <QWidget>
27#include <agxQt/ui_Controller.h>
28#include <agx/PopDisableWarnings.h> // End of disabled warnings.
29
30namespace agxQt
31{
36 {
37 Q_OBJECT
38
39 public:
41 {
43 PAUSED
44 };
45
46 public:
47
48 explicit PlaybackControllerWidget(QWidget *parent = 0);
50
51 void setEnable(bool enable);
52
53 bool eventFilter(QObject * watched, QEvent * event);
54
55 public slots:
58 void slotInitNewPlayback(float timeStart, float timeEnd, uint maxFrames );
60 void slotTimeChanged(float time);
61
62 // Public slots used to push buttons the in the GUI
68
70
71 signals:
72 void signalSliderTimeJump(float time);
73 void signalPlay();
75 void signalStop();
78 void signalSpeedChanged(uint speed);
79 void signalEnableJournalLoop(bool enable);
80
81 // Internal slots
82 private slots:
83 void slotSliderChanged(int value);
84 void slotStopPushed();
85 void slotForwardPushed();
86 void slotBackPushed();
87 void slotPlayPausePushed();
88 void slotSliderPressed();
89 void slotSliderReleased();
90
91 void slotIncrementSpeedPushed();
92 void slotDecrementSpeedPushed();
93 void slotLoopCheckBoxPressed();
94
95 protected:
96 void setEnablePlaybackGui(bool enable);
99 void init();
105
107 // Variables
109 private:
110 Ui::Controller * m_ui;
111
112 bool m_enable;
113 bool isInPlayback;
114 agx::UInt m_speedModifier;
115 ControllerState m_state;
116
117 agx::UInt m_maxFrames;
118 agx::TimeStamp m_startTime;
119 agx::TimeStamp m_endTime;
120
121 QIcon m_playIcon;
122 QIcon m_stopIcon;
123 QIcon m_pauseIcon;
124 QIcon m_stepForwardIcon;
125 QIcon m_speedForwardIcon;
126 QIcon m_speedBackwardIcon;
127 QIcon m_stepBackIcon;
128
129 bool m_sliderPressed;
130 };
131}
132
133#endif
#define AGXQT_EXPORT
float getCurrentTimeFromPlaybackSliderValue(int val)
PlaybackControllerWidget(QWidget *parent=0)
void setEnablePlaybackGui(bool enable)
void slotSetEnableRecordingNotifier(bool enable)
void slotInitNewPlayback(float timeStart, float timeEnd, uint maxFrames)
void slotTimeChanged(float time)
void signalSpeedChanged(uint speed)
bool eventFilter(QObject *watched, QEvent *event)
void signalSliderTimeJump(float time)
void setControllerState(ControllerState state)
void signalEnableJournalLoop(bool enable)
Contains classes/utility functions for connecting AGX to QT with OSG.
uint64_t UInt
Definition Integer.h:27
agx::Real TimeStamp
Definition TimeStamp.h:26