Pencil2D  ff90c0872e88be3bf81c548cd60f01983012ec49
Pencil2D is an animation software for both bitmap and vector graphics. It is free, multi-platform, and open source.
 All Classes Functions
timecontrols.h
1 /*
2 
3 Pencil - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2017 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 #ifndef TIMECONTROL_H
18 #define TIMECONTROL_H
19 
20 #include <QWidget>
21 #include <QToolBar>
22 #include <QPushButton>
23 #include <QToolButton>
24 #include <QSpinBox>
25 #include <QCheckBox>
26 
27 class Editor;
28 class PreferenceManager;
29 class TimeLine;
30 
31 class TimeControls : public QToolBar
32 {
33  Q_OBJECT
34 
35 public:
36  TimeControls(TimeLine* parent = 0 );
37  void initUI();
38  void updateUI();
39 
40  void setFps( int value );
41  void setCore( Editor* editor );
42  void updateLength(int frameLength);
43  void updatePlayState();
44  int getRangeLower() { return mPlaybackRangeCheckBox->isChecked() ? mLoopStartSpinBox->value() : -1; }
45  int getRangeUpper() { return mPlaybackRangeCheckBox->isChecked() ? mLoopEndSpinBox->value() : -1; }
46 
47 Q_SIGNALS:
48  void soundClick( bool );
49  void fpsClick(int);
50 
51  void loopStartClick(int);
52  void loopEndClick(int);
53  void rangeStateChange();
54 
55 public slots:
56  void toggleLoop(bool);
57  void toggleLoopControl(bool);
58 
59 private:
60  void makeConnections();
61  void playButtonClicked();
62  void jumpToStartButtonClicked();
63  void jumpToEndButtonClicked();
64  void loopButtonClicked( bool bChecked );
65  void playbackRangeClicked( bool bChecked );
66  void preLoopStartClick(int);
67 
68 private slots:
69  void updateSoundIcon( bool soundEnabled );
70 
71 private:
72  QPushButton* mPlayButton = nullptr;
73  QPushButton* mJumpToEndButton = nullptr;
74  QPushButton* mJumpToStartButton = nullptr;
75  QPushButton* mLoopButton = nullptr;
76  QPushButton* mSoundButton = nullptr;
77  QSpinBox* mFpsBox = nullptr;
78  QCheckBox* mPlaybackRangeCheckBox = nullptr;
79  QSpinBox* mLoopStartSpinBox = nullptr;
80  QSpinBox* mLoopEndSpinBox = nullptr;
81 
82  QIcon mStartIcon;
83  QIcon mStopIcon;
84  QIcon mLoopIcon;
85  QIcon mSoundIcon;
86  QIcon mJumpToEndIcon;
87  QIcon mJumpToStartIcon;
88 
89 
90  Editor* mEditor = nullptr;
91 };
92 
93 #endif
Definition: editor.h:45