Files
oak-editor/app/dialog/markerproperties/markerpropertiesdialog.cpp
T
Mike-Solar 712badbaa7 build/ci: green builds and tests on all three platforms
Compiler hygiene (all platforms):
- Silence warnings across the tree: missing override, -Wreorder ctor
  init, -Wshadow, -Wsign-compare, missing switch cases, unused
  functions/captures, Qt 6.11 deprecations (QMouseEvent/QDropEvent
  accessors, qAsConst, Q_FOREACH over non-shared containers,
  AA_UseHighDpiPixmaps) and the .bak/ backup tree removal.
- Fix regressions from the cleanup: missing clip decls in
  capi/timeline.cpp, plugin.cpp rename fallout, panel setFocus
  ambiguity, QGraphicsItem::pos vs event->position(), duplicate
  k_push_button case, boolean test variable.

Windows:
- Qt portability: CommandLineParser is_set/add_option, QTimeZone
  systemTimeZone (QTimeZone::LocalTime is 6.11-only), k_progress_* enum.
- Linking: stop adding oakengine to OLIVE_LIBRARIES (import lib plus
  oakengine-obj caused multiple definitions); add OAKENGINE_STATIC so
  internal consumers no longer reference __imp_* stubs.
- oakengine.ver: export olive::Renderer typeinfo so liboakgl.so can be
  dlopened (Linux), DynamicRenderer no longer dlcloses backend libraries
  (crash in RenderManager's dtor calling into unmapped memory).
- OTIO runtime: copy DLLs next to every binary on Windows instead of
  relying on PATH (0xc0000135 in gtest discovery).
- Headless GL: the runner only has GDI OpenGL 1.1, killing every render
  worker. Deploy Mesa llvmpipe as opengl32sw.dll (Qt's software-GL
  channel) with QT_OPENGL=software, and let QT_OPENGL override the
  AA_UseDesktopOpenGL default. ExportTask fails fast after 8 consecutive
  undelivered frames instead of segfaulting or grinding forever;
  FFmpegEncoder::write_frame tolerates null frames.
- Tests: GetTempPathA+PID temp dirs, GetLongPathNameA for 8.3 names,
  forward-slash normalization when comparing project filenames.

Linux:
- Install libshaderc-dev so oakvulkan compiles GLSL (Vulkan tests).
- Accept UNORM floor-or-round (63/64) in the blit ping-pong test.
- Skip MainWindow construction test on the offscreen QPA (cannot paint
  QOpenGLWidget).

Also: oak_cli_transcode gets a 300s ctest timeout, worker logs GL
context version and LoadGraph/render_frame stages, and
docs/plans/eliminate-event-bridge-issues.md (English translation).
2026-08-04 21:34:31 +08:00

172 lines
4.6 KiB
C++

/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
Modifications Copyright (C) 2025 mikesolar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "markerpropertiesdialog.h"
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QGroupBox>
#include <QLabel>
#include <QMessageBox>
#include "core.h"
#include "oakengine/timeline.h"
#include "widget/timeruler/markerhandle.h"
namespace olive
{
#define super QDialog
MarkerPropertiesDialog::MarkerPropertiesDialog(
const std::vector<OakEngineMarker *> &markers, const Rational &timebase,
QWidget *parent)
: super(parent)
, markers_(markers)
{
QGridLayout *layout = new QGridLayout(this);
int row = 0;
QGroupBox *time_group = new QGroupBox(tr("Time"));
QGridLayout *time_layout = new QGridLayout(time_group);
{
int time_row = 0;
time_layout->addWidget(new QLabel(tr("In:")), time_row, 0);
in_slider_ = new RationalSlider();
time_layout->addWidget(in_slider_, time_row, 1);
time_row++;
time_layout->addWidget(new QLabel(tr("Out:")), time_row, 0);
out_slider_ = new RationalSlider();
time_layout->addWidget(out_slider_, time_row, 1);
}
if (markers.size() == 1) {
const TimeRange marker_range = marker_time(markers.front());
in_slider_->set_value(marker_range.in());
in_slider_->set_display_type(slider::k_time);
in_slider_->set_timebase(timebase);
out_slider_->set_value(marker_range.out());
out_slider_->set_display_type(slider::k_time);
out_slider_->set_timebase(timebase);
} else {
// Markers cannot be on the same time, so we disable setting time if multiple markers are selected
in_slider_->setEnabled(false);
in_slider_->set_tristate();
out_slider_->setEnabled(false);
out_slider_->set_tristate();
}
layout->addWidget(time_group, row, 0, 1, 2);
row++;
layout->addWidget(new QLabel(tr("Color:")), row, 0);
color_menu_ = new ColorCodingComboBox();
layout->addWidget(color_menu_, row, 1);
color_menu_->set_color(marker_color(markers.front()));
for (size_t i = 1; i < markers.size(); i++) {
if (marker_color(markers.at(i)) != color_menu_->get_selected_color()) {
color_menu_->set_color(-1);
break;
}
}
row++;
layout->addWidget(new QLabel(tr("Name:")), row, 0);
label_edit_ = new LineEditWithFocusSignal();
connect(label_edit_, &LineEditWithFocusSignal::focused, this,
[this] { label_edit_->setPlaceholderText(QString()); });
layout->addWidget(label_edit_, row, 1);
// Determine what the startup label text should be
label_edit_->setText(marker_name(markers.front()));
for (size_t i = 1; i < markers.size(); i++) {
if (marker_name(markers.at(i)) != label_edit_->text()) {
label_edit_->clear();
label_edit_->setPlaceholderText(tr("(multiple)"));
break;
}
}
row++;
QDialogButtonBox *buttons =
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttons, &QDialogButtonBox::accepted, this,
&MarkerPropertiesDialog::accept);
connect(buttons, &QDialogButtonBox::rejected, this,
&MarkerPropertiesDialog::reject);
layout->addWidget(buttons, row, 0, 1, 2);
setWindowTitle(tr("Edit Markers"));
label_edit_->setFocus();
}
void MarkerPropertiesDialog::accept()
{
if (in_slider_->isEnabled() &&
in_slider_->get_value() > out_slider_->get_value()) {
QMessageBox::critical(
this, tr("Invalid Values"),
tr("In point must be less than or equal to out point."));
return;
}
// Batch-set properties via facade (one undoable command)
{
QVector<OakEngineMarker *> oak_markers;
for (OakEngineMarker *m : markers_) {
oak_markers.append(m);
}
int color = color_menu_->get_selected_color();
QByteArray name_ba;
const char *name = nullptr;
if (label_edit_->placeholderText().isEmpty()) {
name_ba = label_edit_->text().toUtf8();
name = name_ba.constData();
}
oakengine_marker_set_properties(
oak_markers.data(), oak_markers.size(), color, name,
(markers_.size() == 1) ? 1 : 0,
in_slider_->get_value().numerator(),
in_slider_->get_value().denominator(),
out_slider_->get_value().numerator(),
out_slider_->get_value().denominator(),
nullptr);
}
super::accept();
}
}