derive clips, tracks, and sequences from the same base

This commit is contained in:
itsmattkc
2019-04-14 11:13:00 +10:00
parent 336ef69d73
commit 1b9a963eeb
26 changed files with 284 additions and 108 deletions
+11 -7
View File
@@ -60,7 +60,7 @@
QVector<NodePtr> olive::node_library;
Node::Node(Clip* c) :
Node::Node(TimelineObject* c) :
parent_clip(c),
flags_(0),
shader_program_(nullptr),
@@ -182,6 +182,7 @@ void Node::delete_self() {
}
void Node::move_up() {
/*
int index_of_effect = parent_clip->IndexOfEffect(this);
if (index_of_effect == 0) {
return;
@@ -194,9 +195,11 @@ void Node::move_up() {
olive::undo_stack.push(command);
panel_effect_controls->Reload();
panel_sequence_viewer->viewer_widget()->frame_update();
*/
}
void Node::move_down() {
/*
int index_of_effect = parent_clip->IndexOfEffect(this);
if (index_of_effect == parent_clip->effects.size()-1) {
return;
@@ -209,6 +212,7 @@ void Node::move_down() {
olive::undo_stack.push(command);
panel_effect_controls->Reload();
panel_sequence_viewer->viewer_widget()->frame_update();
*/
}
void Node::save_to_file() {
@@ -603,7 +607,7 @@ const QPointF &Node::pos()
void Node::process_image(double, uint8_t *, uint8_t *, int){}
NodePtr Node::copy(Clip *c) {
NodePtr Node::copy(TimelineObject *c) {
NodePtr copy = Create(c);
copy->SetEnabled(IsEnabled());
copy_field_keyframes(copy);
@@ -671,8 +675,8 @@ GLuint Node::process_superimpose(QOpenGLContext* ctx, double timecode) {
bool dimensions_changed = false;
bool redrew_image = false;
int width = parent_clip->media_width();
int height = parent_clip->media_height();
int width = parent_clip->MediaWidth();
int height = parent_clip->MediaHeight();
if (width != img.width() || height != img.height()) {
img = QImage(width, height, QImage::Format_RGBA8888_Premultiplied);
@@ -806,10 +810,10 @@ void Node::gizmo_world_to_screen(const QMatrix4x4& matrix, const QMatrix4x4& pro
projection,
QRect(0,
0,
parent_clip->track()->sequence()->width,
parent_clip->track()->sequence()->height));
parent_clip->SequenceWidth(),
parent_clip->SequenceHeight()));
g->screen_pos[j] = QPoint(screen_pos.x(), parent_clip->track()->sequence()->height-screen_pos.y());
g->screen_pos[j] = QPoint(screen_pos.x(), parent_clip->SequenceHeight()-screen_pos.y());
}
}
+5 -6
View File
@@ -48,8 +48,7 @@
class EffectGizmo;
class KeyframeDataChange;
class Clip;
using ClipPtr = std::shared_ptr<Clip>;
class TimelineObject;
class Node;
using NodePtr = std::shared_ptr<Node>;
@@ -112,10 +111,10 @@ struct GLTextureCoords {
class Node : public QObject {
Q_OBJECT
public:
Node(Clip *c);
Node(TimelineObject *c);
~Node();
Clip* parent_clip;
TimelineObject* parent_clip;
virtual QString name() = 0;
virtual QString id() = 0;
@@ -124,7 +123,7 @@ public:
virtual EffectType type() = 0;
virtual olive::TrackType subtype() = 0;
virtual bool IsCreatable();
virtual NodePtr Create(Clip *c) = 0;
virtual NodePtr Create(TimelineObject *c) = 0;
void AddRow(EffectRow* row);
int IndexOfRow(EffectRow* row);
@@ -142,7 +141,7 @@ public:
virtual void refresh();
virtual NodePtr copy(Clip* c);
virtual NodePtr copy(TimelineObject* c);
void copy_field_keyframes(NodePtr e);
virtual void load(QXmlStreamReader& stream);