began transition rewrite
This commit is contained in:
+219
-232
@@ -35,312 +35,299 @@
|
||||
#include "debug.h"
|
||||
|
||||
Clip::Clip(SequencePtr s) :
|
||||
sequence(s),
|
||||
enabled(true),
|
||||
clip_in(0),
|
||||
timeline_in(0),
|
||||
timeline_out(0),
|
||||
track(0),
|
||||
media(nullptr),
|
||||
speed(1.0),
|
||||
reverse(false),
|
||||
maintain_audio_pitch(false),
|
||||
autoscale(olive::CurrentConfig.autoscale_by_default),
|
||||
opening_transition(-1),
|
||||
closing_transition(-1),
|
||||
undeletable(false),
|
||||
replaced(false),
|
||||
ignore_reverse(false),
|
||||
use_existing_frame(false),
|
||||
filter_graph(nullptr),
|
||||
fbo(nullptr),
|
||||
opts(nullptr)
|
||||
sequence(s),
|
||||
enabled(true),
|
||||
clip_in(0),
|
||||
timeline_in(0),
|
||||
timeline_out(0),
|
||||
track(0),
|
||||
media(nullptr),
|
||||
speed(1.0),
|
||||
reverse(false),
|
||||
maintain_audio_pitch(false),
|
||||
autoscale(olive::CurrentConfig.autoscale_by_default),
|
||||
opening_transition(nullptr),
|
||||
closing_transition(nullptr),
|
||||
undeletable(false),
|
||||
replaced(false),
|
||||
ignore_reverse(false),
|
||||
use_existing_frame(false),
|
||||
filter_graph(nullptr),
|
||||
fbo(nullptr),
|
||||
opts(nullptr)
|
||||
{
|
||||
pkt = av_packet_alloc();
|
||||
reset();
|
||||
pkt = av_packet_alloc();
|
||||
reset();
|
||||
}
|
||||
|
||||
ClipPtr Clip::copy(SequencePtr s, bool duplicate_transitions) {
|
||||
ClipPtr copy(new Clip(s));
|
||||
ClipPtr copy(new Clip(s));
|
||||
|
||||
copy->enabled = enabled;
|
||||
copy->name = QString(name);
|
||||
copy->clip_in = clip_in;
|
||||
copy->timeline_in = timeline_in;
|
||||
copy->timeline_out = timeline_out;
|
||||
copy->track = track;
|
||||
copy->color_r = color_r;
|
||||
copy->color_g = color_g;
|
||||
copy->color_b = color_b;
|
||||
copy->media = media;
|
||||
copy->media_stream = media_stream;
|
||||
copy->autoscale = autoscale;
|
||||
copy->speed = speed;
|
||||
copy->maintain_audio_pitch = maintain_audio_pitch;
|
||||
copy->reverse = reverse;
|
||||
copy->enabled = enabled;
|
||||
copy->name = QString(name);
|
||||
copy->clip_in = clip_in;
|
||||
copy->timeline_in = timeline_in;
|
||||
copy->timeline_out = timeline_out;
|
||||
copy->track = track;
|
||||
copy->color_r = color_r;
|
||||
copy->color_g = color_g;
|
||||
copy->color_b = color_b;
|
||||
copy->media = media;
|
||||
copy->media_stream = media_stream;
|
||||
copy->autoscale = autoscale;
|
||||
copy->speed = speed;
|
||||
copy->maintain_audio_pitch = maintain_audio_pitch;
|
||||
copy->reverse = reverse;
|
||||
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
copy->effects.append(effects.at(i)->copy(copy));
|
||||
}
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
copy->effects.append(effects.at(i)->copy(copy));
|
||||
}
|
||||
|
||||
copy->cached_fr = (this->sequence == nullptr) ? cached_fr : this->sequence->frame_rate;
|
||||
copy->cached_fr = (this->sequence == nullptr) ? cached_fr : this->sequence->frame_rate;
|
||||
|
||||
if (duplicate_transitions) {
|
||||
if (get_opening_transition() != nullptr && get_opening_transition()->secondary_clip == nullptr) copy->opening_transition = get_opening_transition()->copy(copy, nullptr);
|
||||
if (get_closing_transition() != nullptr && get_closing_transition()->secondary_clip == nullptr) copy->closing_transition = get_closing_transition()->copy(copy, nullptr);
|
||||
}
|
||||
if (duplicate_transitions) {
|
||||
if (get_opening_transition() != nullptr && get_opening_transition()->secondary_clip == nullptr) {
|
||||
copy->opening_transition = get_opening_transition()->copy(copy, nullptr);
|
||||
}
|
||||
if (get_closing_transition() != nullptr && get_closing_transition()->secondary_clip == nullptr) {
|
||||
copy->closing_transition = get_closing_transition()->copy(copy, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
copy->recalculateMaxLength();
|
||||
copy->recalculateMaxLength();
|
||||
|
||||
return copy;
|
||||
return copy;
|
||||
}
|
||||
|
||||
void Clip::reset() {
|
||||
audio_just_reset = false;
|
||||
open = false;
|
||||
finished_opening = false;
|
||||
pkt_written = false;
|
||||
audio_reset = false;
|
||||
frame_sample_index = -1;
|
||||
audio_buffer_write = false;
|
||||
texture_frame = -1;
|
||||
formatCtx = nullptr;
|
||||
stream = nullptr;
|
||||
codec = nullptr;
|
||||
codecCtx = nullptr;
|
||||
texture = nullptr;
|
||||
last_invalid_ts = -1;
|
||||
audio_just_reset = false;
|
||||
open = false;
|
||||
finished_opening = false;
|
||||
pkt_written = false;
|
||||
audio_reset = false;
|
||||
frame_sample_index = -1;
|
||||
audio_buffer_write = false;
|
||||
texture_frame = -1;
|
||||
formatCtx = nullptr;
|
||||
stream = nullptr;
|
||||
codec = nullptr;
|
||||
codecCtx = nullptr;
|
||||
texture = nullptr;
|
||||
last_invalid_ts = -1;
|
||||
}
|
||||
|
||||
void Clip::reset_audio() {
|
||||
if (media == nullptr || media->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
audio_reset = true;
|
||||
frame_sample_index = -1;
|
||||
audio_buffer_write = 0;
|
||||
} else if (media->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
SequencePtr nested_sequence = media->to_sequence();
|
||||
for (int i=0;i<nested_sequence->clips.size();i++) {
|
||||
ClipPtr c = nested_sequence->clips.at(i);
|
||||
if (c != nullptr) c->reset_audio();
|
||||
}
|
||||
}
|
||||
if (media == nullptr || media->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
audio_reset = true;
|
||||
frame_sample_index = -1;
|
||||
audio_buffer_write = 0;
|
||||
} else if (media->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
SequencePtr nested_sequence = media->to_sequence();
|
||||
for (int i=0;i<nested_sequence->clips.size();i++) {
|
||||
ClipPtr c = nested_sequence->clips.at(i);
|
||||
if (c != nullptr) c->reset_audio();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Clip::refresh() {
|
||||
// validates media if it was replaced
|
||||
if (replaced && media != nullptr && media->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
FootagePtr m = media->to_footage();
|
||||
// validates media if it was replaced
|
||||
if (replaced && media != nullptr && media->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
FootagePtr m = media->to_footage();
|
||||
|
||||
if (track < 0 && m->video_tracks.size() > 0) {
|
||||
media_stream = m->video_tracks.at(0).file_index;
|
||||
} else if (track >= 0 && m->audio_tracks.size() > 0) {
|
||||
media_stream = m->audio_tracks.at(0).file_index;
|
||||
}
|
||||
}
|
||||
replaced = false;
|
||||
if (track < 0 && m->video_tracks.size() > 0) {
|
||||
media_stream = m->video_tracks.at(0).file_index;
|
||||
} else if (track >= 0 && m->audio_tracks.size() > 0) {
|
||||
media_stream = m->audio_tracks.at(0).file_index;
|
||||
}
|
||||
}
|
||||
replaced = false;
|
||||
|
||||
// reinitializes all effects... just in case
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
effects.at(i)->refresh();
|
||||
}
|
||||
// reinitializes all effects... just in case
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
effects.at(i)->refresh();
|
||||
}
|
||||
|
||||
recalculateMaxLength();
|
||||
recalculateMaxLength();
|
||||
}
|
||||
|
||||
void Clip::queue_clear() {
|
||||
while (queue.size() > 0) {
|
||||
av_frame_free(&queue.first());
|
||||
queue.removeFirst();
|
||||
}
|
||||
while (queue.size() > 0) {
|
||||
av_frame_free(&queue.first());
|
||||
queue.removeFirst();
|
||||
}
|
||||
}
|
||||
|
||||
void Clip::queue_remove_earliest() {
|
||||
int earliest_frame = 0;
|
||||
for (int i=1;i<queue.size();i++) {
|
||||
// TODO/NOTE: this will not work on sped up AND reversed video
|
||||
if (queue.at(i)->pts < queue.at(earliest_frame)->pts) {
|
||||
earliest_frame = i;
|
||||
}
|
||||
}
|
||||
av_frame_free(&queue[earliest_frame]);
|
||||
queue.removeAt(earliest_frame);
|
||||
int earliest_frame = 0;
|
||||
for (int i=1;i<queue.size();i++) {
|
||||
// TODO/NOTE: this will not work on sped up AND reversed video
|
||||
if (queue.at(i)->pts < queue.at(earliest_frame)->pts) {
|
||||
earliest_frame = i;
|
||||
}
|
||||
}
|
||||
av_frame_free(&queue[earliest_frame]);
|
||||
queue.removeAt(earliest_frame);
|
||||
}
|
||||
|
||||
QVector<Marker> &Clip::get_markers() {
|
||||
if (media != nullptr) {
|
||||
return media->get_markers();
|
||||
}
|
||||
return markers;
|
||||
if (media != nullptr) {
|
||||
return media->get_markers();
|
||||
}
|
||||
return markers;
|
||||
}
|
||||
|
||||
TransitionPtr Clip::get_opening_transition() {
|
||||
if (opening_transition > -1) {
|
||||
if (this->sequence == nullptr) {
|
||||
return clipboard_transitions.at(opening_transition);
|
||||
} else {
|
||||
return this->sequence->transitions.at(opening_transition);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
return opening_transition;
|
||||
}
|
||||
|
||||
TransitionPtr Clip::get_closing_transition() {
|
||||
if (closing_transition > -1) {
|
||||
if (this->sequence == nullptr) {
|
||||
return clipboard_transitions.at(closing_transition);
|
||||
} else {
|
||||
return this->sequence->transitions.at(closing_transition);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
return closing_transition;
|
||||
}
|
||||
|
||||
Clip::~Clip() {
|
||||
if (open) {
|
||||
close_clip(ClipPtr(this), true);
|
||||
}
|
||||
if (open) {
|
||||
close_clip(ClipPtr(this), true);
|
||||
}
|
||||
|
||||
if (opening_transition != -1) this->sequence->hard_delete_transition(ClipPtr(this), TA_OPENING_TRANSITION);
|
||||
if (closing_transition != -1) this->sequence->hard_delete_transition(ClipPtr(this), TA_CLOSING_TRANSITION);
|
||||
|
||||
effects.clear();
|
||||
av_packet_free(&pkt);
|
||||
effects.clear();
|
||||
av_packet_free(&pkt);
|
||||
}
|
||||
|
||||
long Clip::get_clip_in_with_transition() {
|
||||
if (get_opening_transition() != nullptr && get_opening_transition()->secondary_clip != nullptr) {
|
||||
// we must be the secondary clip, so return (timeline in - length)
|
||||
return clip_in - get_opening_transition()->get_true_length();
|
||||
}
|
||||
return clip_in;
|
||||
if (get_opening_transition() != nullptr && get_opening_transition()->secondary_clip != nullptr) {
|
||||
// we must be the secondary clip, so return (timeline in - length)
|
||||
return clip_in - get_opening_transition()->get_true_length();
|
||||
}
|
||||
return clip_in;
|
||||
}
|
||||
|
||||
long Clip::get_timeline_in_with_transition() {
|
||||
if (get_opening_transition() != nullptr && get_opening_transition()->secondary_clip != nullptr) {
|
||||
// we must be the secondary clip, so return (timeline in - length)
|
||||
return timeline_in - get_opening_transition()->get_true_length();
|
||||
}
|
||||
return timeline_in;
|
||||
if (get_opening_transition() != nullptr && get_opening_transition()->secondary_clip != nullptr) {
|
||||
// we must be the secondary clip, so return (timeline in - length)
|
||||
return timeline_in - get_opening_transition()->get_true_length();
|
||||
}
|
||||
return timeline_in;
|
||||
}
|
||||
|
||||
long Clip::get_timeline_out_with_transition() {
|
||||
if (get_closing_transition() != nullptr && get_closing_transition()->secondary_clip != nullptr) {
|
||||
// we must be the primary clip, so return (timeline out + length2)
|
||||
return timeline_out + get_closing_transition()->get_true_length();
|
||||
} else {
|
||||
return timeline_out;
|
||||
}
|
||||
if (get_closing_transition() != nullptr && get_closing_transition()->secondary_clip != nullptr) {
|
||||
// we must be the primary clip, so return (timeline out + length2)
|
||||
return timeline_out + get_closing_transition()->get_true_length();
|
||||
} else {
|
||||
return timeline_out;
|
||||
}
|
||||
}
|
||||
|
||||
// timeline functions
|
||||
long Clip::getLength() {
|
||||
return timeline_out - timeline_in;
|
||||
return timeline_out - timeline_in;
|
||||
}
|
||||
|
||||
double Clip::getMediaFrameRate() {
|
||||
Q_ASSERT(track < 0);
|
||||
if (media != nullptr) {
|
||||
double rate = media->get_frame_rate(media_stream);
|
||||
if (!qIsNaN(rate)) return rate;
|
||||
}
|
||||
if (sequence != nullptr) return sequence->frame_rate;
|
||||
return qSNaN();
|
||||
Q_ASSERT(track < 0);
|
||||
if (media != nullptr) {
|
||||
double rate = media->get_frame_rate(media_stream);
|
||||
if (!qIsNaN(rate)) return rate;
|
||||
}
|
||||
if (sequence != nullptr) return sequence->frame_rate;
|
||||
return qSNaN();
|
||||
}
|
||||
|
||||
void Clip::recalculateMaxLength() {
|
||||
if (this->sequence != nullptr) {
|
||||
double fr = this->sequence->frame_rate;
|
||||
if (this->sequence != nullptr) {
|
||||
double fr = this->sequence->frame_rate;
|
||||
|
||||
fr /= speed;
|
||||
fr /= speed;
|
||||
|
||||
calculated_length = LONG_MAX;
|
||||
calculated_length = LONG_MAX;
|
||||
|
||||
if (media != nullptr) {
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
FootagePtr m = media->to_footage();
|
||||
const FootageStream* ms = m->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != nullptr && ms->infinite_length) {
|
||||
calculated_length = LONG_MAX;
|
||||
} else {
|
||||
calculated_length = m->get_length_in_frames(fr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
SequencePtr s = media->to_sequence();
|
||||
calculated_length = refactor_frame_number(s->getEndFrame(), s->frame_rate, fr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (media != nullptr) {
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
FootagePtr m = media->to_footage();
|
||||
const FootageStream* ms = m->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != nullptr && ms->infinite_length) {
|
||||
calculated_length = LONG_MAX;
|
||||
} else {
|
||||
calculated_length = m->get_length_in_frames(fr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
SequencePtr s = media->to_sequence();
|
||||
calculated_length = refactor_frame_number(s->getEndFrame(), s->frame_rate, fr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
long Clip::getMaximumLength() {
|
||||
return calculated_length;
|
||||
return calculated_length;
|
||||
}
|
||||
|
||||
int Clip::getWidth() {
|
||||
if (media == nullptr && sequence != nullptr) return sequence->width;
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
const FootageStream* ms = media->to_footage()->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != nullptr) return ms->video_width;
|
||||
if (sequence != nullptr) return sequence->width;
|
||||
break;
|
||||
}
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
SequencePtr s = media->to_sequence();
|
||||
return s->width;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
if (media == nullptr && sequence != nullptr) return sequence->width;
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
const FootageStream* ms = media->to_footage()->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != nullptr) return ms->video_width;
|
||||
if (sequence != nullptr) return sequence->width;
|
||||
break;
|
||||
}
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
SequencePtr s = media->to_sequence();
|
||||
return s->width;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Clip::getHeight() {
|
||||
if (media == nullptr && sequence != nullptr) return sequence->height;
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
const FootageStream* ms = media->to_footage()->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != nullptr) return ms->video_height;
|
||||
if (sequence != nullptr) return sequence->height;
|
||||
}
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
SequencePtr s = media->to_sequence();
|
||||
return s->height;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
if (media == nullptr && sequence != nullptr) return sequence->height;
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
const FootageStream* ms = media->to_footage()->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != nullptr) return ms->video_height;
|
||||
if (sequence != nullptr) return sequence->height;
|
||||
}
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
SequencePtr s = media->to_sequence();
|
||||
return s->height;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Clip::refactor_frame_rate(ComboAction* ca, double multiplier, bool change_timeline_points) {
|
||||
if (change_timeline_points) {
|
||||
move_clip(ca, ClipPtr(this),
|
||||
qRound((double) timeline_in * multiplier),
|
||||
qRound((double) timeline_out * multiplier),
|
||||
qRound((double) clip_in * multiplier),
|
||||
track);
|
||||
}
|
||||
if (change_timeline_points) {
|
||||
move_clip(ca, ClipPtr(this),
|
||||
qRound((double) timeline_in * multiplier),
|
||||
qRound((double) timeline_out * multiplier),
|
||||
qRound((double) clip_in * multiplier),
|
||||
track);
|
||||
}
|
||||
|
||||
// move keyframes
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
EffectPtr e = effects.at(i);
|
||||
for (int j=0;j<e->row_count();j++) {
|
||||
EffectRow* r = e->row(j);
|
||||
for (int l=0;l<r->fieldCount();l++) {
|
||||
EffectField* f = r->field(l);
|
||||
for (int k=0;k<f->keyframes.size();k++) {
|
||||
ca->append(new SetLong(&f->keyframes[k].time, f->keyframes[k].time, f->keyframes[k].time * multiplier));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// move keyframes
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
EffectPtr e = effects.at(i);
|
||||
for (int j=0;j<e->row_count();j++) {
|
||||
EffectRow* r = e->row(j);
|
||||
for (int l=0;l<r->fieldCount();l++) {
|
||||
EffectField* f = r->field(l);
|
||||
for (int k=0;k<f->keyframes.size();k++) {
|
||||
ca->append(new SetLong(&f->keyframes[k].time, f->keyframes[k].time, f->keyframes[k].time * multiplier));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+94
-94
@@ -38,8 +38,8 @@
|
||||
#include "marker.h"
|
||||
|
||||
extern "C" {
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/avfilter.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavfilter/avfilter.h>
|
||||
}
|
||||
|
||||
using ClipPtr = std::shared_ptr<Clip>;
|
||||
@@ -49,109 +49,109 @@ using SequencePtr = std::shared_ptr<Sequence>;
|
||||
|
||||
class Clip {
|
||||
public:
|
||||
Clip(SequencePtr s);
|
||||
~Clip();
|
||||
ClipPtr copy(SequencePtr s, bool duplicate_transitions = true);
|
||||
void reset_audio();
|
||||
void reset();
|
||||
void refresh();
|
||||
long get_clip_in_with_transition();
|
||||
long get_timeline_in_with_transition();
|
||||
long get_timeline_out_with_transition();
|
||||
long getLength();
|
||||
double getMediaFrameRate();
|
||||
long getMaximumLength();
|
||||
void recalculateMaxLength();
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
void refactor_frame_rate(ComboAction* ca, double multiplier, bool change_timeline_points);
|
||||
SequencePtr sequence;
|
||||
Clip(SequencePtr s);
|
||||
~Clip();
|
||||
ClipPtr copy(SequencePtr s, bool duplicate_transitions = true);
|
||||
void reset_audio();
|
||||
void reset();
|
||||
void refresh();
|
||||
long get_clip_in_with_transition();
|
||||
long get_timeline_in_with_transition();
|
||||
long get_timeline_out_with_transition();
|
||||
long getLength();
|
||||
double getMediaFrameRate();
|
||||
long getMaximumLength();
|
||||
void recalculateMaxLength();
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
void refactor_frame_rate(ComboAction* ca, double multiplier, bool change_timeline_points);
|
||||
SequencePtr sequence;
|
||||
|
||||
// queue functions
|
||||
void queue_clear();
|
||||
void queue_remove_earliest();
|
||||
// queue functions
|
||||
void queue_clear();
|
||||
void queue_remove_earliest();
|
||||
|
||||
// timeline variables (should be copied in copy())
|
||||
bool enabled;
|
||||
long clip_in;
|
||||
long timeline_in;
|
||||
long timeline_out;
|
||||
int track;
|
||||
QString name;
|
||||
quint8 color_r;
|
||||
quint8 color_g;
|
||||
quint8 color_b;
|
||||
Media* media;
|
||||
int media_stream;
|
||||
double speed;
|
||||
double cached_fr;
|
||||
bool reverse;
|
||||
bool maintain_audio_pitch;
|
||||
bool autoscale;
|
||||
// timeline variables (should be copied in copy())
|
||||
bool enabled;
|
||||
long clip_in;
|
||||
long timeline_in;
|
||||
long timeline_out;
|
||||
int track;
|
||||
QString name;
|
||||
quint8 color_r;
|
||||
quint8 color_g;
|
||||
quint8 color_b;
|
||||
Media* media;
|
||||
int media_stream;
|
||||
double speed;
|
||||
double cached_fr;
|
||||
bool reverse;
|
||||
bool maintain_audio_pitch;
|
||||
bool autoscale;
|
||||
|
||||
// markers
|
||||
QVector<Marker>& get_markers();
|
||||
// markers
|
||||
QVector<Marker>& get_markers();
|
||||
|
||||
// other variables (should be deep copied/duplicated in copy())
|
||||
QList<EffectPtr> effects;
|
||||
QVector<int> linked;
|
||||
int opening_transition;
|
||||
TransitionPtr get_opening_transition();
|
||||
int closing_transition;
|
||||
TransitionPtr get_closing_transition();
|
||||
// other variables (should be deep copied/duplicated in copy())
|
||||
QList<EffectPtr> effects;
|
||||
QVector<int> linked;
|
||||
TransitionPtr opening_transition;
|
||||
TransitionPtr get_opening_transition();
|
||||
TransitionPtr closing_transition;
|
||||
TransitionPtr get_closing_transition();
|
||||
|
||||
// media handling
|
||||
AVFormatContext* formatCtx;
|
||||
AVStream* stream;
|
||||
AVCodec* codec;
|
||||
AVCodecContext* codecCtx;
|
||||
AVPacket* pkt;
|
||||
AVFrame* frame;
|
||||
AVDictionary* opts;
|
||||
long calculated_length;
|
||||
// media handling
|
||||
AVFormatContext* formatCtx;
|
||||
AVStream* stream;
|
||||
AVCodec* codec;
|
||||
AVCodecContext* codecCtx;
|
||||
AVPacket* pkt;
|
||||
AVFrame* frame;
|
||||
AVDictionary* opts;
|
||||
long calculated_length;
|
||||
|
||||
// temporary variables
|
||||
int load_id;
|
||||
bool undeletable;
|
||||
bool reached_end;
|
||||
bool pkt_written;
|
||||
bool open;
|
||||
bool finished_opening;
|
||||
bool replaced;
|
||||
bool ignore_reverse;
|
||||
int pix_fmt;
|
||||
// temporary variables
|
||||
int load_id;
|
||||
bool undeletable;
|
||||
bool reached_end;
|
||||
bool pkt_written;
|
||||
bool open;
|
||||
bool finished_opening;
|
||||
bool replaced;
|
||||
bool ignore_reverse;
|
||||
int pix_fmt;
|
||||
|
||||
// caching functions
|
||||
bool use_existing_frame;
|
||||
bool multithreaded;
|
||||
Cacher* cacher;
|
||||
QWaitCondition can_cache;
|
||||
int max_queue_size;
|
||||
QVector<AVFrame*> queue;
|
||||
QMutex queue_lock;
|
||||
QMutex lock;
|
||||
QMutex open_lock;
|
||||
int64_t last_invalid_ts;
|
||||
// caching functions
|
||||
bool use_existing_frame;
|
||||
bool multithreaded;
|
||||
Cacher* cacher;
|
||||
QWaitCondition can_cache;
|
||||
int max_queue_size;
|
||||
QVector<AVFrame*> queue;
|
||||
QMutex queue_lock;
|
||||
QMutex lock;
|
||||
QMutex open_lock;
|
||||
int64_t last_invalid_ts;
|
||||
|
||||
// converters/filters
|
||||
AVFilterGraph* filter_graph;
|
||||
AVFilterContext* buffersink_ctx;
|
||||
AVFilterContext* buffersrc_ctx;
|
||||
// converters/filters
|
||||
AVFilterGraph* filter_graph;
|
||||
AVFilterContext* buffersink_ctx;
|
||||
AVFilterContext* buffersrc_ctx;
|
||||
|
||||
// video playback variables
|
||||
QOpenGLFramebufferObject** fbo;
|
||||
QOpenGLTexture* texture;
|
||||
long texture_frame;
|
||||
// video playback variables
|
||||
QOpenGLFramebufferObject** fbo;
|
||||
QOpenGLTexture* texture;
|
||||
long texture_frame;
|
||||
|
||||
// audio playback variables
|
||||
int64_t reverse_target;
|
||||
int frame_sample_index;
|
||||
qint64 audio_buffer_write;
|
||||
bool audio_reset;
|
||||
bool audio_just_reset;
|
||||
long audio_target_frame;
|
||||
// audio playback variables
|
||||
int64_t reverse_target;
|
||||
int frame_sample_index;
|
||||
qint64 audio_buffer_write;
|
||||
bool audio_reset;
|
||||
bool audio_just_reset;
|
||||
long audio_target_frame;
|
||||
private:
|
||||
QVector<Marker> markers;
|
||||
QVector<Marker> markers;
|
||||
};
|
||||
|
||||
#endif // CLIP_H
|
||||
|
||||
@@ -67,42 +67,6 @@ long Sequence::getEndFrame() {
|
||||
return end;
|
||||
}
|
||||
|
||||
void Sequence::hard_delete_transition(ClipPtr c, int type) {
|
||||
int transition_index = (type == TA_OPENING_TRANSITION) ? c->opening_transition : c->closing_transition;
|
||||
if (transition_index > -1) {
|
||||
bool del = true;
|
||||
|
||||
TransitionPtr t = transitions.at(transition_index);
|
||||
if (t->secondary_clip != nullptr) {
|
||||
for (int i=0;i<clips.size();i++) {
|
||||
ClipPtr comp = clips.at(i);
|
||||
if (comp != nullptr
|
||||
&& c != comp
|
||||
&& (c->opening_transition == transition_index
|
||||
|| c->closing_transition == transition_index)) {
|
||||
if (type == TA_OPENING_TRANSITION) {
|
||||
// convert to closing transition
|
||||
t->parent_clip = t->secondary_clip;
|
||||
}
|
||||
|
||||
del = false;
|
||||
t->secondary_clip = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (del) {
|
||||
transitions[transition_index].reset();
|
||||
}
|
||||
|
||||
if (type == TA_OPENING_TRANSITION) {
|
||||
c->opening_transition = -1;
|
||||
} else {
|
||||
c->closing_transition = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Sequence::getTrackLimits(int* video_tracks, int* audio_tracks) {
|
||||
int vt = 0;
|
||||
int at = 0;
|
||||
|
||||
+1
-3
@@ -35,8 +35,7 @@ public:
|
||||
SequencePtr copy();
|
||||
QString name;
|
||||
void getTrackLimits(int* video_tracks, int* audio_tracks);
|
||||
long getEndFrame();
|
||||
void hard_delete_transition(ClipPtr c, int type);
|
||||
long getEndFrame();
|
||||
int width;
|
||||
int height;
|
||||
double frame_rate;
|
||||
@@ -56,7 +55,6 @@ public:
|
||||
|
||||
QVector<Marker> markers;
|
||||
QVector<ClipPtr> clips;
|
||||
QVector<TransitionPtr> transitions;
|
||||
};
|
||||
|
||||
using SequencePtr = std::shared_ptr<Sequence>;
|
||||
|
||||
+67
-49
@@ -42,74 +42,92 @@
|
||||
#include <QCoreApplication>
|
||||
|
||||
Transition::Transition(ClipPtr c, ClipPtr s, const EffectMeta* em) :
|
||||
Effect(c, em), secondary_clip(s),
|
||||
length(30)
|
||||
Effect(c, em), secondary_clip(s),
|
||||
length(30)
|
||||
{
|
||||
length_field = add_row(tr("Length"), false)->add_field(EFFECT_FIELD_DOUBLE, "length");
|
||||
connect(length_field, SIGNAL(changed()), this, SLOT(set_length_from_slider()));
|
||||
length_field->set_double_default_value(30);
|
||||
length_field->set_double_minimum_value(0);
|
||||
length_field = add_row(tr("Length"), false)->add_field(EFFECT_FIELD_DOUBLE, "length");
|
||||
connect(length_field, SIGNAL(changed()), this, SLOT(set_length_from_slider()));
|
||||
length_field->set_double_default_value(30);
|
||||
length_field->set_double_minimum_value(0);
|
||||
|
||||
LabelSlider* length_ui_ele = static_cast<LabelSlider*>(length_field->ui_element);
|
||||
length_ui_ele->set_display_type(LABELSLIDER_FRAMENUMBER);
|
||||
length_ui_ele->set_frame_rate(parent_clip->sequence == nullptr ? parent_clip->cached_fr : parent_clip->sequence->frame_rate);
|
||||
LabelSlider* length_ui_ele = static_cast<LabelSlider*>(length_field->ui_element);
|
||||
length_ui_ele->set_display_type(LABELSLIDER_FRAMENUMBER);
|
||||
length_ui_ele->set_frame_rate(parent_clip->sequence == nullptr ? parent_clip->cached_fr : parent_clip->sequence->frame_rate);
|
||||
}
|
||||
|
||||
int Transition::copy(ClipPtr c, ClipPtr s) {
|
||||
return create_transition(c, s, meta, length);
|
||||
TransitionPtr Transition::copy(ClipPtr c, ClipPtr s) {
|
||||
return create_transition(c, s, meta, length);
|
||||
}
|
||||
|
||||
void Transition::set_length(long l) {
|
||||
length = l;
|
||||
length_field->set_double_value(l);
|
||||
length = l;
|
||||
length_field->set_double_value(l);
|
||||
}
|
||||
|
||||
long Transition::get_true_length() {
|
||||
return length;
|
||||
return length;
|
||||
}
|
||||
|
||||
long Transition::get_length() {
|
||||
if (secondary_clip != nullptr) {
|
||||
return length * 2;
|
||||
}
|
||||
return length;
|
||||
if (secondary_clip != nullptr) {
|
||||
return length * 2;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
ClipPtr Transition::get_opened_clip() {
|
||||
if (parent_clip->opening_transition.get() == this) {
|
||||
return parent_clip;
|
||||
} else if (secondary_clip != nullptr && secondary_clip->opening_transition.get() == this) {
|
||||
return secondary_clip;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ClipPtr Transition::get_closed_clip() {
|
||||
if (parent_clip->closing_transition.get() == this) {
|
||||
return parent_clip;
|
||||
} else if (secondary_clip != nullptr && secondary_clip->closing_transition.get() == this) {
|
||||
return secondary_clip;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Transition::set_length_from_slider() {
|
||||
set_length(length_field->get_double_value(0));
|
||||
update_ui(false);
|
||||
set_length(length_field->get_double_value(0));
|
||||
update_ui(false);
|
||||
}
|
||||
|
||||
TransitionPtr get_transition_from_meta(ClipPtr c, ClipPtr s, const EffectMeta* em) {
|
||||
if (!em->filename.isEmpty()) {
|
||||
// load effect from file
|
||||
return TransitionPtr(new Transition(c, s, em));
|
||||
} else if (em->internal >= 0 && em->internal < TRANSITION_INTERNAL_COUNT) {
|
||||
// must be an internal effect
|
||||
switch (em->internal) {
|
||||
case TRANSITION_INTERNAL_CROSSDISSOLVE: return TransitionPtr(new CrossDissolveTransition(c, s, em));
|
||||
case TRANSITION_INTERNAL_LINEARFADE: return TransitionPtr(new LinearFadeTransition(c, s, em));
|
||||
case TRANSITION_INTERNAL_EXPONENTIALFADE: return TransitionPtr(new ExponentialFadeTransition(c, s, em));
|
||||
case TRANSITION_INTERNAL_LOGARITHMICFADE: return TransitionPtr(new LogarithmicFadeTransition(c, s, em));
|
||||
case TRANSITION_INTERNAL_CUBE: return TransitionPtr(new CubeTransition(c, s, em));
|
||||
}
|
||||
} else {
|
||||
qCritical() << "Invalid transition data";
|
||||
QMessageBox::critical(olive::MainWindow,
|
||||
QCoreApplication::translate("transition", "Invalid transition"),
|
||||
QCoreApplication::translate("transition", "No candidate for transition '%1'. This transition may be corrupt. Try reinstalling it or Olive.").arg(em->name)
|
||||
);
|
||||
}
|
||||
return nullptr;
|
||||
if (!em->filename.isEmpty()) {
|
||||
// load effect from file
|
||||
return TransitionPtr(new Transition(c, s, em));
|
||||
} else if (em->internal >= 0 && em->internal < TRANSITION_INTERNAL_COUNT) {
|
||||
// must be an internal effect
|
||||
switch (em->internal) {
|
||||
case TRANSITION_INTERNAL_CROSSDISSOLVE: return TransitionPtr(new CrossDissolveTransition(c, s, em));
|
||||
case TRANSITION_INTERNAL_LINEARFADE: return TransitionPtr(new LinearFadeTransition(c, s, em));
|
||||
case TRANSITION_INTERNAL_EXPONENTIALFADE: return TransitionPtr(new ExponentialFadeTransition(c, s, em));
|
||||
case TRANSITION_INTERNAL_LOGARITHMICFADE: return TransitionPtr(new LogarithmicFadeTransition(c, s, em));
|
||||
case TRANSITION_INTERNAL_CUBE: return TransitionPtr(new CubeTransition(c, s, em));
|
||||
}
|
||||
} else {
|
||||
qCritical() << "Invalid transition data";
|
||||
QMessageBox::critical(olive::MainWindow,
|
||||
QCoreApplication::translate("transition", "Invalid transition"),
|
||||
QCoreApplication::translate("transition", "No candidate for transition '%1'. This transition may be corrupt. Try reinstalling it or Olive.").arg(em->name)
|
||||
);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int create_transition(ClipPtr c, ClipPtr s, const EffectMeta* em, long length) {
|
||||
TransitionPtr t(get_transition_from_meta(c, s, em));
|
||||
if (t != nullptr) {
|
||||
if (length >= 0) t->set_length(length);
|
||||
QVector<TransitionPtr>& transition_list = (c->sequence == nullptr) ? clipboard_transitions : c->sequence->transitions;
|
||||
transition_list.append(t);
|
||||
return transition_list.size() - 1;
|
||||
}
|
||||
return -1;
|
||||
TransitionPtr create_transition(ClipPtr c, ClipPtr s, const EffectMeta* em, long length) {
|
||||
TransitionPtr t(get_transition_from_meta(c, s, em));
|
||||
if (t != nullptr) {
|
||||
if (length > 0) {
|
||||
t->set_length(length);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+37
-27
@@ -23,35 +23,45 @@
|
||||
|
||||
#include "effect.h"
|
||||
|
||||
#define TA_NO_TRANSITION 0
|
||||
#define TA_OPENING_TRANSITION 1
|
||||
#define TA_CLOSING_TRANSITION 2
|
||||
|
||||
#define TRANSITION_INTERNAL_CROSSDISSOLVE 0
|
||||
#define TRANSITION_INTERNAL_LINEARFADE 1
|
||||
#define TRANSITION_INTERNAL_EXPONENTIALFADE 2
|
||||
#define TRANSITION_INTERNAL_LOGARITHMICFADE 3
|
||||
#define TRANSITION_INTERNAL_CUBE 4
|
||||
#define TRANSITION_INTERNAL_COUNT 5
|
||||
|
||||
int create_transition(ClipPtr c, ClipPtr s, const EffectMeta* em, long length = -1);
|
||||
|
||||
class Transition : public Effect {
|
||||
Q_OBJECT
|
||||
public:
|
||||
Transition(ClipPtr c, ClipPtr s, const EffectMeta* em);
|
||||
int copy(ClipPtr c, ClipPtr s);
|
||||
ClipPtr secondary_clip;
|
||||
void set_length(long l);
|
||||
long get_true_length();
|
||||
long get_length();
|
||||
private slots:
|
||||
void set_length_from_slider();
|
||||
private:
|
||||
long length; // used only for transitions
|
||||
EffectField* length_field;
|
||||
enum TransitionType {
|
||||
kTransitionNone,
|
||||
kTransitionOpening,
|
||||
kTransitionClosing
|
||||
};
|
||||
|
||||
enum TransitionInternal {
|
||||
TRANSITION_INTERNAL_CROSSDISSOLVE,
|
||||
TRANSITION_INTERNAL_LINEARFADE,
|
||||
TRANSITION_INTERNAL_EXPONENTIALFADE,
|
||||
TRANSITION_INTERNAL_LOGARITHMICFADE,
|
||||
TRANSITION_INTERNAL_CUBE,
|
||||
TRANSITION_INTERNAL_COUNT
|
||||
};
|
||||
|
||||
class Transition;
|
||||
using TransitionPtr = std::shared_ptr<Transition>;
|
||||
|
||||
TransitionPtr get_transition_from_meta(ClipPtr c, ClipPtr s, const EffectMeta* em);
|
||||
|
||||
TransitionPtr create_transition(ClipPtr c, ClipPtr s, const EffectMeta* em, long length = 0);
|
||||
|
||||
class Transition : public Effect {
|
||||
Q_OBJECT
|
||||
public:
|
||||
Transition(ClipPtr c, ClipPtr s, const EffectMeta* em);
|
||||
virtual TransitionPtr copy(ClipPtr c, ClipPtr s);
|
||||
ClipPtr secondary_clip;
|
||||
void set_length(long l);
|
||||
long get_true_length();
|
||||
long get_length();
|
||||
|
||||
ClipPtr get_opened_clip();
|
||||
ClipPtr get_closed_clip();
|
||||
private slots:
|
||||
void set_length_from_slider();
|
||||
private:
|
||||
long length; // used only for transitions
|
||||
EffectField* length_field;
|
||||
};
|
||||
|
||||
#endif // TRANSITION_H
|
||||
|
||||
+616
-651
File diff suppressed because it is too large
Load Diff
+331
-335
@@ -36,594 +36,590 @@
|
||||
#include <QModelIndex>
|
||||
|
||||
namespace olive {
|
||||
extern QUndoStack UndoStack;
|
||||
extern QUndoStack UndoStack;
|
||||
}
|
||||
|
||||
class OliveAction : public QUndoCommand {
|
||||
public:
|
||||
OliveAction(bool iset_window_modified = true);
|
||||
virtual ~OliveAction() override;
|
||||
OliveAction(bool iset_window_modified = true);
|
||||
virtual ~OliveAction() override;
|
||||
|
||||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
|
||||
virtual void doUndo() = 0;
|
||||
virtual void doRedo() = 0;
|
||||
virtual void doUndo() = 0;
|
||||
virtual void doRedo() = 0;
|
||||
private:
|
||||
/**
|
||||
/**
|
||||
* @brief Setting whether to change the windowModified state of MainWindow
|
||||
*/
|
||||
bool set_window_modified;
|
||||
bool set_window_modified;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Cache previous window modified value to return to if the user undoes this action
|
||||
*/
|
||||
bool old_window_modified;
|
||||
bool old_window_modified;
|
||||
};
|
||||
|
||||
class MoveClipAction : public OliveAction {
|
||||
public:
|
||||
MoveClipAction(ClipPtr c, long iin, long iout, long iclip_in, int itrack, bool irelative);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
MoveClipAction(ClipPtr c, long iin, long iout, long iclip_in, int itrack, bool irelative);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
ClipPtr clip;
|
||||
ClipPtr clip;
|
||||
|
||||
long old_in;
|
||||
long old_out;
|
||||
long old_clip_in;
|
||||
int old_track;
|
||||
long old_in;
|
||||
long old_out;
|
||||
long old_clip_in;
|
||||
int old_track;
|
||||
|
||||
long new_in;
|
||||
long new_out;
|
||||
long new_clip_in;
|
||||
int new_track;
|
||||
long new_in;
|
||||
long new_out;
|
||||
long new_clip_in;
|
||||
int new_track;
|
||||
|
||||
bool relative;
|
||||
bool relative;
|
||||
};
|
||||
|
||||
class RippleAction : public OliveAction {
|
||||
public:
|
||||
RippleAction(SequencePtr is, long ipoint, long ilength, const QVector<int>& iignore);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
RippleAction(SequencePtr is, long ipoint, long ilength, const QVector<int>& iignore);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
SequencePtr s;
|
||||
long point;
|
||||
long length;
|
||||
QVector<int> ignore;
|
||||
ComboAction* ca;
|
||||
SequencePtr s;
|
||||
long point;
|
||||
long length;
|
||||
QVector<int> ignore;
|
||||
ComboAction* ca;
|
||||
};
|
||||
|
||||
class DeleteClipAction : public OliveAction {
|
||||
public:
|
||||
DeleteClipAction(SequencePtr s, int clip);
|
||||
virtual ~DeleteClipAction() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
DeleteClipAction(SequencePtr s, int clip);
|
||||
virtual ~DeleteClipAction() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
SequencePtr seq;
|
||||
ClipPtr ref;
|
||||
int index;
|
||||
SequencePtr seq;
|
||||
ClipPtr ref;
|
||||
int index;
|
||||
|
||||
int opening_transition;
|
||||
int closing_transition;
|
||||
int opening_transition;
|
||||
int closing_transition;
|
||||
|
||||
QVector<int> linkClipIndex;
|
||||
QVector<int> linkLinkIndex;
|
||||
QVector<int> linkClipIndex;
|
||||
QVector<int> linkLinkIndex;
|
||||
};
|
||||
|
||||
class ChangeSequenceAction : public OliveAction {
|
||||
public:
|
||||
ChangeSequenceAction(SequencePtr s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
ChangeSequenceAction(SequencePtr s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
SequencePtr old_sequence;
|
||||
SequencePtr new_sequence;
|
||||
SequencePtr old_sequence;
|
||||
SequencePtr new_sequence;
|
||||
};
|
||||
|
||||
class AddEffectCommand : public OliveAction {
|
||||
public:
|
||||
AddEffectCommand(ClipPtr c, EffectPtr e, const EffectMeta* m, int insert_pos = -1);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
AddEffectCommand(ClipPtr c, EffectPtr e, const EffectMeta* m, int insert_pos = -1);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
ClipPtr clip;
|
||||
const EffectMeta* meta;
|
||||
EffectPtr ref;
|
||||
int pos;
|
||||
bool done;
|
||||
ClipPtr clip;
|
||||
const EffectMeta* meta;
|
||||
EffectPtr ref;
|
||||
int pos;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddTransitionCommand : public OliveAction {
|
||||
public:
|
||||
AddTransitionCommand(ClipPtr c, ClipPtr s, TransitionPtr copy, const EffectMeta* itransition, int itype, int ilength);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
AddTransitionCommand(ClipPtr c, ClipPtr s, TransitionPtr copy, const EffectMeta* itransition, int itype, int ilength);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
ClipPtr clip;
|
||||
ClipPtr secondary;
|
||||
TransitionPtr transition_to_copy;
|
||||
const EffectMeta* transition;
|
||||
int type;
|
||||
int length;
|
||||
int old_ptransition;
|
||||
int old_stransition;
|
||||
ClipPtr primary;
|
||||
ClipPtr secondary;
|
||||
TransitionPtr transition_to_copy;
|
||||
const EffectMeta* transition_meta_;
|
||||
int type;
|
||||
int length;
|
||||
TransitionPtr old_ptransition;
|
||||
TransitionPtr old_stransition;
|
||||
};
|
||||
|
||||
class ModifyTransitionCommand : public OliveAction {
|
||||
public:
|
||||
ModifyTransitionCommand(ClipPtr c, int itype, long ilength);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
ModifyTransitionCommand(TransitionPtr t, long ilength);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
ClipPtr clip;
|
||||
int type;
|
||||
long new_length;
|
||||
long old_length;
|
||||
TransitionPtr transition_ref_;
|
||||
long new_length_;
|
||||
long old_length_;
|
||||
};
|
||||
|
||||
class DeleteTransitionCommand : public OliveAction {
|
||||
public:
|
||||
DeleteTransitionCommand(SequencePtr s, int transition_index);
|
||||
virtual ~DeleteTransitionCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
DeleteTransitionCommand(TransitionPtr t);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
SequencePtr seq;
|
||||
int index;
|
||||
TransitionPtr transition;
|
||||
ClipPtr otc;
|
||||
ClipPtr ctc;
|
||||
TransitionPtr transition_ref_;
|
||||
ClipPtr opened_clip_;
|
||||
ClipPtr closed_clip_;
|
||||
};
|
||||
|
||||
class SetTimelineInOutCommand : public OliveAction {
|
||||
public:
|
||||
SetTimelineInOutCommand(SequencePtr s, bool enabled, long in, long out);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetTimelineInOutCommand(SequencePtr s, bool enabled, long in, long out);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
SequencePtr seq;
|
||||
SequencePtr seq;
|
||||
|
||||
bool old_enabled;
|
||||
long old_in;
|
||||
long old_out;
|
||||
bool old_enabled;
|
||||
long old_in;
|
||||
long old_out;
|
||||
|
||||
bool new_enabled;
|
||||
long new_in;
|
||||
long new_out;
|
||||
bool new_enabled;
|
||||
long new_in;
|
||||
long new_out;
|
||||
};
|
||||
|
||||
class NewSequenceCommand : public OliveAction {
|
||||
public:
|
||||
NewSequenceCommand(Media* s, Media* iparent);
|
||||
virtual ~NewSequenceCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
NewSequenceCommand(Media* s, Media* iparent);
|
||||
virtual ~NewSequenceCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* seq;
|
||||
Media* parent;
|
||||
bool done;
|
||||
Media* seq;
|
||||
Media* parent;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddMediaCommand : public OliveAction {
|
||||
public:
|
||||
AddMediaCommand(Media* iitem, Media* iparent);
|
||||
virtual ~AddMediaCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
AddMediaCommand(Media* iitem, Media* iparent);
|
||||
virtual ~AddMediaCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
Media* parent;
|
||||
bool done;
|
||||
Media* item;
|
||||
Media* parent;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class DeleteMediaCommand : public OliveAction {
|
||||
public:
|
||||
DeleteMediaCommand(Media *i);
|
||||
virtual ~DeleteMediaCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
DeleteMediaCommand(Media *i);
|
||||
virtual ~DeleteMediaCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
Media* parent;
|
||||
bool done;
|
||||
Media* item;
|
||||
Media* parent;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddClipCommand : public OliveAction {
|
||||
public:
|
||||
AddClipCommand(SequencePtr s, QVector<ClipPtr>& add);
|
||||
virtual ~AddClipCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
AddClipCommand(SequencePtr s, QVector<ClipPtr>& add);
|
||||
virtual ~AddClipCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
SequencePtr seq;
|
||||
QVector<ClipPtr> clips;
|
||||
QVector<ClipPtr> undone_clips;
|
||||
SequencePtr seq;
|
||||
QVector<ClipPtr> clips;
|
||||
QVector<ClipPtr> undone_clips;
|
||||
};
|
||||
|
||||
class LinkCommand : public OliveAction {
|
||||
public:
|
||||
LinkCommand();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SequencePtr s;
|
||||
QVector<int> clips;
|
||||
bool link;
|
||||
LinkCommand();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SequencePtr s;
|
||||
QVector<int> clips;
|
||||
bool link;
|
||||
private:
|
||||
QVector< QVector<int> > old_links;
|
||||
QVector< QVector<int> > old_links;
|
||||
};
|
||||
|
||||
class CheckboxCommand : public OliveAction {
|
||||
public:
|
||||
CheckboxCommand(QCheckBox* b);
|
||||
virtual ~CheckboxCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
CheckboxCommand(QCheckBox* b);
|
||||
virtual ~CheckboxCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QCheckBox* box;
|
||||
bool checked;
|
||||
bool done;
|
||||
QCheckBox* box;
|
||||
bool checked;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class ReplaceMediaCommand : public OliveAction {
|
||||
public:
|
||||
ReplaceMediaCommand(Media*, QString);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
ReplaceMediaCommand(Media*, QString);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media *item;
|
||||
QString old_filename;
|
||||
QString new_filename;
|
||||
void replace(QString& filename);
|
||||
Media *item;
|
||||
QString old_filename;
|
||||
QString new_filename;
|
||||
void replace(QString& filename);
|
||||
};
|
||||
|
||||
class ReplaceClipMediaCommand : public OliveAction {
|
||||
public:
|
||||
ReplaceClipMediaCommand(Media *, Media *, bool);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<ClipPtr> clips;
|
||||
ReplaceClipMediaCommand(Media *, Media *, bool);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<ClipPtr> clips;
|
||||
private:
|
||||
Media* old_media;
|
||||
Media* new_media;
|
||||
bool preserve_clip_ins;
|
||||
QVector<int> old_clip_ins;
|
||||
void replace(bool undo);
|
||||
Media* old_media;
|
||||
Media* new_media;
|
||||
bool preserve_clip_ins;
|
||||
QVector<int> old_clip_ins;
|
||||
void replace(bool undo);
|
||||
};
|
||||
|
||||
class EffectDeleteCommand : public OliveAction {
|
||||
public:
|
||||
EffectDeleteCommand();
|
||||
virtual ~EffectDeleteCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<ClipPtr> clips;
|
||||
QVector<int> fx;
|
||||
EffectDeleteCommand();
|
||||
virtual ~EffectDeleteCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<ClipPtr> clips;
|
||||
QVector<int> fx;
|
||||
private:
|
||||
bool done;
|
||||
QVector<EffectPtr> deleted_objects;
|
||||
bool done;
|
||||
QVector<EffectPtr> deleted_objects;
|
||||
};
|
||||
|
||||
class MediaMove : public OliveAction {
|
||||
public:
|
||||
MediaMove();
|
||||
QVector<Media*> items;
|
||||
Media* to;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
MediaMove();
|
||||
QVector<Media*> items;
|
||||
Media* to;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QVector<Media*> froms;
|
||||
QVector<Media*> froms;
|
||||
};
|
||||
|
||||
class MediaRename : public OliveAction {
|
||||
public:
|
||||
MediaRename(Media* iitem, QString to);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
MediaRename(Media* iitem, QString to);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
QString from;
|
||||
QString to;
|
||||
Media* item;
|
||||
QString from;
|
||||
QString to;
|
||||
};
|
||||
|
||||
class KeyframeDelete : public OliveAction {
|
||||
public:
|
||||
KeyframeDelete(EffectField* ifield, int iindex);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
KeyframeDelete(EffectField* ifield, int iindex);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectField* field;
|
||||
int index;
|
||||
bool done;
|
||||
EffectKeyframe deleted_key;
|
||||
EffectField* field;
|
||||
int index;
|
||||
bool done;
|
||||
EffectKeyframe deleted_key;
|
||||
};
|
||||
|
||||
// a more modern version of the above, could probably replace it
|
||||
// assumes the keyframe already exists
|
||||
class KeyframeFieldSet : public OliveAction {
|
||||
public:
|
||||
KeyframeFieldSet(EffectField* ifield, int ii);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
KeyframeFieldSet(EffectField* ifield, int ii);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectField* field;
|
||||
int index;
|
||||
EffectKeyframe key;
|
||||
bool done;
|
||||
EffectField* field;
|
||||
int index;
|
||||
EffectKeyframe key;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class EffectFieldUndo : public OliveAction {
|
||||
public:
|
||||
EffectFieldUndo(EffectField* field);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
EffectFieldUndo(EffectField* field);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectField* field;
|
||||
QVariant old_val;
|
||||
QVariant new_val;
|
||||
bool done;
|
||||
EffectField* field;
|
||||
QVariant old_val;
|
||||
QVariant new_val;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class SetAutoscaleAction : public OliveAction {
|
||||
public:
|
||||
SetAutoscaleAction();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<ClipPtr> clips;
|
||||
SetAutoscaleAction();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<ClipPtr> clips;
|
||||
};
|
||||
|
||||
class AddMarkerAction : public OliveAction {
|
||||
public:
|
||||
AddMarkerAction(QVector<Marker>* m, long t, QString n);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
AddMarkerAction(QVector<Marker>* m, long t, QString n);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QVector<Marker>* active_array;
|
||||
long time;
|
||||
QString name;
|
||||
QString old_name;
|
||||
int index;
|
||||
QVector<Marker>* active_array;
|
||||
long time;
|
||||
QString name;
|
||||
QString old_name;
|
||||
int index;
|
||||
};
|
||||
|
||||
class MoveMarkerAction : public OliveAction {
|
||||
public:
|
||||
MoveMarkerAction(Marker* m, long o, long n);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
MoveMarkerAction(Marker* m, long o, long n);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Marker* marker;
|
||||
long old_time;
|
||||
long new_time;
|
||||
Marker* marker;
|
||||
long old_time;
|
||||
long new_time;
|
||||
};
|
||||
|
||||
class DeleteMarkerAction : public OliveAction {
|
||||
public:
|
||||
DeleteMarkerAction(QVector<Marker>* m);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<int> markers;
|
||||
DeleteMarkerAction(QVector<Marker>* m);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<int> markers;
|
||||
private:
|
||||
QVector<Marker>* active_array;
|
||||
QVector<Marker> copies;
|
||||
bool sorted;
|
||||
QVector<Marker>* active_array;
|
||||
QVector<Marker> copies;
|
||||
bool sorted;
|
||||
};
|
||||
|
||||
class SetSpeedAction : public OliveAction {
|
||||
public:
|
||||
SetSpeedAction(ClipPtr c, double speed);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetSpeedAction(ClipPtr c, double speed);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
ClipPtr clip;
|
||||
double old_speed;
|
||||
double new_speed;
|
||||
ClipPtr clip;
|
||||
double old_speed;
|
||||
double new_speed;
|
||||
};
|
||||
|
||||
class SetBool : public OliveAction {
|
||||
public:
|
||||
SetBool(bool* b, bool setting);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetBool(bool* b, bool setting);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
bool* boolean;
|
||||
bool old_setting;
|
||||
bool new_setting;
|
||||
bool* boolean;
|
||||
bool old_setting;
|
||||
bool new_setting;
|
||||
};
|
||||
|
||||
class SetSelectionsCommand : public OliveAction {
|
||||
public:
|
||||
SetSelectionsCommand(SequencePtr s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<Selection> old_data;
|
||||
QVector<Selection> new_data;
|
||||
SetSelectionsCommand(SequencePtr s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<Selection> old_data;
|
||||
QVector<Selection> new_data;
|
||||
private:
|
||||
SequencePtr seq;
|
||||
bool done;
|
||||
SequencePtr seq;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class EditSequenceCommand : public OliveAction {
|
||||
public:
|
||||
EditSequenceCommand(Media *i, SequencePtr s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
void update();
|
||||
EditSequenceCommand(Media *i, SequencePtr s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
void update();
|
||||
|
||||
QString name;
|
||||
int width;
|
||||
int height;
|
||||
double frame_rate;
|
||||
int audio_frequency;
|
||||
int audio_layout;
|
||||
QString name;
|
||||
int width;
|
||||
int height;
|
||||
double frame_rate;
|
||||
int audio_frequency;
|
||||
int audio_layout;
|
||||
private:
|
||||
Media* item;
|
||||
SequencePtr seq;
|
||||
Media* item;
|
||||
SequencePtr seq;
|
||||
|
||||
QString old_name;
|
||||
int old_width;
|
||||
int old_height;
|
||||
double old_frame_rate;
|
||||
int old_audio_frequency;
|
||||
int old_audio_layout;
|
||||
QString old_name;
|
||||
int old_width;
|
||||
int old_height;
|
||||
double old_frame_rate;
|
||||
int old_audio_frequency;
|
||||
int old_audio_layout;
|
||||
};
|
||||
|
||||
class SetInt : public OliveAction {
|
||||
public:
|
||||
SetInt(int* pointer, int new_value);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetInt(int* pointer, int new_value);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
int* p;
|
||||
int oldval;
|
||||
int newval;
|
||||
int* p;
|
||||
int oldval;
|
||||
int newval;
|
||||
};
|
||||
|
||||
class SetLong : public OliveAction {
|
||||
public:
|
||||
SetLong(long* pointer, long old_value, long new_value);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetLong(long* pointer, long old_value, long new_value);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
long* p;
|
||||
long oldval;
|
||||
long newval;
|
||||
long* p;
|
||||
long oldval;
|
||||
long newval;
|
||||
};
|
||||
|
||||
class SetDouble : public OliveAction {
|
||||
public:
|
||||
SetDouble(double* pointer, double old_value, double new_value);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetDouble(double* pointer, double old_value, double new_value);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
double* p;
|
||||
double oldval;
|
||||
double newval;
|
||||
double* p;
|
||||
double oldval;
|
||||
double newval;
|
||||
};
|
||||
|
||||
class SetString : public OliveAction {
|
||||
public:
|
||||
SetString(QString* pointer, QString new_value);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetString(QString* pointer, QString new_value);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QString* p;
|
||||
QString oldval;
|
||||
QString newval;
|
||||
QString* p;
|
||||
QString oldval;
|
||||
QString newval;
|
||||
};
|
||||
|
||||
class CloseAllClipsCommand : public OliveAction {
|
||||
public:
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
};
|
||||
|
||||
class UpdateFootageTooltip : public OliveAction {
|
||||
public:
|
||||
UpdateFootageTooltip(Media* i);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
UpdateFootageTooltip(Media* i);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
Media* item;
|
||||
};
|
||||
|
||||
class MoveEffectCommand : public OliveAction {
|
||||
public:
|
||||
MoveEffectCommand();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
ClipPtr clip;
|
||||
int from;
|
||||
int to;
|
||||
MoveEffectCommand();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
ClipPtr clip;
|
||||
int from;
|
||||
int to;
|
||||
};
|
||||
|
||||
class RemoveClipsFromClipboard : public OliveAction {
|
||||
public:
|
||||
RemoveClipsFromClipboard(int index);
|
||||
virtual ~RemoveClipsFromClipboard() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
RemoveClipsFromClipboard(int index);
|
||||
virtual ~RemoveClipsFromClipboard() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
int pos;
|
||||
ClipPtr clip;
|
||||
bool done;
|
||||
int pos;
|
||||
ClipPtr clip;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class RenameClipCommand : public OliveAction {
|
||||
public:
|
||||
RenameClipCommand();
|
||||
QVector<ClipPtr> clips;
|
||||
QString new_name;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
RenameClipCommand();
|
||||
QVector<ClipPtr> clips;
|
||||
QString new_name;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QVector<QString> old_names;
|
||||
QVector<QString> old_names;
|
||||
};
|
||||
|
||||
class SetPointer : public OliveAction {
|
||||
public:
|
||||
SetPointer(void** pointer, void* data);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetPointer(void** pointer, void* data);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
bool old_changed;
|
||||
void** p;
|
||||
void* new_data;
|
||||
void* old_data;
|
||||
bool old_changed;
|
||||
void** p;
|
||||
void* new_data;
|
||||
void* old_data;
|
||||
};
|
||||
|
||||
class ReloadEffectsCommand : public OliveAction {
|
||||
public:
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
};
|
||||
|
||||
class SetQVariant : public OliveAction {
|
||||
public:
|
||||
SetQVariant(QVariant* itarget, const QVariant& iold, const QVariant& inew);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetQVariant(QVariant* itarget, const QVariant& iold, const QVariant& inew);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QVariant* target;
|
||||
QVariant old_val;
|
||||
QVariant new_val;
|
||||
QVariant* target;
|
||||
QVariant old_val;
|
||||
QVariant new_val;
|
||||
};
|
||||
|
||||
class SetKeyframing : public OliveAction {
|
||||
public:
|
||||
SetKeyframing(EffectRow* irow, bool ib);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetKeyframing(EffectRow* irow, bool ib);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectRow* row;
|
||||
bool b;
|
||||
EffectRow* row;
|
||||
bool b;
|
||||
};
|
||||
|
||||
class RefreshClips : public OliveAction {
|
||||
public:
|
||||
RefreshClips(Media* m);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
RefreshClips(Media* m);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* media;
|
||||
Media* media;
|
||||
};
|
||||
|
||||
class UpdateViewer : public OliveAction {
|
||||
public:
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
};
|
||||
|
||||
class SetEffectData : public OliveAction {
|
||||
public:
|
||||
SetEffectData(EffectPtr e, const QByteArray &s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
SetEffectData(EffectPtr e, const QByteArray &s);
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectPtr effect;
|
||||
QByteArray data;
|
||||
QByteArray old_data;
|
||||
EffectPtr effect;
|
||||
QByteArray data;
|
||||
QByteArray old_data;
|
||||
};
|
||||
|
||||
#endif // UNDO_H
|
||||
|
||||
Reference in New Issue
Block a user