style: unify identifier naming per updated conventions
Automated with clang-tidy readability-identifier-naming (config added to .clang-tidy) plus scripted passes, per the updated rules now documented in CONTRIBUTING.md: - types (class/struct/enum/alias/template params): PascalCase - functions, variables, members: snake_case (incl. rational -> Rational) - private/protected members: trailing underscore; static member variables likewise (instance_, available_themes_) - constants and enum values: snake_case (kLinear -> k_linear, F32P -> f32p); ALL_CAPS reserved for macros - macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG -> OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE, include guards -> OAK_*) - file names: all lowercase (Current/Plugin/OliveHost/OliveClip/ OlivePluginInstance -> current/plugin/olivehost/oliveclip/ oliveplugininstance) - getters share the member name sans underscore, setters set_foo() - Qt and third-party (OpenFX) virtual overrides and framework callbacks keep their original names (exempt in .clang-tidy) Manual follow-ups required where automation could not reach: - string-based QMetaObject/SIGNAL/SLOT references updated to renamed methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...) - macro bodies referencing renamed methods (OLIVE_CONFIG, NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*) - self-shadowing locals renamed where signals/methods became same-named (size_changed, worker_count, selected_items, import param, filters) - third_party OFX member/namespace usages restored (OFX::Host::*, _created, _clipPrefsDirty, createInstance, clearPersistentMessage) - STL protocol aliases restored (const_iterator) with .clang-tidy ignore rules; qHash overloads restored Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
@@ -48,53 +48,53 @@ KeyframeView::KeyframeView(QWidget *parent)
|
||||
, first_chance_mouse_event_(false)
|
||||
{
|
||||
setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||
SetDefaultDragMode(RubberBandDrag);
|
||||
set_default_drag_mode(RubberBandDrag);
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
connect(this, &KeyframeView::customContextMenuRequested, this,
|
||||
&KeyframeView::ShowContextMenu);
|
||||
&KeyframeView::show_context_menu);
|
||||
}
|
||||
|
||||
void KeyframeView::DeleteSelected()
|
||||
void KeyframeView::delete_selected()
|
||||
{
|
||||
if (!selection_manager_.IsDragging()) {
|
||||
if (!selection_manager_.is_dragging()) {
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
|
||||
foreach (NodeKeyframe *key, GetSelectedKeyframes()) {
|
||||
foreach (NodeKeyframe *key, get_selected_keyframes()) {
|
||||
command->add_child(new NodeParamRemoveKeyframeCommand(key));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(
|
||||
command,
|
||||
tr("Deleted %1 Keyframe(s)").arg(GetSelectedKeyframes().size()));
|
||||
tr("Deleted %1 Keyframe(s)").arg(get_selected_keyframes().size()));
|
||||
}
|
||||
}
|
||||
|
||||
KeyframeView::NodeConnections KeyframeView::AddKeyframesOfNode(Node *n)
|
||||
KeyframeView::NodeConnections KeyframeView::add_keyframes_of_node(Node *n)
|
||||
{
|
||||
NodeConnections map;
|
||||
|
||||
foreach (const QString &i, n->inputs()) {
|
||||
map.insert(i, AddKeyframesOfInput(n, i));
|
||||
map.insert(i, add_keyframes_of_input(n, i));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
KeyframeView::InputConnections
|
||||
KeyframeView::AddKeyframesOfInput(Node *on, const QString &oinput)
|
||||
KeyframeView::add_keyframes_of_input(Node *on, const QString &oinput)
|
||||
{
|
||||
InputConnections vec;
|
||||
|
||||
NodeInput resolved = NodeGroup::ResolveInput(NodeInput(on, oinput));
|
||||
NodeInput resolved = NodeGroup::resolve_input(NodeInput(on, oinput));
|
||||
Node *n = resolved.node();
|
||||
const QString &input = resolved.input();
|
||||
|
||||
if (n->IsInputKeyframable(input)) {
|
||||
int arr_sz = n->InputArraySize(input);
|
||||
if (n->is_input_keyframable(input)) {
|
||||
int arr_sz = n->input_array_size(input);
|
||||
vec.resize(arr_sz + 1);
|
||||
for (int i = -1; i < arr_sz; i++) {
|
||||
vec[i + 1] = AddKeyframesOfElement(NodeInput(n, input, i));
|
||||
vec[i + 1] = add_keyframes_of_element(NodeInput(n, input, i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,114 +102,114 @@ KeyframeView::AddKeyframesOfInput(Node *on, const QString &oinput)
|
||||
}
|
||||
|
||||
KeyframeView::ElementConnections
|
||||
KeyframeView::AddKeyframesOfElement(const NodeInput &input)
|
||||
KeyframeView::add_keyframes_of_element(const NodeInput &input)
|
||||
{
|
||||
const QVector<NodeKeyframeTrack> &tracks =
|
||||
input.node()->GetKeyframeTracks(input);
|
||||
input.node()->get_keyframe_tracks(input);
|
||||
ElementConnections vec(tracks.size());
|
||||
|
||||
for (int i = 0; i < tracks.size(); i++) {
|
||||
vec[i] = AddKeyframesOfTrack(NodeKeyframeTrackReference(input, i));
|
||||
vec[i] = add_keyframes_of_track(NodeKeyframeTrackReference(input, i));
|
||||
}
|
||||
|
||||
return vec;
|
||||
}
|
||||
|
||||
KeyframeViewInputConnection *
|
||||
KeyframeView::AddKeyframesOfTrack(const NodeKeyframeTrackReference &ref)
|
||||
KeyframeView::add_keyframes_of_track(const NodeKeyframeTrackReference &ref)
|
||||
{
|
||||
KeyframeViewInputConnection *track =
|
||||
new KeyframeViewInputConnection(ref, this);
|
||||
connect(track, &KeyframeViewInputConnection::RequireUpdate, this,
|
||||
&KeyframeView::Redraw);
|
||||
connect(track, &KeyframeViewInputConnection::require_update, this,
|
||||
&KeyframeView::redraw);
|
||||
tracks_.append(track);
|
||||
Redraw();
|
||||
redraw();
|
||||
return track;
|
||||
}
|
||||
|
||||
void KeyframeView::RemoveKeyframesOfTrack(
|
||||
void KeyframeView::remove_keyframes_of_track(
|
||||
KeyframeViewInputConnection *connection)
|
||||
{
|
||||
if (tracks_.removeOne(connection)) {
|
||||
foreach (NodeKeyframe *key, connection->GetKeyframes()) {
|
||||
selection_manager_.Deselect(key);
|
||||
foreach (NodeKeyframe *key, connection->get_keyframes()) {
|
||||
selection_manager_.deselect(key);
|
||||
}
|
||||
delete connection;
|
||||
Redraw();
|
||||
emit SelectionChanged();
|
||||
redraw();
|
||||
emit selection_changed();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeView::SelectAll()
|
||||
void KeyframeView::select_all()
|
||||
{
|
||||
foreach (KeyframeViewInputConnection *track, tracks_) {
|
||||
foreach (NodeKeyframe *key, track->GetKeyframes()) {
|
||||
SelectKeyframe(key);
|
||||
foreach (NodeKeyframe *key, track->get_keyframes()) {
|
||||
select_keyframe(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeView::DeselectAll()
|
||||
void KeyframeView::deselect_all()
|
||||
{
|
||||
selection_manager_.ClearSelection();
|
||||
selection_manager_.clear_selection();
|
||||
|
||||
Redraw();
|
||||
redraw();
|
||||
}
|
||||
|
||||
void KeyframeView::Clear()
|
||||
void KeyframeView::clear()
|
||||
{
|
||||
if (!tracks_.isEmpty()) {
|
||||
qDeleteAll(tracks_);
|
||||
tracks_.clear();
|
||||
Redraw();
|
||||
redraw();
|
||||
}
|
||||
|
||||
selection_manager_.ClearSelection();
|
||||
selection_manager_.clear_selection();
|
||||
}
|
||||
|
||||
void KeyframeView::SelectionManagerSelectEvent(void *obj)
|
||||
{
|
||||
if (autoselect_siblings_) {
|
||||
NodeKeyframe *key = static_cast<NodeKeyframe *>(obj);
|
||||
QVector<NodeKeyframe *> keys = key->parent()->GetKeyframesAtTime(
|
||||
QVector<NodeKeyframe *> keys = key->parent()->get_keyframes_at_time(
|
||||
key->input(), key->time(), key->element());
|
||||
foreach (NodeKeyframe *k, keys) {
|
||||
if (k != key) {
|
||||
SelectKeyframe(k);
|
||||
select_keyframe(k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit SelectionChanged();
|
||||
emit selection_changed();
|
||||
}
|
||||
|
||||
void KeyframeView::SelectionManagerDeselectEvent(void *obj)
|
||||
{
|
||||
if (autoselect_siblings_) {
|
||||
NodeKeyframe *key = static_cast<NodeKeyframe *>(obj);
|
||||
QVector<NodeKeyframe *> keys = key->parent()->GetKeyframesAtTime(
|
||||
QVector<NodeKeyframe *> keys = key->parent()->get_keyframes_at_time(
|
||||
key->input(), key->time(), key->element());
|
||||
foreach (NodeKeyframe *k, keys) {
|
||||
if (k != key) {
|
||||
DeselectKeyframe(k);
|
||||
deselect_keyframe(k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit SelectionChanged();
|
||||
emit selection_changed();
|
||||
}
|
||||
|
||||
bool KeyframeView::CopySelected(bool cut)
|
||||
bool KeyframeView::copy_selected(bool cut)
|
||||
{
|
||||
if (!selection_manager_.GetSelectedObjects().empty()) {
|
||||
ProjectSerializer::SaveData sdata(ProjectSerializer::kOnlyKeyframes);
|
||||
sdata.SetOnlySerializeKeyframes(
|
||||
selection_manager_.GetSelectedObjects());
|
||||
if (!selection_manager_.get_selected_objects().empty()) {
|
||||
ProjectSerializer::SaveData sdata(ProjectSerializer::k_only_keyframes);
|
||||
sdata.set_only_serialize_keyframes(
|
||||
selection_manager_.get_selected_objects());
|
||||
|
||||
ProjectSerializer::Copy(sdata);
|
||||
ProjectSerializer::copy(sdata);
|
||||
|
||||
if (cut) {
|
||||
DeleteSelected();
|
||||
delete_selected();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -218,28 +218,28 @@ bool KeyframeView::CopySelected(bool cut)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool KeyframeView::Paste(
|
||||
bool KeyframeView::paste(
|
||||
std::function<Node *(const QString &)> find_node_function)
|
||||
{
|
||||
if (!GetViewerNode()) {
|
||||
if (!get_viewer_node()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ProjectSerializer::Result res =
|
||||
ProjectSerializer::Paste(ProjectSerializer::kOnlyKeyframes);
|
||||
if (res == ProjectSerializer::kSuccess) {
|
||||
ProjectSerializer::paste(ProjectSerializer::k_only_keyframes);
|
||||
if (res == ProjectSerializer::k_success) {
|
||||
const ProjectSerializer::SerializedKeyframes &keys =
|
||||
res.GetLoadData().keyframes;
|
||||
res.get_load_data().keyframes;
|
||||
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
|
||||
rational min = RATIONAL_MAX;
|
||||
Rational min = RATIONAL_MAX;
|
||||
for (auto it = keys.cbegin(); it != keys.cend(); it++) {
|
||||
for (NodeKeyframe *key : it.value()) {
|
||||
min = std::min(min, key->time());
|
||||
}
|
||||
}
|
||||
min -= GetViewerNode()->GetPlayhead();
|
||||
min -= get_viewer_node()->get_playhead();
|
||||
|
||||
for (auto it = keys.cbegin(); it != keys.cend(); it++) {
|
||||
const QString &paste_id = it.key();
|
||||
@@ -250,13 +250,13 @@ bool KeyframeView::Paste(
|
||||
if (node_with_id) {
|
||||
for (NodeKeyframe *key : it.value()) {
|
||||
// Adjust sequence time to node's time
|
||||
rational t = key->time() - min;
|
||||
t = GetAdjustedTime(GetTimeTarget(), node_with_id, t,
|
||||
Node::kTransformTowardsInput);
|
||||
Rational t = key->time() - min;
|
||||
t = get_adjusted_time(get_time_target(), node_with_id, t,
|
||||
Node::k_transform_towards_input);
|
||||
key->set_time(t);
|
||||
|
||||
if (NodeKeyframe *existing =
|
||||
node_with_id->GetKeyframeAtTimeOnTrack(
|
||||
node_with_id->get_keyframe_at_time_on_track(
|
||||
key->input(), key->time(), key->track(),
|
||||
key->element())) {
|
||||
command->add_child(
|
||||
@@ -283,83 +283,83 @@ void KeyframeView::CatchUpScrollEvent()
|
||||
{
|
||||
super::CatchUpScrollEvent();
|
||||
|
||||
this->selection_manager_.ForceDragUpdate();
|
||||
this->selection_manager_.force_drag_update();
|
||||
}
|
||||
|
||||
void KeyframeView::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
NodeKeyframe *key_under_cursor =
|
||||
selection_manager_.GetObjectAtPoint(event->pos());
|
||||
selection_manager_.get_object_at_point(event->pos());
|
||||
|
||||
if (HandPress(event) || (!key_under_cursor && PlayheadPress(event))) {
|
||||
if (hand_press(event) || (!key_under_cursor && playhead_press(event))) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do mouse press things
|
||||
if (FirstChanceMousePress(event)) {
|
||||
if (first_chance_mouse_press(event)) {
|
||||
first_chance_mouse_event_ = true;
|
||||
} else if (NodeKeyframe *initial_key =
|
||||
selection_manager_.MousePress(event)) {
|
||||
selection_manager_.DragStart(initial_key, event, this);
|
||||
KeyframeDragStart(event);
|
||||
selection_manager_.mouse_press(event)) {
|
||||
selection_manager_.drag_start(initial_key, event, this);
|
||||
keyframe_drag_start(event);
|
||||
} else {
|
||||
selection_manager_.RubberBandStart(event);
|
||||
selection_manager_.rubber_band_start(event);
|
||||
}
|
||||
|
||||
// Update view
|
||||
Redraw();
|
||||
redraw();
|
||||
}
|
||||
|
||||
void KeyframeView::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
if (HandMove(event) || PlayheadMove(event)) {
|
||||
if (hand_move(event) || playhead_move(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (first_chance_mouse_event_) {
|
||||
FirstChanceMouseMove(event);
|
||||
} else if (selection_manager_.IsDragging()) {
|
||||
first_chance_mouse_move(event);
|
||||
} else if (selection_manager_.is_dragging()) {
|
||||
QString tip;
|
||||
KeyframeDragMove(event, tip);
|
||||
selection_manager_.DragMove(event->pos(), tip);
|
||||
} else if (selection_manager_.IsRubberBanding()) {
|
||||
selection_manager_.RubberBandMove(event->pos());
|
||||
Redraw();
|
||||
keyframe_drag_move(event, tip);
|
||||
selection_manager_.drag_move(event->pos(), tip);
|
||||
} else if (selection_manager_.is_rubber_banding()) {
|
||||
selection_manager_.rubber_band_move(event->pos());
|
||||
redraw();
|
||||
}
|
||||
|
||||
if (event->buttons()) {
|
||||
// Signal cursor pos in case we should scroll to catch up to it
|
||||
emit Dragged(event->pos().x(), event->pos().y());
|
||||
emit dragged(event->pos().x(), event->pos().y());
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeView::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (HandRelease(event) || PlayheadRelease(event)) {
|
||||
if (hand_release(event) || playhead_release(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (first_chance_mouse_event_) {
|
||||
FirstChanceMouseRelease(event);
|
||||
first_chance_mouse_release(event);
|
||||
first_chance_mouse_event_ = false;
|
||||
} else if (selection_manager_.IsDragging()) {
|
||||
} else if (selection_manager_.is_dragging()) {
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
selection_manager_.DragStop(command);
|
||||
KeyframeDragRelease(event, command);
|
||||
selection_manager_.drag_stop(command);
|
||||
keyframe_drag_release(event, command);
|
||||
Core::instance()->undo_stack()->push(
|
||||
command, tr("Moved %1 Keyframe(s)")
|
||||
.arg(selection_manager_.GetSelectedObjects().size()));
|
||||
} else if (selection_manager_.IsRubberBanding()) {
|
||||
selection_manager_.RubberBandStop();
|
||||
Redraw();
|
||||
emit SelectionChanged();
|
||||
.arg(selection_manager_.get_selected_objects().size()));
|
||||
} else if (selection_manager_.is_rubber_banding()) {
|
||||
selection_manager_.rubber_band_stop();
|
||||
redraw();
|
||||
emit selection_changed();
|
||||
}
|
||||
|
||||
emit Released();
|
||||
emit released();
|
||||
}
|
||||
|
||||
int BinarySearchFirstKeyframeAfterOrAt(const QVector<NodeKeyframe *> &keys,
|
||||
const rational &time)
|
||||
int binary_search_first_keyframe_after_or_at(const QVector<NodeKeyframe *> &keys,
|
||||
const Rational &time)
|
||||
{
|
||||
int low = 0;
|
||||
int high = keys.size() - 1;
|
||||
@@ -384,35 +384,35 @@ int BinarySearchFirstKeyframeAfterOrAt(const QVector<NodeKeyframe *> &keys,
|
||||
|
||||
void KeyframeView::drawForeground(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
int key_sz = QtUtils::QFontMetricsWidth(fontMetrics(), "Oi");
|
||||
int key_sz = QtUtils::q_font_metrics_width(fontMetrics(), "Oi");
|
||||
int key_rad = key_sz / 2;
|
||||
|
||||
selection_manager_.ClearDrawnObjects();
|
||||
selection_manager_.clear_drawn_objects();
|
||||
|
||||
painter->setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
foreach (KeyframeViewInputConnection *track, tracks_) {
|
||||
const QVector<NodeKeyframe *> &keys = track->GetKeyframes();
|
||||
const QVector<NodeKeyframe *> &keys = track->get_keyframes();
|
||||
|
||||
if (keys.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!IsYAxisEnabled()) {
|
||||
if (!is_y_axis_enabled()) {
|
||||
// Filter out if the keyframes are offscreen Y
|
||||
qreal y = GetKeyframeSceneY(track, keys.first());
|
||||
qreal y = get_keyframe_scene_y(track, keys.first());
|
||||
if (y + key_rad < rect.top() || y - key_rad >= rect.bottom()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Find first keyframe to show with binary search
|
||||
rational left_time = GetUnadjustedKeyframeTime(
|
||||
keys.first(), SceneToTime(rect.left() - key_sz));
|
||||
int using_index = BinarySearchFirstKeyframeAfterOrAt(keys, left_time);
|
||||
Rational left_time = get_unadjusted_keyframe_time(
|
||||
keys.first(), scene_to_time(rect.left() - key_sz));
|
||||
int using_index = binary_search_first_keyframe_after_or_at(keys, left_time);
|
||||
|
||||
rational next_key = RATIONAL_MIN;
|
||||
NodeKeyframe::Type last_type = NodeKeyframe::kInvalid;
|
||||
Rational next_key = RATIONAL_MIN;
|
||||
NodeKeyframe::Type last_type = NodeKeyframe::k_invalid;
|
||||
for (int i = using_index; i < keys.size(); i++) {
|
||||
NodeKeyframe *key = keys.at(i);
|
||||
|
||||
@@ -428,7 +428,7 @@ void KeyframeView::drawForeground(QPainter *painter, const QRectF &rect)
|
||||
|
||||
if (key->time() < next_key) {
|
||||
// Next key still won't be drawn, so we'll switch to a binary search
|
||||
i = BinarySearchFirstKeyframeAfterOrAt(keys, next_key);
|
||||
i = binary_search_first_keyframe_after_or_at(keys, next_key);
|
||||
|
||||
if (i == keys.size()) {
|
||||
break;
|
||||
@@ -439,17 +439,17 @@ void KeyframeView::drawForeground(QPainter *painter, const QRectF &rect)
|
||||
}
|
||||
|
||||
QRectF key_rect(-key_rad, -key_rad, key_sz, key_sz);
|
||||
qreal key_x = GetKeyframeSceneX(key);
|
||||
key_rect.translate(key_x, GetKeyframeSceneY(track, key));
|
||||
qreal key_x = get_keyframe_scene_x(key);
|
||||
key_rect.translate(key_x, get_keyframe_scene_y(track, key));
|
||||
|
||||
if (key_rect.left() >= rect.right()) {
|
||||
// Break after last keyframe
|
||||
break;
|
||||
}
|
||||
|
||||
DrawKeyframe(painter, key, track, key_rect);
|
||||
draw_keyframe(painter, key, track, key_rect);
|
||||
|
||||
next_key = GetUnadjustedKeyframeTime(key, SceneToTime(key_x + 1));
|
||||
next_key = get_unadjusted_keyframe_time(key, scene_to_time(key_x + 1));
|
||||
last_type = key->type();
|
||||
}
|
||||
}
|
||||
@@ -457,24 +457,24 @@ void KeyframeView::drawForeground(QPainter *painter, const QRectF &rect)
|
||||
super::drawForeground(painter, rect);
|
||||
}
|
||||
|
||||
void KeyframeView::DrawKeyframe(QPainter *painter, NodeKeyframe *key,
|
||||
void KeyframeView::draw_keyframe(QPainter *painter, NodeKeyframe *key,
|
||||
KeyframeViewInputConnection *track,
|
||||
const QRectF &key_rect)
|
||||
{
|
||||
painter->setPen(Qt::black);
|
||||
|
||||
if (IsKeyframeSelected(key)) {
|
||||
if (is_keyframe_selected(key)) {
|
||||
painter->setBrush(palette().highlight());
|
||||
} else {
|
||||
painter->setBrush(track->GetBrush());
|
||||
painter->setBrush(track->get_brush());
|
||||
}
|
||||
|
||||
selection_manager_.DeclareDrawnObject(key, key_rect);
|
||||
selection_manager_.declare_drawn_object(key, key_rect);
|
||||
|
||||
switch (key->type()) {
|
||||
case NodeKeyframe::kInvalid:
|
||||
case NodeKeyframe::k_invalid:
|
||||
break;
|
||||
case NodeKeyframe::kLinear: {
|
||||
case NodeKeyframe::k_linear: {
|
||||
QPointF points[] = { QPointF(key_rect.center().x(), key_rect.top()),
|
||||
QPointF(key_rect.right(), key_rect.center().y()),
|
||||
QPointF(key_rect.center().x(), key_rect.bottom()),
|
||||
@@ -483,10 +483,10 @@ void KeyframeView::DrawKeyframe(QPainter *painter, NodeKeyframe *key,
|
||||
painter->drawPolygon(points, 4);
|
||||
break;
|
||||
}
|
||||
case NodeKeyframe::kBezier:
|
||||
case NodeKeyframe::k_bezier:
|
||||
painter->drawEllipse(key_rect);
|
||||
break;
|
||||
case NodeKeyframe::kHold:
|
||||
case NodeKeyframe::k_hold:
|
||||
painter->drawRect(key_rect);
|
||||
break;
|
||||
}
|
||||
@@ -496,19 +496,19 @@ void KeyframeView::ScaleChangedEvent(const double &scale)
|
||||
{
|
||||
super::ScaleChangedEvent(scale);
|
||||
|
||||
Redraw();
|
||||
redraw();
|
||||
}
|
||||
|
||||
void KeyframeView::TimeTargetChangedEvent(ViewerOutput *v)
|
||||
{
|
||||
Redraw();
|
||||
redraw();
|
||||
}
|
||||
|
||||
void KeyframeView::TimebaseChangedEvent(const rational &timebase)
|
||||
void KeyframeView::TimebaseChangedEvent(const Rational &timebase)
|
||||
{
|
||||
super::TimebaseChangedEvent(timebase);
|
||||
|
||||
selection_manager_.SetTimebase(timebase);
|
||||
selection_manager_.set_timebase(timebase);
|
||||
}
|
||||
|
||||
void KeyframeView::ContextMenuEvent(Menu &m)
|
||||
@@ -516,46 +516,46 @@ void KeyframeView::ContextMenuEvent(Menu &m)
|
||||
Q_UNUSED(m)
|
||||
}
|
||||
|
||||
void KeyframeView::SelectKeyframe(NodeKeyframe *key)
|
||||
void KeyframeView::select_keyframe(NodeKeyframe *key)
|
||||
{
|
||||
if (selection_manager_.Select(key)) {
|
||||
Redraw();
|
||||
if (selection_manager_.select(key)) {
|
||||
redraw();
|
||||
|
||||
emit SelectionChanged();
|
||||
emit selection_changed();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeView::DeselectKeyframe(NodeKeyframe *key)
|
||||
void KeyframeView::deselect_keyframe(NodeKeyframe *key)
|
||||
{
|
||||
if (selection_manager_.Deselect(key)) {
|
||||
Redraw();
|
||||
if (selection_manager_.deselect(key)) {
|
||||
redraw();
|
||||
|
||||
emit SelectionChanged();
|
||||
emit selection_changed();
|
||||
}
|
||||
}
|
||||
|
||||
rational KeyframeView::GetUnadjustedKeyframeTime(NodeKeyframe *key,
|
||||
const rational &time)
|
||||
Rational KeyframeView::get_unadjusted_keyframe_time(NodeKeyframe *key,
|
||||
const Rational &time)
|
||||
{
|
||||
return GetAdjustedTime(GetTimeTarget(), key->parent(), time,
|
||||
Node::kTransformTowardsInput);
|
||||
return get_adjusted_time(get_time_target(), key->parent(), time,
|
||||
Node::k_transform_towards_input);
|
||||
}
|
||||
|
||||
rational KeyframeView::GetAdjustedKeyframeTime(NodeKeyframe *key)
|
||||
Rational KeyframeView::get_adjusted_keyframe_time(NodeKeyframe *key)
|
||||
{
|
||||
return GetAdjustedTime(key->parent(), GetTimeTarget(), key->time(),
|
||||
Node::kTransformTowardsOutput);
|
||||
return get_adjusted_time(key->parent(), get_time_target(), key->time(),
|
||||
Node::k_transform_towards_output);
|
||||
}
|
||||
|
||||
double KeyframeView::GetKeyframeSceneX(NodeKeyframe *key)
|
||||
double KeyframeView::get_keyframe_scene_x(NodeKeyframe *key)
|
||||
{
|
||||
return TimeToScene(GetAdjustedKeyframeTime(key));
|
||||
return time_to_scene(get_adjusted_keyframe_time(key));
|
||||
}
|
||||
|
||||
qreal KeyframeView::GetKeyframeSceneY(KeyframeViewInputConnection *track,
|
||||
qreal KeyframeView::get_keyframe_scene_y(KeyframeViewInputConnection *track,
|
||||
NodeKeyframe *key)
|
||||
{
|
||||
return mapFromGlobal(QPoint(0, track->GetKeyframeY())).y();
|
||||
return mapFromGlobal(QPoint(0, track->get_keyframe_y())).y();
|
||||
}
|
||||
|
||||
void KeyframeView::SceneRectUpdateEvent(QRectF &rect)
|
||||
@@ -564,29 +564,29 @@ void KeyframeView::SceneRectUpdateEvent(QRectF &rect)
|
||||
rect.setHeight(max_scroll_);
|
||||
}
|
||||
|
||||
rational KeyframeView::CalculateNewTimeFromScreen(const rational &old_time,
|
||||
Rational KeyframeView::calculate_new_time_from_screen(const Rational &old_time,
|
||||
double cursor_diff)
|
||||
{
|
||||
return rational::fromDouble(old_time.toDouble() + cursor_diff);
|
||||
return Rational::from_double(old_time.to_double() + cursor_diff);
|
||||
}
|
||||
|
||||
void KeyframeView::ShowContextMenu()
|
||||
void KeyframeView::show_context_menu()
|
||||
{
|
||||
Menu m;
|
||||
|
||||
MenuShared::instance()->AddItemsForEditMenu(&m, false);
|
||||
MenuShared::instance()->add_items_for_edit_menu(&m, false);
|
||||
|
||||
QAction *linear_key_action = nullptr;
|
||||
QAction *bezier_key_action = nullptr;
|
||||
QAction *hold_key_action = nullptr;
|
||||
|
||||
if (!GetSelectedKeyframes().empty()) {
|
||||
if (!get_selected_keyframes().empty()) {
|
||||
bool all_keys_are_same_type = true;
|
||||
NodeKeyframe::Type type = GetSelectedKeyframes().front()->type();
|
||||
NodeKeyframe::Type type = get_selected_keyframes().front()->type();
|
||||
|
||||
for (size_t i = 1; i < GetSelectedKeyframes().size(); i++) {
|
||||
NodeKeyframe *key_item = GetSelectedKeyframes().at(i);
|
||||
NodeKeyframe *prev_item = GetSelectedKeyframes().at(i - 1);
|
||||
for (size_t i = 1; i < get_selected_keyframes().size(); i++) {
|
||||
NodeKeyframe *key_item = get_selected_keyframes().at(i);
|
||||
NodeKeyframe *prev_item = get_selected_keyframes().at(i - 1);
|
||||
|
||||
if (key_item->type() != prev_item->type()) {
|
||||
all_keys_are_same_type = false;
|
||||
@@ -602,15 +602,15 @@ void KeyframeView::ShowContextMenu()
|
||||
|
||||
if (all_keys_are_same_type) {
|
||||
switch (type) {
|
||||
case NodeKeyframe::kInvalid:
|
||||
case NodeKeyframe::k_invalid:
|
||||
break;
|
||||
case NodeKeyframe::kLinear:
|
||||
case NodeKeyframe::k_linear:
|
||||
linear_key_action->setChecked(true);
|
||||
break;
|
||||
case NodeKeyframe::kBezier:
|
||||
case NodeKeyframe::k_bezier:
|
||||
bezier_key_action->setChecked(true);
|
||||
break;
|
||||
case NodeKeyframe::kHold:
|
||||
case NodeKeyframe::k_hold:
|
||||
hold_key_action->setChecked(true);
|
||||
break;
|
||||
}
|
||||
@@ -621,12 +621,12 @@ void KeyframeView::ShowContextMenu()
|
||||
|
||||
ContextMenuEvent(m);
|
||||
|
||||
if (!GetSelectedKeyframes().empty()) {
|
||||
if (!get_selected_keyframes().empty()) {
|
||||
m.addSeparator();
|
||||
|
||||
QAction *properties_action = m.addAction(tr("P&roperties"));
|
||||
connect(properties_action, &QAction::triggered, this,
|
||||
&KeyframeView::ShowKeyframePropertiesDialog);
|
||||
&KeyframeView::show_keyframe_properties_dialog);
|
||||
}
|
||||
|
||||
QAction *selected = m.exec(QCursor::pos());
|
||||
@@ -638,38 +638,38 @@ void KeyframeView::ShowContextMenu()
|
||||
NodeKeyframe::Type new_type;
|
||||
|
||||
if (selected == hold_key_action) {
|
||||
new_type = NodeKeyframe::kHold;
|
||||
new_type = NodeKeyframe::k_hold;
|
||||
} else if (selected == bezier_key_action) {
|
||||
new_type = NodeKeyframe::kBezier;
|
||||
new_type = NodeKeyframe::k_bezier;
|
||||
} else {
|
||||
new_type = NodeKeyframe::kLinear;
|
||||
new_type = NodeKeyframe::k_linear;
|
||||
}
|
||||
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
foreach (NodeKeyframe *item, GetSelectedKeyframes()) {
|
||||
foreach (NodeKeyframe *item, get_selected_keyframes()) {
|
||||
command->add_child(new KeyframeSetTypeCommand(item, new_type));
|
||||
}
|
||||
Core::instance()->undo_stack()->push(
|
||||
command, tr("Set Type of %1 Keyframe(s)")
|
||||
.arg(GetSelectedKeyframes().size()));
|
||||
.arg(get_selected_keyframes().size()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeView::ShowKeyframePropertiesDialog()
|
||||
void KeyframeView::show_keyframe_properties_dialog()
|
||||
{
|
||||
if (!GetSelectedKeyframes().empty()) {
|
||||
KeyframePropertiesDialog kd(GetSelectedKeyframes(), timebase(), this);
|
||||
if (!get_selected_keyframes().empty()) {
|
||||
KeyframePropertiesDialog kd(get_selected_keyframes(), timebase(), this);
|
||||
kd.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeView::UpdateRubberBandForScroll()
|
||||
void KeyframeView::update_rubber_band_for_scroll()
|
||||
{
|
||||
this->selection_manager_.ForceDragUpdate();
|
||||
this->selection_manager_.force_drag_update();
|
||||
}
|
||||
|
||||
void KeyframeView::Redraw()
|
||||
void KeyframeView::redraw()
|
||||
{
|
||||
viewport()->update();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef KEYFRAMEVIEWBASE_H
|
||||
#define KEYFRAMEVIEWBASE_H
|
||||
#ifndef OAK_KEYFRAMEVIEWBASE_H
|
||||
#define OAK_KEYFRAMEVIEWBASE_H
|
||||
|
||||
#include <functional>
|
||||
|
||||
@@ -39,35 +39,35 @@ class KeyframeView : public TimeBasedView, public TimeTargetObject {
|
||||
public:
|
||||
KeyframeView(QWidget *parent = nullptr);
|
||||
|
||||
void DeleteSelected();
|
||||
void delete_selected();
|
||||
|
||||
using ElementConnections = QVector<KeyframeViewInputConnection *>;
|
||||
using InputConnections = QVector<ElementConnections>;
|
||||
using NodeConnections = QMap<QString, InputConnections>;
|
||||
|
||||
NodeConnections AddKeyframesOfNode(Node *n);
|
||||
NodeConnections add_keyframes_of_node(Node *n);
|
||||
|
||||
InputConnections AddKeyframesOfInput(Node *n, const QString &input);
|
||||
InputConnections add_keyframes_of_input(Node *n, const QString &input);
|
||||
|
||||
ElementConnections AddKeyframesOfElement(const NodeInput &input);
|
||||
ElementConnections add_keyframes_of_element(const NodeInput &input);
|
||||
|
||||
KeyframeViewInputConnection *
|
||||
AddKeyframesOfTrack(const NodeKeyframeTrackReference &ref);
|
||||
add_keyframes_of_track(const NodeKeyframeTrackReference &ref);
|
||||
|
||||
void RemoveKeyframesOfTrack(KeyframeViewInputConnection *connection);
|
||||
void remove_keyframes_of_track(KeyframeViewInputConnection *connection);
|
||||
|
||||
void SelectAll();
|
||||
void select_all();
|
||||
|
||||
void DeselectAll();
|
||||
void deselect_all();
|
||||
|
||||
void Clear();
|
||||
void clear();
|
||||
|
||||
const std::vector<NodeKeyframe *> &GetSelectedKeyframes() const
|
||||
const std::vector<NodeKeyframe *> &get_selected_keyframes() const
|
||||
{
|
||||
return selection_manager_.GetSelectedObjects();
|
||||
return selection_manager_.get_selected_objects();
|
||||
}
|
||||
|
||||
const QVector<KeyframeViewInputConnection *> &GetKeyframeTracks() const
|
||||
const QVector<KeyframeViewInputConnection *> &get_keyframe_tracks() const
|
||||
{
|
||||
return tracks_;
|
||||
}
|
||||
@@ -75,24 +75,24 @@ public:
|
||||
virtual void SelectionManagerSelectEvent(void *obj) override;
|
||||
virtual void SelectionManagerDeselectEvent(void *obj) override;
|
||||
|
||||
void SetMaxScroll(int i)
|
||||
void set_max_scroll(int i)
|
||||
{
|
||||
max_scroll_ = i;
|
||||
UpdateSceneRect();
|
||||
update_scene_rect();
|
||||
}
|
||||
|
||||
bool CopySelected(bool cut);
|
||||
bool copy_selected(bool cut);
|
||||
|
||||
bool Paste(std::function<Node *(const QString &)> find_node_function);
|
||||
bool paste(std::function<Node *(const QString &)> find_node_function);
|
||||
|
||||
virtual void CatchUpScrollEvent() override;
|
||||
|
||||
signals:
|
||||
void Dragged(int current_x, int current_y);
|
||||
void dragged(int current_x, int current_y);
|
||||
|
||||
void SelectionChanged();
|
||||
void selection_changed();
|
||||
|
||||
void Released();
|
||||
void released();
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||
@@ -101,7 +101,7 @@ protected:
|
||||
|
||||
virtual void drawForeground(QPainter *painter, const QRectF &rect) override;
|
||||
|
||||
virtual void DrawKeyframe(QPainter *painter, NodeKeyframe *key,
|
||||
virtual void draw_keyframe(QPainter *painter, NodeKeyframe *key,
|
||||
KeyframeViewInputConnection *track,
|
||||
const QRectF &key_rect);
|
||||
|
||||
@@ -109,55 +109,55 @@ protected:
|
||||
|
||||
virtual void TimeTargetChangedEvent(ViewerOutput *v) override;
|
||||
|
||||
virtual void TimebaseChangedEvent(const rational &timebase) override;
|
||||
virtual void TimebaseChangedEvent(const Rational &timebase) override;
|
||||
|
||||
virtual void ContextMenuEvent(Menu &m);
|
||||
|
||||
virtual bool FirstChanceMousePress(QMouseEvent *event)
|
||||
virtual bool first_chance_mouse_press(QMouseEvent *event)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual void FirstChanceMouseMove(QMouseEvent *event)
|
||||
virtual void first_chance_mouse_move(QMouseEvent *event)
|
||||
{
|
||||
}
|
||||
virtual void FirstChanceMouseRelease(QMouseEvent *event)
|
||||
virtual void first_chance_mouse_release(QMouseEvent *event)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void KeyframeDragStart(QMouseEvent *event)
|
||||
virtual void keyframe_drag_start(QMouseEvent *event)
|
||||
{
|
||||
}
|
||||
virtual void KeyframeDragMove(QMouseEvent *event, QString &tip)
|
||||
virtual void keyframe_drag_move(QMouseEvent *event, QString &tip)
|
||||
{
|
||||
}
|
||||
virtual void KeyframeDragRelease(QMouseEvent *event,
|
||||
virtual void keyframe_drag_release(QMouseEvent *event,
|
||||
MultiUndoCommand *command)
|
||||
{
|
||||
}
|
||||
|
||||
void SelectKeyframe(NodeKeyframe *key);
|
||||
void select_keyframe(NodeKeyframe *key);
|
||||
|
||||
void DeselectKeyframe(NodeKeyframe *key);
|
||||
void deselect_keyframe(NodeKeyframe *key);
|
||||
|
||||
bool IsKeyframeSelected(NodeKeyframe *key) const
|
||||
bool is_keyframe_selected(NodeKeyframe *key) const
|
||||
{
|
||||
return selection_manager_.IsSelected(key);
|
||||
return selection_manager_.is_selected(key);
|
||||
}
|
||||
|
||||
rational GetUnadjustedKeyframeTime(NodeKeyframe *key, const rational &time);
|
||||
rational GetUnadjustedKeyframeTime(NodeKeyframe *key)
|
||||
Rational get_unadjusted_keyframe_time(NodeKeyframe *key, const Rational &time);
|
||||
Rational get_unadjusted_keyframe_time(NodeKeyframe *key)
|
||||
{
|
||||
return GetUnadjustedKeyframeTime(key, key->time());
|
||||
return get_unadjusted_keyframe_time(key, key->time());
|
||||
}
|
||||
|
||||
rational GetAdjustedKeyframeTime(NodeKeyframe *key);
|
||||
Rational get_adjusted_keyframe_time(NodeKeyframe *key);
|
||||
|
||||
double GetKeyframeSceneX(NodeKeyframe *key);
|
||||
double get_keyframe_scene_x(NodeKeyframe *key);
|
||||
|
||||
virtual qreal GetKeyframeSceneY(KeyframeViewInputConnection *track,
|
||||
virtual qreal get_keyframe_scene_y(KeyframeViewInputConnection *track,
|
||||
NodeKeyframe *key);
|
||||
|
||||
void SetAutoSelectSiblings(bool e)
|
||||
void set_auto_select_siblings(bool e)
|
||||
{
|
||||
autoselect_siblings_ = e;
|
||||
}
|
||||
@@ -165,10 +165,10 @@ protected:
|
||||
virtual void SceneRectUpdateEvent(QRectF &rect) override;
|
||||
|
||||
protected slots:
|
||||
void Redraw();
|
||||
void redraw();
|
||||
|
||||
private:
|
||||
rational CalculateNewTimeFromScreen(const rational &old_time,
|
||||
Rational calculate_new_time_from_screen(const Rational &old_time,
|
||||
double cursor_diff);
|
||||
|
||||
QVector<KeyframeViewInputConnection *> tracks_;
|
||||
@@ -182,13 +182,13 @@ private:
|
||||
bool first_chance_mouse_event_;
|
||||
|
||||
private slots:
|
||||
void ShowContextMenu();
|
||||
void show_context_menu();
|
||||
|
||||
void ShowKeyframePropertiesDialog();
|
||||
void show_keyframe_properties_dialog();
|
||||
|
||||
void UpdateRubberBandForScroll();
|
||||
void update_rubber_band_for_scroll();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // KEYFRAMEVIEWBASE_H
|
||||
#endif // OAK_KEYFRAMEVIEWBASE_H
|
||||
|
||||
@@ -32,77 +32,77 @@ KeyframeViewInputConnection::KeyframeViewInputConnection(
|
||||
, keyframe_view_(parent)
|
||||
, input_(input)
|
||||
, y_(0)
|
||||
, y_behavior_(kSingleRow)
|
||||
, y_behavior_(k_single_row)
|
||||
, brush_(Qt::white)
|
||||
{
|
||||
Node *n = input.input().node();
|
||||
|
||||
connect(n, &Node::KeyframeAdded, this,
|
||||
&KeyframeViewInputConnection::AddKeyframe);
|
||||
connect(n, &Node::KeyframeRemoved, this,
|
||||
&KeyframeViewInputConnection::RemoveKeyframe);
|
||||
connect(n, &Node::KeyframeTimeChanged, this,
|
||||
&KeyframeViewInputConnection::KeyframeChanged);
|
||||
connect(n, &Node::KeyframeTypeChanged, this,
|
||||
&KeyframeViewInputConnection::KeyframeChanged);
|
||||
connect(n, &Node::KeyframeTypeChanged, this,
|
||||
&KeyframeViewInputConnection::KeyframeTypeChanged);
|
||||
connect(n, &Node::KeyframeValueChanged, this,
|
||||
&KeyframeViewInputConnection::KeyframeChanged);
|
||||
connect(n, &Node::keyframe_added, this,
|
||||
&KeyframeViewInputConnection::add_keyframe);
|
||||
connect(n, &Node::keyframe_removed, this,
|
||||
&KeyframeViewInputConnection::remove_keyframe);
|
||||
connect(n, &Node::keyframe_time_changed, this,
|
||||
&KeyframeViewInputConnection::keyframe_changed);
|
||||
connect(n, &Node::keyframe_type_changed, this,
|
||||
&KeyframeViewInputConnection::keyframe_changed);
|
||||
connect(n, &Node::keyframe_type_changed, this,
|
||||
&KeyframeViewInputConnection::keyframe_type_changed);
|
||||
connect(n, &Node::keyframe_value_changed, this,
|
||||
&KeyframeViewInputConnection::keyframe_changed);
|
||||
}
|
||||
|
||||
void KeyframeViewInputConnection::SetKeyframeY(int y)
|
||||
void KeyframeViewInputConnection::set_keyframe_y(int y)
|
||||
{
|
||||
if (y_ != y) {
|
||||
y_ = y;
|
||||
|
||||
emit RequireUpdate();
|
||||
emit require_update();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeViewInputConnection::SetYBehavior(YBehavior e)
|
||||
void KeyframeViewInputConnection::set_y_behavior(YBehavior e)
|
||||
{
|
||||
if (y_behavior_ != e) {
|
||||
y_behavior_ = e;
|
||||
|
||||
emit RequireUpdate();
|
||||
emit require_update();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeViewInputConnection::SetBrush(const QBrush &brush)
|
||||
void KeyframeViewInputConnection::set_brush(const QBrush &brush)
|
||||
{
|
||||
if (brush_ != brush) {
|
||||
brush_ = brush;
|
||||
|
||||
emit RequireUpdate();
|
||||
emit require_update();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeViewInputConnection::AddKeyframe(NodeKeyframe *key)
|
||||
void KeyframeViewInputConnection::add_keyframe(NodeKeyframe *key)
|
||||
{
|
||||
if (key->key_track_ref() == input_) {
|
||||
emit RequireUpdate();
|
||||
emit require_update();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeViewInputConnection::RemoveKeyframe(NodeKeyframe *key)
|
||||
void KeyframeViewInputConnection::remove_keyframe(NodeKeyframe *key)
|
||||
{
|
||||
if (key->key_track_ref() == input_) {
|
||||
emit RequireUpdate();
|
||||
emit require_update();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeViewInputConnection::KeyframeChanged(NodeKeyframe *key)
|
||||
void KeyframeViewInputConnection::keyframe_changed(NodeKeyframe *key)
|
||||
{
|
||||
if (key->key_track_ref() == input_) {
|
||||
emit RequireUpdate();
|
||||
emit require_update();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyframeViewInputConnection::KeyframeTypeChanged(NodeKeyframe *key)
|
||||
void KeyframeViewInputConnection::keyframe_type_changed(NodeKeyframe *key)
|
||||
{
|
||||
if (key->key_track_ref() == input_) {
|
||||
emit TypeChanged();
|
||||
emit type_changed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef KEYFRAMEVIEWINPUTCONNECTION_H
|
||||
#define KEYFRAMEVIEWINPUTCONNECTION_H
|
||||
#ifndef OAK_KEYFRAMEVIEWINPUTCONNECTION_H
|
||||
#define OAK_KEYFRAMEVIEWINPUTCONNECTION_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
@@ -38,41 +38,41 @@ public:
|
||||
KeyframeViewInputConnection(const NodeKeyframeTrackReference &input,
|
||||
KeyframeView *parent);
|
||||
|
||||
const int &GetKeyframeY() const
|
||||
const int &get_keyframe_y() const
|
||||
{
|
||||
return y_;
|
||||
}
|
||||
|
||||
void SetKeyframeY(int y);
|
||||
void set_keyframe_y(int y);
|
||||
|
||||
enum YBehavior { kSingleRow, kValueIsHeight };
|
||||
enum YBehavior { k_single_row, k_value_is_height };
|
||||
|
||||
void SetYBehavior(YBehavior e);
|
||||
void set_y_behavior(YBehavior e);
|
||||
|
||||
const QVector<NodeKeyframe *> &GetKeyframes() const
|
||||
const QVector<NodeKeyframe *> &get_keyframes() const
|
||||
{
|
||||
return input_.input()
|
||||
.node()
|
||||
->GetKeyframeTracks(input_.input())
|
||||
->get_keyframe_tracks(input_.input())
|
||||
.at(input_.track());
|
||||
}
|
||||
|
||||
const QBrush &GetBrush() const
|
||||
const QBrush &get_brush() const
|
||||
{
|
||||
return brush_;
|
||||
}
|
||||
|
||||
const NodeKeyframeTrackReference &GetReference() const
|
||||
const NodeKeyframeTrackReference &get_reference() const
|
||||
{
|
||||
return input_;
|
||||
}
|
||||
|
||||
void SetBrush(const QBrush &brush);
|
||||
void set_brush(const QBrush &brush);
|
||||
|
||||
signals:
|
||||
void RequireUpdate();
|
||||
void require_update();
|
||||
|
||||
void TypeChanged();
|
||||
void type_changed();
|
||||
|
||||
private:
|
||||
KeyframeView *keyframe_view_;
|
||||
@@ -86,15 +86,15 @@ private:
|
||||
QBrush brush_;
|
||||
|
||||
private slots:
|
||||
void AddKeyframe(NodeKeyframe *key);
|
||||
void add_keyframe(NodeKeyframe *key);
|
||||
|
||||
void RemoveKeyframe(NodeKeyframe *key);
|
||||
void remove_keyframe(NodeKeyframe *key);
|
||||
|
||||
void KeyframeChanged(NodeKeyframe *key);
|
||||
void keyframe_changed(NodeKeyframe *key);
|
||||
|
||||
void KeyframeTypeChanged(NodeKeyframe *key);
|
||||
void keyframe_type_changed(NodeKeyframe *key);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // KEYFRAMEVIEWINPUTCONNECTION_H
|
||||
#endif // OAK_KEYFRAMEVIEWINPUTCONNECTION_H
|
||||
|
||||
@@ -35,7 +35,7 @@ KeyframeSetTypeCommand::KeyframeSetTypeCommand(NodeKeyframe *key,
|
||||
{
|
||||
}
|
||||
|
||||
Project *KeyframeSetTypeCommand::GetRelevantProject() const
|
||||
Project *KeyframeSetTypeCommand::get_relevant_project() const
|
||||
{
|
||||
return key_->parent()->project();
|
||||
}
|
||||
@@ -69,7 +69,7 @@ KeyframeSetBezierControlPoint::KeyframeSetBezierControlPoint(
|
||||
{
|
||||
}
|
||||
|
||||
Project *KeyframeSetBezierControlPoint::GetRelevantProject() const
|
||||
Project *KeyframeSetBezierControlPoint::get_relevant_project() const
|
||||
{
|
||||
return key_->parent()->project();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef KEYFRAMEVIEWUNDO_H
|
||||
#define KEYFRAMEVIEWUNDO_H
|
||||
#ifndef OAK_KEYFRAMEVIEWUNDO_H
|
||||
#define OAK_KEYFRAMEVIEWUNDO_H
|
||||
|
||||
#include "node/keyframe.h"
|
||||
#include "undo/undocommand.h"
|
||||
@@ -32,7 +32,7 @@ class KeyframeSetTypeCommand : public UndoCommand {
|
||||
public:
|
||||
KeyframeSetTypeCommand(NodeKeyframe *key, NodeKeyframe::Type type);
|
||||
|
||||
virtual Project *GetRelevantProject() const override;
|
||||
virtual Project *get_relevant_project() const override;
|
||||
|
||||
protected:
|
||||
virtual void redo() override;
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
const QPointF &new_point,
|
||||
const QPointF &old_point);
|
||||
|
||||
virtual Project *GetRelevantProject() const override;
|
||||
virtual Project *get_relevant_project() const override;
|
||||
|
||||
protected:
|
||||
virtual void redo() override;
|
||||
@@ -74,4 +74,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // KEYFRAMEVIEWUNDO_H
|
||||
#endif // OAK_KEYFRAMEVIEWUNDO_H
|
||||
|
||||
Reference in New Issue
Block a user