Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_switch_current_time_command.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
9#include "kis_image.h"
11#include "kis_command_ids.h"
13#include "kis_node.h"
14
15
17 : KUndo2Command(kundo2_i18n("Switch current time"), parent),
18 m_animation(animation),
19 m_oldTime(oldTime),
20 m_newTime(newTime)
21{
22}
23
27
32
34{
35 const KisSwitchCurrentTimeCommand *other =
36 dynamic_cast<const KisSwitchCurrentTimeCommand*>(command);
37
38 if (!other || other->id() != id()) {
39 return false;
40 }
41
42 m_newTime = other->m_newTime;
43 return true;
44}
45
50
55
56// ====================================//
57
59 : KUndo2Command(kundo2_i18n("Switch current time to keyframe"), parent),
60 m_animation(animation),
61 m_oldTime(oldTime),
62 m_node(node),
63 m_channelId(channelId),
64 m_targetKeyframe(targetKeyframe)
65{
66}
67
71
76
78{
79 // Note: Maybe we could merge this with a regular time switch command with a bit more logic.
81 dynamic_cast<const KisSwitchCurrentTimeToKeyframeCommand*>(command);
82
83 if (!other || other->id() != id()) {
84 return false;
85 }
86
88 return true;
89}
90
99
void requestTimeSwitchNonGUI(int time, bool useUndo=false)
KisKeyframeChannel stores and manages KisKeyframes. Maps units of time to virtual keyframe values....
int lookupKeyframeTime(KisKeyframeSP toLookup)
Search for the time for a given keyframe. (Reverse map lookup, so use sparingly.)
KisImageAnimationInterface * m_animation
KisSwitchCurrentTimeCommand(KisImageAnimationInterface *animation, int oldTime, int newTime, KUndo2Command *parent=0)
bool mergeWith(const KUndo2Command *command) override
KisSwitchCurrentTimeToKeyframeCommand(KisImageAnimationInterface *animation, int oldTime, KisNodeSP node, KoID channelId, KisKeyframeSP targetKeyframe, KUndo2Command *parent=0)
bool mergeWith(const KUndo2Command *command) override
Definition KoID.h:30
QString id() const
Definition KoID.cpp:63
KUndo2MagicString kundo2_i18n(const char *text)
KisKeyframeChannel * getKeyframeChannel(const QString &id, bool create)