Revert "derive clips, tracks, and sequences from the same base"

This reverts commit 1b9a963eeb.
This commit is contained in:
itsmattkc
2019-04-14 12:47:19 +10:00
parent 1b9a963eeb
commit de69558ee5
26 changed files with 108 additions and 284 deletions
+2 -2
View File
@@ -143,8 +143,8 @@ void RichTextEffect::redraw(double timecode)
double scroll_progress = 0;
if (auto_scroll_dir != SCROLL_OFF) {
double clip_length_secs = double(parent_clip->length()) / parent_clip->MediaFrameRate();
scroll_progress = (timecode - double(parent_clip->clip_in()) / parent_clip->MediaFrameRate()) / clip_length_secs;
double clip_length_secs = double(parent_clip->length()) / parent_clip->media_frame_rate();
scroll_progress = (timecode - double(parent_clip->clip_in()) / parent_clip->media_frame_rate()) / clip_length_secs;
}
if (auto_scroll_dir == SCROLL_OFF || auto_scroll_dir == SCROLL_LEFT || auto_scroll_dir == SCROLL_RIGHT) {
+1
View File
@@ -28,6 +28,7 @@
#include "ui/labelslider.h"
#include "ui/collapsiblewidget.h"
#include "timeline/clip.h"
#include "timeline/sequence.h"
#include "panels/timeline.h"
#include "global/debug.h"
+1
View File
@@ -28,6 +28,7 @@
#include <QComboBox>
#include "timeline/clip.h"
#include "timeline/sequence.h"
const int SMPTE_BARS = 7;
const int SMPTE_STRIP_COUNT = 3;
+1
View File
@@ -36,6 +36,7 @@
#include "ui/labelslider.h"
#include "ui/collapsiblewidget.h"
#include "timeline/clip.h"
#include "timeline/sequence.h"
#include "ui/comboboxex.h"
#include "ui/colorbutton.h"
#include "ui/blur.h"
+1 -1
View File
@@ -118,7 +118,7 @@ void TimecodeEffect::redraw(double timecode) {
olive::config.timecode_view,
sequence->frame_rate);
} else {
double media_rate = parent_clip->MediaFrameRate();
double media_rate = parent_clip->media_frame_rate();
display_timecode = prepend_text->GetStringAt(timecode) + frame_to_timecode(qRound(timecode * media_rate),
olive::config.timecode_view,
media_rate);
+2 -2
View File
@@ -25,7 +25,7 @@
#define TONE_TYPE_SINE 0
#include "timeline/clip.h"
#include "rendering/audio.h"
#include "timeline/sequence.h"
ToneEffect::ToneEffect(Clip* c) : Node(c), sinX(INT_MIN) {
type_val = new ComboInput(this, "type", tr("Type"));
@@ -90,7 +90,7 @@ void ToneEffect::process_audio(double timecode_start,
double timecode = timecode_start+(interval*i);
float tone_sample = qSin((2*M_PI*sinX*freq_val->GetDoubleAt(timecode))
/current_audio_freq())
/parent_clip->track()->sequence()->audio_frequency)
*log_volume(amount_val->GetDoubleAt(timecode)*0.01);
for (int j=0;j<channel_count;j++) {
+8 -13
View File
@@ -50,19 +50,14 @@ Transition::Transition(Clip *c) :
length_field->SetDisplayType(LabelSlider::FrameNumber);
if (parent_clip != nullptr) {
length_field->SetFrameRate(GetParentClip()->track()->sequence() == nullptr ?
GetParentClip()->cached_frame_rate() : GetParentClip()->SequenceFrameRate());
length_field->SetFrameRate(parent_clip->track()->sequence() == nullptr ?
parent_clip->cached_frame_rate() : parent_clip->track()->sequence()->frame_rate);
}
connect(length_field, SIGNAL(Changed()), this, SLOT(UpdateMaximumLength()));
}
Clip *Transition::GetParentClip()
{
return static_cast<Clip*>(parent_clip);
}
NodePtr Transition::copy(TimelineObject *c) {
NodePtr Transition::copy(Clip *c) {
NodePtr node = Node::copy(c);
static_cast<Transition*>(node.get())->set_length(get_true_length());
@@ -91,8 +86,8 @@ int Transition::get_length() {
}
Clip* Transition::get_opened_clip() {
if (GetParentClip()->opening_transition.get() == this) {
return GetParentClip();
if (parent_clip->opening_transition.get() == this) {
return parent_clip;
} else if (secondary_clip != nullptr && secondary_clip->opening_transition.get() == this) {
return secondary_clip;
}
@@ -100,8 +95,8 @@ Clip* Transition::get_opened_clip() {
}
Clip* Transition::get_closed_clip() {
if (GetParentClip()->closing_transition.get() == this) {
return GetParentClip();
if (parent_clip->closing_transition.get() == this) {
return parent_clip;
} else if (secondary_clip != nullptr && secondary_clip->closing_transition.get() == this) {
return secondary_clip;
}
@@ -136,7 +131,7 @@ TransitionPtr Transition::CreateFromMeta(Clip* c, Clip* s) {
void Transition::UpdateMaximumLength()
{
// Get the maximum area this transition can occupy on the clip
long maximum_length = GetMaximumEmptySpaceOnClip(GetParentClip());
long maximum_length = GetMaximumEmptySpaceOnClip(parent_clip);
// If this clip is a shared transition, get the maximum area this can occupy on the other clip too
if (secondary_clip != nullptr) {
+1 -5
View File
@@ -24,8 +24,6 @@
#include "nodes/node.h"
#include "nodes/inputs.h"
class Clip;
enum TransitionType {
kTransitionNone,
kTransitionOpening,
@@ -40,9 +38,7 @@ class Transition : public Node {
public:
Transition(Clip* c);
virtual NodePtr copy(TimelineObject* c) override;
Clip* GetParentClip();
virtual NodePtr copy(Clip* c) override;
Clip* secondary_clip;