refactor: cut engine-to-UI include violations ahead of the liboakengine split
- slider DisplayType enums sink to node/sliderdisplaytype.h (canonical engine home); FloatSlider/RationalSlider alias them for compatibility - DropWithoutSequenceBehavior enum sinks to common/dropworkflowbehavior.h - Config errors now go through a registered ErrorHandler hook instead of QMessageBox with a MainWindow parent; the style default no longer depends on the UI style manager - MainWindowLayoutInfo moves to node/project/serializer/ and its panel dependency is reduced to a plain std::map alias (PanelLayoutInfo), breaking the engine -> PanelWidget -> KDDockWidgets chain - ProjectImportErrorDialog moves from task/ to dialog/projectimport/ - remove confirmed-redundant UI includes and give project.h/import.h/ project.cpp the direct includes they were borrowing transitively - project.h includes folder/sequence headers directly (it used both types in its own API all along)
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "pan.h"
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -40,7 +40,7 @@ PanNode::PanNode()
|
||||
set_input_property(k_panning_input, QStringLiteral("min"), -1.0);
|
||||
set_input_property(k_panning_input, QStringLiteral("max"), 1.0);
|
||||
set_input_property(k_panning_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
|
||||
set_flag(k_audio_effect);
|
||||
set_effect_input(k_samples_input);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "volume.h"
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -39,7 +39,7 @@ VolumeNode::VolumeNode()
|
||||
add_input(k_volume_input, NodeValue::k_float, 1.0);
|
||||
set_input_property(k_volume_input, QStringLiteral("min"), 0.0);
|
||||
set_input_property(k_volume_input, QStringLiteral("view"),
|
||||
FloatSlider::k_decibel);
|
||||
slider::k_decibel);
|
||||
|
||||
set_flag(k_audio_effect);
|
||||
set_effect_input(k_samples_input);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
#include "node/inputdragger.h"
|
||||
#include "widget/slider/rationalslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -44,7 +44,7 @@ Block::Block()
|
||||
set_input_property(k_length_input, QStringLiteral("min"),
|
||||
QVariant::fromValue(Rational(0, 1)));
|
||||
set_input_property(k_length_input, QStringLiteral("view"),
|
||||
RationalSlider::k_time);
|
||||
slider::k_time);
|
||||
set_input_property(k_length_input, QStringLiteral("viewlock"), true);
|
||||
|
||||
set_input_flag(k_enabled_input, k_input_flag_not_connectable);
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
#include "node/output/track/track.h"
|
||||
#include "node/output/viewer/viewer.h"
|
||||
#include "node/project/sequence/sequence.h"
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "widget/slider/rationalslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -51,13 +51,13 @@ ClipBlock::ClipBlock()
|
||||
add_input(k_media_in_input, NodeValue::k_rational,
|
||||
InputFlags(k_input_flag_not_connectable | k_input_flag_not_keyframable));
|
||||
set_input_property(k_media_in_input, QStringLiteral("view"),
|
||||
RationalSlider::k_time);
|
||||
slider::k_time);
|
||||
set_input_property(k_media_in_input, QStringLiteral("viewlock"), true);
|
||||
|
||||
add_input(k_speed_input, NodeValue::k_float, 1.0,
|
||||
InputFlags(k_input_flag_not_connectable | k_input_flag_not_keyframable));
|
||||
set_input_property(k_speed_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
set_input_property(k_speed_input, QStringLiteral("min"), 0.0);
|
||||
|
||||
add_input(k_reverse_input, NodeValue::k_boolean, false,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "node/block/clip/clip.h"
|
||||
#include "node/output/track/track.h"
|
||||
#include "widget/slider/rationalslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -51,7 +51,7 @@ TransitionBlock::TransitionBlock()
|
||||
add_input(k_center_input, NodeValue::k_rational,
|
||||
InputFlags(k_input_flag_not_keyframable | k_input_flag_not_connectable));
|
||||
set_input_property(k_center_input, QStringLiteral("view"),
|
||||
RationalSlider::k_time);
|
||||
slider::k_time);
|
||||
set_input_property(k_center_input, QStringLiteral("viewlock"), true);
|
||||
|
||||
set_flag(k_dont_show_in_param_view, false);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "common/ocioutils.h"
|
||||
#include "node/project.h"
|
||||
#include "render/colorprocessor.h"
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -71,7 +71,7 @@ OCIOGradingTransformLinearNode::OCIOGradingTransformLinearNode()
|
||||
|
||||
add_input(k_saturation_input, NodeValue::k_float, 1.0);
|
||||
set_input_property(k_saturation_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
set_input_property(k_saturation_input, QStringLiteral("min"), 0.0);
|
||||
|
||||
add_input(k_pivot_input, NodeValue::k_float,
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "common/ocioutils.h"
|
||||
#include "node/project.h"
|
||||
#include "render/colorprocessor.h"
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -71,7 +71,7 @@ OCIOGradingTransformLogNode::OCIOGradingTransformLogNode()
|
||||
|
||||
add_input(k_saturation_input, NodeValue::k_float, 1.0);
|
||||
set_input_property(k_saturation_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
set_input_property(k_saturation_input, QStringLiteral("min"), 0.0);
|
||||
|
||||
add_input(k_pivot_input, NodeValue::k_float,
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
#include "ociolut.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QMetaObject>
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
#include "core.h"
|
||||
#include "node/color/colormanager/colormanager.h"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <QVector3D>
|
||||
|
||||
#include "node/project.h"
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -66,9 +66,9 @@ ThreeWayColorNode::ThreeWayColorNode()
|
||||
set_input_property(k_shadows_amount_input, min, 0.0);
|
||||
set_input_property(k_midtones_amount_input, min, 0.0);
|
||||
set_input_property(k_highlights_amount_input, min, 0.0);
|
||||
set_input_property(k_shadows_amount_input, view, FloatSlider::k_percentage);
|
||||
set_input_property(k_midtones_amount_input, view, FloatSlider::k_percentage);
|
||||
set_input_property(k_highlights_amount_input, view, FloatSlider::k_percentage);
|
||||
set_input_property(k_shadows_amount_input, view, slider::k_percentage);
|
||||
set_input_property(k_midtones_amount_input, view, slider::k_percentage);
|
||||
set_input_property(k_highlights_amount_input, view, slider::k_percentage);
|
||||
|
||||
set_effect_input(k_texture_input);
|
||||
set_flag(k_video_effect);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "common/filefunctions.h"
|
||||
#include "render/job/shaderjob.h"
|
||||
#include "render/texture.h"
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -47,7 +47,7 @@ WhiteBalanceNode::WhiteBalanceNode()
|
||||
set_input_property(k_temperature_input, QStringLiteral("min"), 1000.0);
|
||||
set_input_property(k_temperature_input, QStringLiteral("max"), 40000.0);
|
||||
set_input_property(k_temperature_input, QStringLiteral("view"),
|
||||
FloatSlider::k_normal);
|
||||
slider::k_normal);
|
||||
|
||||
add_input(k_tint_input, NodeValue::k_float, 0.0);
|
||||
set_input_property(k_tint_input, QStringLiteral("min"), -1.0);
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "common/lerp.h"
|
||||
#include "core.h"
|
||||
#include "widget/slider/floatslider.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "common/util.h"
|
||||
#include "core.h"
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -183,7 +183,7 @@ void CropDistortNode::create_crop_side_input(const QString &id)
|
||||
add_input(id, NodeValue::k_float, 0.0);
|
||||
set_input_property(id, QStringLiteral("min"), 0.0);
|
||||
set_input_property(id, QStringLiteral("max"), 1.0);
|
||||
set_input_property(id, QStringLiteral("view"), FloatSlider::k_percentage);
|
||||
set_input_property(id, QStringLiteral("view"), slider::k_percentage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "tiledistortnode.h"
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -43,7 +43,7 @@ TileDistortNode::TileDistortNode()
|
||||
add_input(k_scale_input, NodeValue::k_float, 0.5);
|
||||
set_input_property(k_scale_input, QStringLiteral("min"), 0);
|
||||
set_input_property(k_scale_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
|
||||
add_input(k_position_input, NodeValue::k_vec2, QVector2D(0, 0));
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "opacityeffect.h"
|
||||
|
||||
#include "node/math/math/math.h"
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -43,7 +43,7 @@ OpacityEffect::OpacityEffect()
|
||||
|
||||
add_input(k_value_input, NodeValue::k_float, 1.0);
|
||||
set_input_property(k_value_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
set_input_property(k_value_input, QStringLiteral("min"), 0.0);
|
||||
set_input_property(k_value_input, QStringLiteral("max"), 1.0);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "dropshadowfilter.h"
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -54,7 +54,7 @@ DropShadowFilter::DropShadowFilter()
|
||||
add_input(k_opacity_input, NodeValue::k_float, 1.0);
|
||||
set_input_property(k_opacity_input, QStringLiteral("min"), 0.0);
|
||||
set_input_property(k_opacity_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
|
||||
add_input(k_fast_input, NodeValue::k_boolean, false);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "stroke.h"
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -47,7 +47,7 @@ StrokeFilterNode::StrokeFilterNode()
|
||||
|
||||
add_input(k_opacity_input, NodeValue::k_float, 1.0f);
|
||||
set_input_property(k_opacity_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
set_input_property(k_opacity_input, QStringLiteral("min"), 0.0f);
|
||||
set_input_property(k_opacity_input, QStringLiteral("max"), 1.0f);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <QMatrix4x4>
|
||||
#include <QVector2D>
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -47,7 +47,7 @@ MatrixGenerator::MatrixGenerator()
|
||||
add_input(k_scale_input, NodeValue::k_vec2, QVector2D(1.0f, 1.0f));
|
||||
set_input_property(k_scale_input, QStringLiteral("min"), QVector2D(0, 0));
|
||||
set_input_property(k_scale_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
set_input_property(k_scale_input, QStringLiteral("disable1"), true);
|
||||
|
||||
add_input(k_uniform_scale_input, NodeValue::k_boolean, true,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "noise.h"
|
||||
|
||||
#include "widget/slider/floatslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -40,7 +40,7 @@ NoiseGeneratorNode::NoiseGeneratorNode()
|
||||
|
||||
add_input(k_strength_input, NodeValue::k_float, 0.2);
|
||||
set_input_property(k_strength_input, QStringLiteral("view"),
|
||||
FloatSlider::k_percentage);
|
||||
slider::k_percentage);
|
||||
set_input_property(k_strength_input, QStringLiteral("min"), 0);
|
||||
|
||||
add_input(k_color_input, NodeValue::k_boolean, false);
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "track.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QFontMetrics>
|
||||
|
||||
|
||||
@@ -28,14 +28,14 @@
|
||||
#include "common/qtutils.h"
|
||||
#include "common/xmlutils.h"
|
||||
#include "core.h"
|
||||
#include "dialog/progress/progress.h"
|
||||
#include "node/color/ociobase/ociobase.h"
|
||||
#include "node/factory.h"
|
||||
#include "node/group/group.h"
|
||||
#include "node/project/folder/folder.h"
|
||||
#include "node/serializeddata.h"
|
||||
#include "pluginSupport/olivehost.h"
|
||||
#include "ofxhPluginCache.h"
|
||||
#include "render/diskmanager.h"
|
||||
#include "window/mainwindow/mainwindow.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
|
||||
+2
-1
@@ -27,9 +27,10 @@
|
||||
#include <QUuid>
|
||||
|
||||
#include "node/output/viewer/viewer.h"
|
||||
#include "node/project/folder/folder.h"
|
||||
#include "node/project/footage/footage.h"
|
||||
#include "node/project/sequence/sequence.h"
|
||||
#include "node/color/colormanager/colormanager.h"
|
||||
#include "window/mainwindow/mainwindowlayoutinfo.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <QThread>
|
||||
|
||||
#include "panel/timeline/timeline.h"
|
||||
#include "ui/icons/icons.h"
|
||||
#include "timeline/timelineundogeneral.h"
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ set(OLIVE_SOURCES
|
||||
node/project/serializer/serializer230220.h
|
||||
|
||||
|
||||
node/project/serializer/mainwindowlayoutinfo.cpp
|
||||
node/project/serializer/mainwindowlayoutinfo.h
|
||||
|
||||
node/project/serializer/typeserializer.cpp
|
||||
node/project/serializer/typeserializer.h
|
||||
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
/*
|
||||
* Oak Video Editor - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* 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 "mainwindowlayoutinfo.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
|
||||
void MainWindowLayoutInfo::to_xml(QXmlStreamWriter *writer) const
|
||||
{
|
||||
writer->writeAttribute(QStringLiteral("version"),
|
||||
QString::number(k_version));
|
||||
|
||||
writer->writeStartElement(QStringLiteral("folders"));
|
||||
|
||||
foreach (Folder *folder, open_folders_) {
|
||||
writer->writeTextElement(
|
||||
QStringLiteral("folder"),
|
||||
QString::number(reinterpret_cast<quintptr>(folder)));
|
||||
}
|
||||
|
||||
writer->writeEndElement(); // folders
|
||||
|
||||
writer->writeStartElement(QStringLiteral("timeline"));
|
||||
|
||||
foreach (Sequence *sequence, open_sequences_) {
|
||||
writer->writeTextElement(
|
||||
QStringLiteral("sequence"),
|
||||
QString::number(reinterpret_cast<quintptr>(sequence)));
|
||||
}
|
||||
|
||||
writer->writeEndElement(); // timeline
|
||||
|
||||
writer->writeStartElement(QStringLiteral("viewers"));
|
||||
|
||||
foreach (ViewerOutput *viewer, open_viewers_) {
|
||||
writer->writeTextElement(
|
||||
QStringLiteral("viewer"),
|
||||
QString::number(reinterpret_cast<quintptr>(viewer)));
|
||||
}
|
||||
|
||||
writer->writeEndElement(); // viewers
|
||||
|
||||
writer->writeStartElement(QStringLiteral("data"));
|
||||
|
||||
for (auto it = panel_data_.cbegin(); it != panel_data_.cend(); it++) {
|
||||
writer->writeStartElement(QStringLiteral("panel"));
|
||||
|
||||
writer->writeAttribute(QStringLiteral("id"), it->first);
|
||||
|
||||
const PanelLayoutInfo &info = it->second;
|
||||
for (auto jt = info.cbegin(); jt != info.cend(); jt++) {
|
||||
writer->writeStartElement(QStringLiteral("option"));
|
||||
|
||||
writer->writeAttribute(QStringLiteral("name"), jt->first);
|
||||
|
||||
writer->writeCharacters(jt->second);
|
||||
|
||||
writer->writeEndElement(); // option
|
||||
}
|
||||
|
||||
writer->writeEndElement(); // panel
|
||||
}
|
||||
|
||||
writer->writeEndElement(); // data
|
||||
|
||||
writer->writeTextElement(QStringLiteral("state"),
|
||||
QString(state_.toBase64()));
|
||||
}
|
||||
|
||||
MainWindowLayoutInfo
|
||||
MainWindowLayoutInfo::from_xml(QXmlStreamReader *reader,
|
||||
const QHash<quintptr, Node *> &node_ptrs)
|
||||
{
|
||||
MainWindowLayoutInfo info;
|
||||
|
||||
unsigned int file_version = 0;
|
||||
|
||||
XMLAttributeLoop(reader, attr)
|
||||
{
|
||||
if (attr.name() == QStringLiteral("version")) {
|
||||
file_version = attr.value().toUInt();
|
||||
}
|
||||
}
|
||||
|
||||
// Really basic version checking, in the future we may use this to parse multiple versions
|
||||
if (file_version != k_version) {
|
||||
}
|
||||
|
||||
while (xml_read_next_start_element(reader)) {
|
||||
if (reader->name() == QStringLiteral("folders")) {
|
||||
while (xml_read_next_start_element(reader)) {
|
||||
if (reader->name() == QStringLiteral("folder")) {
|
||||
quintptr item_id = reader->readElementText().toULongLong();
|
||||
|
||||
Folder *open_item =
|
||||
static_cast<Folder *>(node_ptrs.value(item_id));
|
||||
info.open_folders_.push_back(open_item);
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
} else if (reader->name() == QStringLiteral("timeline")) {
|
||||
while (xml_read_next_start_element(reader)) {
|
||||
if (reader->name() == QStringLiteral("sequence")) {
|
||||
quintptr item_id = reader->readElementText().toULongLong();
|
||||
|
||||
Sequence *open_seq =
|
||||
static_cast<Sequence *>(node_ptrs.value(item_id));
|
||||
info.open_sequences_.push_back(open_seq);
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
} else if (reader->name() == QStringLiteral("viewers")) {
|
||||
while (xml_read_next_start_element(reader)) {
|
||||
if (reader->name() == QStringLiteral("viewer")) {
|
||||
quintptr item_id = reader->readElementText().toULongLong();
|
||||
|
||||
ViewerOutput *open_viewer =
|
||||
static_cast<ViewerOutput *>(node_ptrs.value(item_id));
|
||||
info.open_viewers_.push_back(open_viewer);
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
} else if (reader->name() == QStringLiteral("state")) {
|
||||
info.state_ =
|
||||
QByteArray::fromBase64(reader->readElementText().toLatin1());
|
||||
|
||||
} else if (reader->name() == QStringLiteral("data")) {
|
||||
while (xml_read_next_start_element(reader)) {
|
||||
if (reader->name() == QStringLiteral("panel")) {
|
||||
QString id;
|
||||
XMLAttributeLoop(reader, attr)
|
||||
{
|
||||
if (attr.name() == QStringLiteral("id")) {
|
||||
id = attr.value().toString();
|
||||
}
|
||||
}
|
||||
|
||||
if (!id.isEmpty()) {
|
||||
PanelLayoutInfo i;
|
||||
|
||||
while (xml_read_next_start_element(reader)) {
|
||||
if (reader->name() == QStringLiteral("option")) {
|
||||
QString name;
|
||||
|
||||
XMLAttributeLoop(reader, attr)
|
||||
{
|
||||
if (attr.name() == QStringLiteral("name")) {
|
||||
name = attr.value().toString();
|
||||
}
|
||||
}
|
||||
|
||||
if (!name.isEmpty()) {
|
||||
i[name] = reader->readElementText();
|
||||
}
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
info.panel_data_[id] = i;
|
||||
}
|
||||
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
void MainWindowLayoutInfo::add_folder(olive::Folder *f)
|
||||
{
|
||||
open_folders_.push_back(f);
|
||||
}
|
||||
|
||||
void MainWindowLayoutInfo::add_sequence(Sequence *seq)
|
||||
{
|
||||
open_sequences_.push_back(seq);
|
||||
}
|
||||
|
||||
void MainWindowLayoutInfo::add_viewer(ViewerOutput *viewer)
|
||||
{
|
||||
open_viewers_.push_back(viewer);
|
||||
}
|
||||
|
||||
void MainWindowLayoutInfo::set_panel_data(const QString &id,
|
||||
const PanelLayoutInfo &data)
|
||||
{
|
||||
panel_data_[id] = data;
|
||||
}
|
||||
|
||||
void MainWindowLayoutInfo::move_panel_data(const QString &old,
|
||||
const QString &now)
|
||||
{
|
||||
PanelLayoutInfo tmp = panel_data_.at(old);
|
||||
panel_data_.erase(old);
|
||||
panel_data_[now] = tmp;
|
||||
}
|
||||
|
||||
void MainWindowLayoutInfo::set_state(const QByteArray &layout)
|
||||
{
|
||||
state_ = layout;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Oak Video Editor - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#ifndef OAK_MAINWINDOWLAYOUTINFO_H
|
||||
#define OAK_MAINWINDOWLAYOUTINFO_H
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "node/project/folder/folder.h"
|
||||
#include "node/project/sequence/sequence.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Per-panel layout data (key/value pairs)
|
||||
*
|
||||
* Identical to PanelWidget::Info in the UI layer; defined here so the
|
||||
* engine-side layout data structure does not depend on widget headers.
|
||||
*/
|
||||
using PanelLayoutInfo = std::map<QString, QString>;
|
||||
|
||||
class MainWindowLayoutInfo {
|
||||
public:
|
||||
MainWindowLayoutInfo() = default;
|
||||
|
||||
void to_xml(QXmlStreamWriter *writer) const;
|
||||
|
||||
static MainWindowLayoutInfo
|
||||
from_xml(QXmlStreamReader *reader, const QHash<quintptr, Node *> &node_map);
|
||||
|
||||
void add_folder(Folder *f);
|
||||
|
||||
void add_sequence(Sequence *seq);
|
||||
|
||||
void add_viewer(ViewerOutput *viewer);
|
||||
|
||||
void set_panel_data(const QString &id, const PanelLayoutInfo &data);
|
||||
|
||||
void move_panel_data(const QString &old, const QString &now);
|
||||
|
||||
void set_state(const QByteArray &layout);
|
||||
|
||||
const std::vector<Folder *> &open_folders() const
|
||||
{
|
||||
return open_folders_;
|
||||
}
|
||||
|
||||
const std::vector<Sequence *> &open_sequences() const
|
||||
{
|
||||
return open_sequences_;
|
||||
}
|
||||
|
||||
const std::vector<ViewerOutput *> &open_viewers() const
|
||||
{
|
||||
return open_viewers_;
|
||||
}
|
||||
|
||||
const std::map<QString, PanelLayoutInfo> &panel_data() const
|
||||
{
|
||||
return panel_data_;
|
||||
}
|
||||
|
||||
const QByteArray &state() const
|
||||
{
|
||||
return state_;
|
||||
}
|
||||
|
||||
private:
|
||||
QByteArray state_;
|
||||
|
||||
std::vector<Folder *> open_folders_;
|
||||
|
||||
std::vector<Sequence *> open_sequences_;
|
||||
|
||||
std::vector<ViewerOutput *> open_viewers_;
|
||||
|
||||
std::map<QString, PanelLayoutInfo> panel_data_;
|
||||
|
||||
static const unsigned int k_version = 1;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(olive::MainWindowLayoutInfo)
|
||||
|
||||
#endif // OAK_MAINWINDOWLAYOUTINFO_H
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "common/define.h"
|
||||
#include "node/project.h"
|
||||
#include "node/project/serializer/mainwindowlayoutinfo.h"
|
||||
#include "typeserializer.h"
|
||||
|
||||
namespace olive
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/***
|
||||
|
||||
Oak - Non-Linear Video Editor
|
||||
Copyright (C) 2026 Oak Team
|
||||
|
||||
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/>.
|
||||
|
||||
***/
|
||||
|
||||
#ifndef OAK_SLIDERDISPLAYTYPE_H
|
||||
#define OAK_SLIDERDISPLAYTYPE_H
|
||||
|
||||
namespace olive
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Slider display type enums shared by nodes and widgets
|
||||
*
|
||||
* Nodes reference these enums in their input properties ("view"); the
|
||||
* slider widgets in app/widget/slider use the same values to render. The
|
||||
* definitions live in the engine layer so nodes do not depend on widget
|
||||
* headers. Enumerator order is ABI/feature compatible with the previous
|
||||
* FloatSlider::DisplayType and RationalSlider::DisplayType.
|
||||
*/
|
||||
namespace slider
|
||||
{
|
||||
|
||||
enum FloatDisplayType { k_normal, k_decibel, k_percentage };
|
||||
|
||||
enum RationalDisplayType { k_time, k_float, k_rational };
|
||||
|
||||
} // namespace slider
|
||||
|
||||
} // namespace olive
|
||||
|
||||
#endif // OAK_SLIDERDISPLAYTYPE_H
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "timeoffsetnode.h"
|
||||
|
||||
#include "widget/slider/rationalslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -35,7 +35,7 @@ TimeOffsetNode::TimeOffsetNode()
|
||||
{
|
||||
add_input(k_time_input, NodeValue::k_rational, QVariant::fromValue(Rational(0)),
|
||||
InputFlags(k_input_flag_not_connectable));
|
||||
set_input_property(k_time_input, QStringLiteral("view"), RationalSlider::k_time);
|
||||
set_input_property(k_time_input, QStringLiteral("view"), slider::k_time);
|
||||
set_input_property(k_time_input, QStringLiteral("viewlock"), true);
|
||||
|
||||
add_input(k_input_input, NodeValue::k_none,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "timeremap.h"
|
||||
|
||||
#include "widget/slider/rationalslider.h"
|
||||
#include "node/sliderdisplaytype.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -35,7 +35,7 @@ TimeRemapNode::TimeRemapNode()
|
||||
{
|
||||
add_input(k_time_input, NodeValue::k_rational, QVariant::fromValue(Rational(0)),
|
||||
InputFlags(k_input_flag_not_connectable));
|
||||
set_input_property(k_time_input, QStringLiteral("view"), RationalSlider::k_time);
|
||||
set_input_property(k_time_input, QStringLiteral("view"), slider::k_time);
|
||||
set_input_property(k_time_input, QStringLiteral("viewlock"), true);
|
||||
|
||||
add_input(k_input_input, NodeValue::k_none,
|
||||
|
||||
Reference in New Issue
Block a user