New app/playback/playbackcontroller.{h,cpp}: a lazily created
process-wide singleton whose set_playhead() forwards to
oakengine_viewer_set_playhead and re-broadcasts playhead_changed as a
plain Qt signal. Every app-side oakengine_viewer_set_playhead call site
(17 across viewer, timelinewidget, timelineview, import tool,
timebasedwidget, keyframecontrol, export dialog, mainwindow) now goes
through it.
Migrate the first four playhead subscribers off the raw C event
subscription / EngineEventBridge to the controller signal:
- TimeBasedView (issue 1)
- NodeParamViewWidgetBridge (issue 2)
- NodeParamViewKeyframeControl (issue 3)
- NodeParamViewConnectedLabel (issue 4)
Each stores a QMetaObject::Connection filtered on its viewer node and
disconnects on teardown; the viewer_sub_ members are gone. Plan docs
mark issues 0c and 1-4 as done.
Closes #30, closes #31, closes #32, closes #51, closes #52.
84 lines
1.9 KiB
C++
84 lines
1.9 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/>.
|
|
|
|
***/
|
|
|
|
#ifndef OAK_NODEPARAMVIEWCONNECTEDLABEL_H
|
|
#define OAK_NODEPARAMVIEWCONNECTEDLABEL_H
|
|
|
|
#include "engineeventbridge.h"
|
|
#include "oakutil/oaknode.h"
|
|
#include "widget/clickablelabel/clickablelabel.h"
|
|
#include "widget/nodevaluetree/nodevaluetree.h"
|
|
|
|
#include <cstdint>
|
|
|
|
namespace olive
|
|
{
|
|
|
|
class NodeParamViewConnectedLabel : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
NodeParamViewConnectedLabel(const oak::Input &input,
|
|
QWidget *parent = nullptr);
|
|
~NodeParamViewConnectedLabel() override;
|
|
|
|
void set_viewer_node(OakEngineNode *viewer);
|
|
|
|
signals:
|
|
void request_select_node(OakEngineNode *n);
|
|
|
|
private slots:
|
|
void input_connected(oak::Node output, const oak::Input &input);
|
|
|
|
void input_disconnected(oak::Node output, const oak::Input &input);
|
|
|
|
void show_label_context_menu();
|
|
|
|
void connection_clicked();
|
|
|
|
private:
|
|
void update_label();
|
|
|
|
void update_value_tree();
|
|
|
|
void create_tree();
|
|
|
|
ClickableLabel *connected_to_lbl_;
|
|
|
|
oak::Input input_;
|
|
|
|
oak::Node connected_node_;
|
|
|
|
NodeValueTree *value_tree_;
|
|
|
|
OakEngineNode *viewer_;
|
|
|
|
EngineEventBridge *bridge_ = nullptr;
|
|
|
|
QMetaObject::Connection viewer_conn_;
|
|
|
|
private slots:
|
|
void set_value_tree_visible(bool e);
|
|
};
|
|
|
|
}
|
|
|
|
#endif // OAK_NODEPARAMVIEWCONNECTEDLABEL_H
|