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:
@@ -44,89 +44,89 @@ NodeParamViewKeyframeControl::NodeParamViewKeyframeControl(bool right_align,
|
||||
layout->addStretch();
|
||||
}
|
||||
|
||||
prev_key_btn_ = CreateNewToolButton(icon::TriLeft);
|
||||
prev_key_btn_ = create_new_tool_button(icon::tri_left);
|
||||
prev_key_btn_->setIconSize(prev_key_btn_->iconSize() / 2);
|
||||
layout->addWidget(prev_key_btn_);
|
||||
|
||||
toggle_key_btn_ = CreateNewToolButton(icon::Diamond);
|
||||
toggle_key_btn_ = create_new_tool_button(icon::diamond);
|
||||
toggle_key_btn_->setCheckable(true);
|
||||
toggle_key_btn_->setIconSize(toggle_key_btn_->iconSize() / 2);
|
||||
layout->addWidget(toggle_key_btn_);
|
||||
|
||||
next_key_btn_ = CreateNewToolButton(icon::TriRight);
|
||||
next_key_btn_ = create_new_tool_button(icon::tri_right);
|
||||
next_key_btn_->setIconSize(next_key_btn_->iconSize() / 2);
|
||||
layout->addWidget(next_key_btn_);
|
||||
|
||||
enable_key_btn_ = CreateNewToolButton(icon::Clock);
|
||||
enable_key_btn_ = create_new_tool_button(icon::clock);
|
||||
enable_key_btn_->setCheckable(true);
|
||||
enable_key_btn_->setIconSize(enable_key_btn_->iconSize() / 4 * 3);
|
||||
layout->addWidget(enable_key_btn_);
|
||||
|
||||
connect(prev_key_btn_, &QPushButton::clicked, this,
|
||||
&NodeParamViewKeyframeControl::GoToPreviousKey);
|
||||
&NodeParamViewKeyframeControl::go_to_previous_key);
|
||||
connect(next_key_btn_, &QPushButton::clicked, this,
|
||||
&NodeParamViewKeyframeControl::GoToNextKey);
|
||||
&NodeParamViewKeyframeControl::go_to_next_key);
|
||||
connect(toggle_key_btn_, &QPushButton::clicked, this,
|
||||
&NodeParamViewKeyframeControl::ToggleKeyframe);
|
||||
&NodeParamViewKeyframeControl::toggle_keyframe);
|
||||
connect(enable_key_btn_, &QPushButton::toggled, this,
|
||||
&NodeParamViewKeyframeControl::ShowButtonsFromKeyframeEnable);
|
||||
&NodeParamViewKeyframeControl::show_buttons_from_keyframe_enable);
|
||||
connect(enable_key_btn_, &QPushButton::clicked, this,
|
||||
&NodeParamViewKeyframeControl::KeyframeEnableBtnClicked);
|
||||
&NodeParamViewKeyframeControl::keyframe_enable_btn_clicked);
|
||||
|
||||
// Set defaults
|
||||
SetInput(NodeInput());
|
||||
ShowButtonsFromKeyframeEnable(false);
|
||||
set_input(NodeInput());
|
||||
show_buttons_from_keyframe_enable(false);
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::SetInput(const NodeInput &input)
|
||||
void NodeParamViewKeyframeControl::set_input(const NodeInput &input)
|
||||
{
|
||||
if (input_.IsValid()) {
|
||||
disconnect(input_.node(), &Node::KeyframeEnableChanged, this,
|
||||
&NodeParamViewKeyframeControl::KeyframeEnableChanged);
|
||||
disconnect(input_.node(), &Node::KeyframeAdded, this,
|
||||
&NodeParamViewKeyframeControl::UpdateState);
|
||||
disconnect(input_.node(), &Node::KeyframeRemoved, this,
|
||||
&NodeParamViewKeyframeControl::UpdateState);
|
||||
disconnect(input_.node(), &Node::KeyframeTimeChanged, this,
|
||||
&NodeParamViewKeyframeControl::UpdateState);
|
||||
if (input_.is_valid()) {
|
||||
disconnect(input_.node(), &Node::keyframe_enable_changed, this,
|
||||
&NodeParamViewKeyframeControl::keyframe_enable_changed);
|
||||
disconnect(input_.node(), &Node::keyframe_added, this,
|
||||
&NodeParamViewKeyframeControl::update_state);
|
||||
disconnect(input_.node(), &Node::keyframe_removed, this,
|
||||
&NodeParamViewKeyframeControl::update_state);
|
||||
disconnect(input_.node(), &Node::keyframe_time_changed, this,
|
||||
&NodeParamViewKeyframeControl::update_state);
|
||||
}
|
||||
|
||||
input_ = input;
|
||||
SetButtonsEnabled(input_.IsValid());
|
||||
set_buttons_enabled(input_.is_valid());
|
||||
|
||||
// Pick up keyframing value
|
||||
enable_key_btn_->setChecked(input_.IsValid() && input_.IsKeyframing());
|
||||
enable_key_btn_->setChecked(input_.is_valid() && input_.is_keyframing());
|
||||
|
||||
// Update buttons
|
||||
UpdateState();
|
||||
update_state();
|
||||
|
||||
if (input_.IsValid()) {
|
||||
connect(input_.node(), &Node::KeyframeEnableChanged, this,
|
||||
&NodeParamViewKeyframeControl::KeyframeEnableChanged);
|
||||
connect(input_.node(), &Node::KeyframeAdded, this,
|
||||
&NodeParamViewKeyframeControl::UpdateState);
|
||||
connect(input_.node(), &Node::KeyframeRemoved, this,
|
||||
&NodeParamViewKeyframeControl::UpdateState);
|
||||
connect(input_.node(), &Node::KeyframeTimeChanged, this,
|
||||
&NodeParamViewKeyframeControl::UpdateState);
|
||||
if (input_.is_valid()) {
|
||||
connect(input_.node(), &Node::keyframe_enable_changed, this,
|
||||
&NodeParamViewKeyframeControl::keyframe_enable_changed);
|
||||
connect(input_.node(), &Node::keyframe_added, this,
|
||||
&NodeParamViewKeyframeControl::update_state);
|
||||
connect(input_.node(), &Node::keyframe_removed, this,
|
||||
&NodeParamViewKeyframeControl::update_state);
|
||||
connect(input_.node(), &Node::keyframe_time_changed, this,
|
||||
&NodeParamViewKeyframeControl::update_state);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::TimeTargetDisconnectEvent(ViewerOutput *v)
|
||||
{
|
||||
disconnect(v, &ViewerOutput::PlayheadChanged, this,
|
||||
&NodeParamViewKeyframeControl::UpdateState);
|
||||
disconnect(v, &ViewerOutput::playhead_changed, this,
|
||||
&NodeParamViewKeyframeControl::update_state);
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::TimeTargetConnectEvent(ViewerOutput *v)
|
||||
{
|
||||
connect(v, &ViewerOutput::PlayheadChanged, this,
|
||||
&NodeParamViewKeyframeControl::UpdateState);
|
||||
UpdateState();
|
||||
connect(v, &ViewerOutput::playhead_changed, this,
|
||||
&NodeParamViewKeyframeControl::update_state);
|
||||
update_state();
|
||||
}
|
||||
|
||||
QPushButton *
|
||||
NodeParamViewKeyframeControl::CreateNewToolButton(const QIcon &icon) const
|
||||
NodeParamViewKeyframeControl::create_new_tool_button(const QIcon &icon) const
|
||||
{
|
||||
QPushButton *btn = new QPushButton();
|
||||
btn->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
@@ -135,7 +135,7 @@ NodeParamViewKeyframeControl::CreateNewToolButton(const QIcon &icon) const
|
||||
return btn;
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::SetButtonsEnabled(bool e)
|
||||
void NodeParamViewKeyframeControl::set_buttons_enabled(bool e)
|
||||
{
|
||||
prev_key_btn_->setEnabled(e);
|
||||
toggle_key_btn_->setEnabled(e);
|
||||
@@ -143,45 +143,45 @@ void NodeParamViewKeyframeControl::SetButtonsEnabled(bool e)
|
||||
enable_key_btn_->setEnabled(e);
|
||||
}
|
||||
|
||||
rational NodeParamViewKeyframeControl::GetCurrentTimeAsNodeTime() const
|
||||
Rational NodeParamViewKeyframeControl::get_current_time_as_node_time() const
|
||||
{
|
||||
return GetAdjustedTime(GetTimeTarget(), input_.node(),
|
||||
GetTimeTarget()->GetPlayhead(),
|
||||
Node::kTransformTowardsInput);
|
||||
return get_adjusted_time(get_time_target(), input_.node(),
|
||||
get_time_target()->get_playhead(),
|
||||
Node::k_transform_towards_input);
|
||||
}
|
||||
|
||||
rational
|
||||
NodeParamViewKeyframeControl::ConvertToViewerTime(const rational &r) const
|
||||
Rational
|
||||
NodeParamViewKeyframeControl::convert_to_viewer_time(const Rational &r) const
|
||||
{
|
||||
return GetAdjustedTime(input_.node(), GetTimeTarget(), r,
|
||||
Node::kTransformTowardsOutput);
|
||||
return get_adjusted_time(input_.node(), get_time_target(), r,
|
||||
Node::k_transform_towards_output);
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::ShowButtonsFromKeyframeEnable(bool e)
|
||||
void NodeParamViewKeyframeControl::show_buttons_from_keyframe_enable(bool e)
|
||||
{
|
||||
prev_key_btn_->setVisible(e);
|
||||
toggle_key_btn_->setVisible(e);
|
||||
next_key_btn_->setVisible(e);
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::ToggleKeyframe(bool e)
|
||||
void NodeParamViewKeyframeControl::toggle_keyframe(bool e)
|
||||
{
|
||||
rational node_time = GetCurrentTimeAsNodeTime();
|
||||
Rational node_time = get_current_time_as_node_time();
|
||||
|
||||
QVector<NodeKeyframe *> keys =
|
||||
input_.node()->GetKeyframesAtTime(input_, node_time);
|
||||
input_.node()->get_keyframes_at_time(input_, node_time);
|
||||
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
|
||||
int nb_tracks = input_.node()->GetNumberOfKeyframeTracks(input_);
|
||||
int nb_tracks = input_.node()->get_number_of_keyframe_tracks(input_);
|
||||
|
||||
if (e && keys.isEmpty()) {
|
||||
// Add a keyframe here (one for each track)
|
||||
for (int i = 0; i < nb_tracks; i++) {
|
||||
NodeKeyframe *key = new NodeKeyframe(
|
||||
node_time,
|
||||
input_.node()->GetSplitValueAtTimeOnTrack(input_, node_time, i),
|
||||
input_.node()->GetBestKeyframeTypeForTimeOnTrack(input_,
|
||||
input_.node()->get_split_value_at_time_on_track(input_, node_time, i),
|
||||
input_.node()->get_best_keyframe_type_for_time_on_track(input_,
|
||||
node_time, i),
|
||||
i, input_.element(), input_.input());
|
||||
|
||||
@@ -193,11 +193,11 @@ void NodeParamViewKeyframeControl::ToggleKeyframe(bool e)
|
||||
foreach (NodeKeyframe *key, keys) {
|
||||
command->add_child(new NodeParamRemoveKeyframeCommand(key));
|
||||
|
||||
if (input_.node()->GetKeyframeTracks(input_).size() == 1) {
|
||||
if (input_.node()->get_keyframe_tracks(input_).size() == 1) {
|
||||
// If this was the last keyframe on this track, set the standard value to the value at this time too
|
||||
command->add_child(new NodeParamSetStandardValueCommand(
|
||||
NodeKeyframeTrackReference(input_, key->track()),
|
||||
input_.node()->GetSplitValueAtTimeOnTrack(input_, node_time,
|
||||
input_.node()->get_split_value_at_time_on_track(input_, node_time,
|
||||
key->track())));
|
||||
}
|
||||
}
|
||||
@@ -206,52 +206,52 @@ void NodeParamViewKeyframeControl::ToggleKeyframe(bool e)
|
||||
Core::instance()->undo_stack()->push(command, tr("Toggled Keyframe"));
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::UpdateState()
|
||||
void NodeParamViewKeyframeControl::update_state()
|
||||
{
|
||||
if (!input_.IsValid() || !input_.IsKeyframing() || !GetTimeTarget()) {
|
||||
if (!input_.is_valid() || !input_.is_keyframing() || !get_time_target()) {
|
||||
return;
|
||||
}
|
||||
|
||||
NodeKeyframe *earliest_key = input_.node()->GetEarliestKeyframe(input_);
|
||||
NodeKeyframe *latest_key = input_.node()->GetLatestKeyframe(input_);
|
||||
NodeKeyframe *earliest_key = input_.node()->get_earliest_keyframe(input_);
|
||||
NodeKeyframe *latest_key = input_.node()->get_latest_keyframe(input_);
|
||||
|
||||
rational node_time = GetCurrentTimeAsNodeTime();
|
||||
Rational node_time = get_current_time_as_node_time();
|
||||
|
||||
prev_key_btn_->setEnabled(earliest_key && node_time > earliest_key->time());
|
||||
next_key_btn_->setEnabled(latest_key && node_time < latest_key->time());
|
||||
toggle_key_btn_->setChecked(
|
||||
input_.node()->HasKeyframeAtTime(input_, node_time));
|
||||
input_.node()->has_keyframe_at_time(input_, node_time));
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::GoToPreviousKey()
|
||||
void NodeParamViewKeyframeControl::go_to_previous_key()
|
||||
{
|
||||
rational node_time = GetCurrentTimeAsNodeTime();
|
||||
Rational node_time = get_current_time_as_node_time();
|
||||
|
||||
NodeKeyframe *previous_key =
|
||||
input_.node()->GetClosestKeyframeBeforeTime(input_, node_time);
|
||||
input_.node()->get_closest_keyframe_before_time(input_, node_time);
|
||||
|
||||
if (previous_key && GetTimeTarget()) {
|
||||
rational key_time = ConvertToViewerTime(previous_key->time());
|
||||
GetTimeTarget()->SetPlayhead(key_time);
|
||||
if (previous_key && get_time_target()) {
|
||||
Rational key_time = convert_to_viewer_time(previous_key->time());
|
||||
get_time_target()->set_playhead(key_time);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::GoToNextKey()
|
||||
void NodeParamViewKeyframeControl::go_to_next_key()
|
||||
{
|
||||
rational node_time = GetCurrentTimeAsNodeTime();
|
||||
Rational node_time = get_current_time_as_node_time();
|
||||
|
||||
NodeKeyframe *next_key =
|
||||
input_.node()->GetClosestKeyframeAfterTime(input_, node_time);
|
||||
input_.node()->get_closest_keyframe_after_time(input_, node_time);
|
||||
|
||||
if (next_key && GetTimeTarget()) {
|
||||
rational key_time = ConvertToViewerTime(next_key->time());
|
||||
GetTimeTarget()->SetPlayhead(key_time);
|
||||
if (next_key && get_time_target()) {
|
||||
Rational key_time = convert_to_viewer_time(next_key->time());
|
||||
get_time_target()->set_playhead(key_time);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
void NodeParamViewKeyframeControl::keyframe_enable_btn_clicked(bool e)
|
||||
{
|
||||
if (e == input_.IsKeyframing()) {
|
||||
if (e == input_.is_keyframing()) {
|
||||
// No-op
|
||||
return;
|
||||
}
|
||||
@@ -266,12 +266,12 @@ void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
|
||||
// Create one keyframe across all tracks here
|
||||
const QVector<QVariant> &key_vals =
|
||||
input_.node()->GetSplitStandardValue(input_);
|
||||
input_.node()->get_split_standard_value(input_);
|
||||
|
||||
for (int i = 0; i < key_vals.size(); i++) {
|
||||
NodeKeyframe *key =
|
||||
new NodeKeyframe(GetCurrentTimeAsNodeTime(), key_vals.at(i),
|
||||
NodeKeyframe::kDefaultType, i,
|
||||
new NodeKeyframe(get_current_time_as_node_time(), key_vals.at(i),
|
||||
NodeKeyframe::k_default_type, i,
|
||||
input_.element(), input_.input());
|
||||
|
||||
command->add_child(
|
||||
@@ -280,7 +280,7 @@ void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
|
||||
command_name =
|
||||
tr("Enabled Keyframing On %1 - %2")
|
||||
.arg(input_.node()->GetLabelAndName(), input_.GetInputName());
|
||||
.arg(input_.node()->get_label_and_name(), input_.get_input_name());
|
||||
} else {
|
||||
// Confirm the user wants to clear all keyframes
|
||||
if (QMessageBox::warning(
|
||||
@@ -289,12 +289,12 @@ void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
// Store value at this time, we'll set this as the persistent value later
|
||||
const QVector<QVariant> &stored_vals =
|
||||
input_.node()->GetSplitValueAtTime(input_,
|
||||
GetCurrentTimeAsNodeTime());
|
||||
input_.node()->get_split_value_at_time(input_,
|
||||
get_current_time_as_node_time());
|
||||
|
||||
// Delete all keyframes
|
||||
foreach (const NodeKeyframeTrack &track,
|
||||
input_.node()->GetKeyframeTracks(input_)) {
|
||||
input_.node()->get_keyframe_tracks(input_)) {
|
||||
for (int i = track.size() - 1; i >= 0; i--) {
|
||||
command->add_child(
|
||||
new NodeParamRemoveKeyframeCommand(track.at(i)));
|
||||
@@ -312,8 +312,8 @@ void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
new NodeParamSetKeyframingCommand(input_, false));
|
||||
|
||||
command_name = tr("Disabled Keyframing On %1 - %2")
|
||||
.arg(input_.node()->GetLabelAndName(),
|
||||
input_.GetInputName());
|
||||
.arg(input_.node()->get_label_and_name(),
|
||||
input_.get_input_name());
|
||||
} else {
|
||||
// Disable action has effectively been ignored
|
||||
enable_key_btn_->setChecked(true);
|
||||
@@ -323,7 +323,7 @@ void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
Core::instance()->undo_stack()->push(command, command_name);
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::KeyframeEnableChanged(const NodeInput &input,
|
||||
void NodeParamViewKeyframeControl::keyframe_enable_changed(const NodeInput &input,
|
||||
bool e)
|
||||
{
|
||||
if (input_ == input) {
|
||||
|
||||
Reference in New Issue
Block a user