Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • app
  • src
timecontrols.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU 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#include <QLabel>
27
28class Editor;
29class PreferenceManager;
30class TimeLine;
31
32class TimeControls : public QToolBar
33{
34 Q_OBJECT
35
36public:
37 TimeControls(TimeLine* parent = nullptr);
38 void initUI();
39 void updateUI();
40 void setEditor(Editor* editor);
41 void setFps(int value);
42 void setLoop(bool);
43 void setRangeState(bool);
44
45 void updateLength(int frameLength);
46 void updatePlayState();
47
48 int getRangeLower() { return mPlaybackRangeCheckBox->isChecked() ? mLoopStartSpinBox->value() : -1; }
49 int getRangeUpper() { return mPlaybackRangeCheckBox->isChecked() ? mLoopEndSpinBox->value() : -1; }
50
51signals:
52 void soundToggled(bool);
53 void soundScrubToggled(bool);
54 void fpsChanged(int);
55 void playButtonTriggered();
56
57public slots:
59 void onFpsEditingFinished();
60 void updateTimecodeLabel(int frame);
61
62private:
63 void makeConnections();
64
65 void playButtonClicked();
66 void jumpToStartButtonClicked();
67 void jumpToEndButtonClicked();
68 void loopButtonClicked(bool bChecked);
69 void playbackRangeClicked(bool bChecked);
70 void loopStartValueChanged(int);
71 void loopEndValueChanged(int);
72 void updateSoundScrubIcon(bool soundScrubEnabled);
73
74 void noTimecodeText();
75 void onlyFramesText();
76 void sffText();
77 void smpteText();
78
79private:
80 QPushButton* mPlayButton = nullptr;
81 QPushButton* mJumpToEndButton = nullptr;
82 QPushButton* mJumpToStartButton = nullptr;
83 QPushButton* mLoopButton = nullptr;
84 QPushButton* mSoundButton = nullptr;
85 QPushButton* mSoundScrubButton = nullptr;
86 QSpinBox* mFpsBox = nullptr;
87 QCheckBox* mPlaybackRangeCheckBox = nullptr;
88 QSpinBox* mLoopStartSpinBox = nullptr;
89 QSpinBox* mLoopEndSpinBox = nullptr;
90 QToolButton* mTimecodeSelect = nullptr;
91 QLabel* mTimecodeLabel = nullptr;
92 QAction* mNoTimecodeAction = nullptr;
93 QAction* mOnlyFramesAction = nullptr;
94 QAction* mSmpteAction = nullptr;
95 QAction* mSffAction = nullptr;
96 QAction* mTimecodeLabelAction = nullptr;
97
98 QIcon mStartIcon;
99 QIcon mStopIcon;
100 QIcon mLoopIcon;
101 QIcon mSoundIcon;
102 QIcon mSoundScrubIcon;
103 QIcon mJumpToEndIcon;
104 QIcon mJumpToStartIcon;
105
106 TimeLine* mTimeline = nullptr;
107 Editor* mEditor = nullptr;
108 int mFps = 12;
109 int mTimecodeLabelEnum;
110};
111
112#endif
Editor
Definition: editor.h:71
PreferenceManager
Definition: preferencemanager.h:28
TimeControls
Definition: timecontrols.h:33
TimeControls::onFpsEditingFinished
void onFpsEditingFinished()
Work-around in case the FPS spin-box "valueChanged" signal doesn't work.
Definition: timecontrols.cpp:358
TimeLine
Definition: timeline.h:32
QAbstractButton::isChecked
bool isChecked() const const
QAction
QCheckBox
QIcon
QLabel
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QPushButton
QSpinBox
QSpinBox::value
value
QToolBar
QToolButton
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39