added #391
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
struct Clip;
|
||||
class Clip;
|
||||
class LabelSlider;
|
||||
class QCheckBox;
|
||||
|
||||
|
||||
+1
-1
@@ -447,7 +447,7 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
m.name = attr.value().toString();
|
||||
}
|
||||
}
|
||||
c->markers.append(m);
|
||||
c->get_markers().append(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
class Media;
|
||||
struct Footage;
|
||||
struct Clip;
|
||||
class Clip;
|
||||
struct Sequence;
|
||||
class LoadDialog;
|
||||
struct TransitionData;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QUndoCommand>
|
||||
#include <QMutex>
|
||||
|
||||
struct Clip;
|
||||
class Clip;
|
||||
class QMenu;
|
||||
class Effect;
|
||||
class TimelineHeader;
|
||||
|
||||
+2
-2
@@ -1062,8 +1062,8 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
}
|
||||
|
||||
// save markers
|
||||
for (int k=0;k<c->markers.size();k++) {
|
||||
save_marker(stream, c->markers.at(k));
|
||||
for (int k=0;k<c->get_markers().size();k++) {
|
||||
save_marker(stream, c->get_markers().at(k));
|
||||
}
|
||||
|
||||
stream.writeStartElement("linked"); // linked
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
struct Footage;
|
||||
struct Sequence;
|
||||
struct Clip;
|
||||
class Clip;
|
||||
class Timeline;
|
||||
class Viewer;
|
||||
class SourceTable;
|
||||
|
||||
+18
-6
@@ -1428,8 +1428,8 @@ bool Timeline::snap_to_timeline(long* l, bool use_playhead, bool use_markers, bo
|
||||
return true;
|
||||
} else {
|
||||
// try to snap to clip markers
|
||||
for (int j=0;j<c->markers.size();j++) {
|
||||
if (snap_to_point(c->markers.at(j).frame + c->timeline_in - c->clip_in, l)) {
|
||||
for (int j=0;j<c->get_markers().size();j++) {
|
||||
if (snap_to_point(c->get_markers().at(j).frame + c->timeline_in - c->clip_in, l)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1452,14 +1452,26 @@ void Timeline::set_marker() {
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
if (c != nullptr
|
||||
&& is_clip_selected(c, true)
|
||||
&& sequence->playhead >= c->timeline_in
|
||||
&& sequence->playhead <= c->timeline_out) {
|
||||
clips_selected.append(c);
|
||||
&& is_clip_selected(c, true)) {
|
||||
|
||||
// only add markers if the playhead is inside the clip
|
||||
if (sequence->playhead >= c->timeline_in
|
||||
&& sequence->playhead <= c->timeline_out) {
|
||||
clips_selected.append(c);
|
||||
}
|
||||
|
||||
// we are definitely adding markers to clips though
|
||||
clip_mode = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// if we've selected clips but none of the clips are within the playhead,
|
||||
// nothing to do here
|
||||
if (clip_mode && clips_selected.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString marker_name;
|
||||
|
||||
// if (config.set_name_with_marker) is false (set above), ask for a marker name
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ class AudioMonitor;
|
||||
class QScrollBar;
|
||||
struct EffectMeta;
|
||||
struct Sequence;
|
||||
struct Clip;
|
||||
class Clip;
|
||||
struct Footage;
|
||||
struct FootageStream;
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#include <QThread>
|
||||
#include <QVector>
|
||||
|
||||
struct Clip;
|
||||
class Clip;
|
||||
|
||||
class Cacher : public QThread
|
||||
{
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#include <QVector>
|
||||
#include <QMutex>
|
||||
|
||||
struct Clip;
|
||||
class Clip;
|
||||
struct ClipCache;
|
||||
struct Sequence;
|
||||
struct AVFrame;
|
||||
|
||||
+8
-1
@@ -147,7 +147,14 @@ void Clip::queue_remove_earliest() {
|
||||
}
|
||||
}
|
||||
av_frame_free(&queue[earliest_frame]);
|
||||
queue.removeAt(earliest_frame);
|
||||
queue.removeAt(earliest_frame);
|
||||
}
|
||||
|
||||
QVector<Marker> &Clip::get_markers() {
|
||||
if (media != nullptr && media->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
return media->to_sequence()->markers;
|
||||
}
|
||||
return markers;
|
||||
}
|
||||
|
||||
Transition* Clip::get_opening_transition() {
|
||||
|
||||
+5
-3
@@ -33,8 +33,8 @@ struct AVFilterContext;
|
||||
struct AVDictionary;
|
||||
class QOpenGLTexture;
|
||||
|
||||
struct Clip
|
||||
{
|
||||
class Clip {
|
||||
public:
|
||||
Clip(Sequence* s);
|
||||
~Clip();
|
||||
Clip* copy(Sequence* s, bool duplicate_transitions = true);
|
||||
@@ -76,7 +76,7 @@ struct Clip
|
||||
bool autoscale;
|
||||
|
||||
// markers
|
||||
QVector<Marker> markers;
|
||||
QVector<Marker>& get_markers();
|
||||
|
||||
// other variables (should be deep copied/duplicated in copy())
|
||||
QList<Effect*> effects;
|
||||
@@ -136,6 +136,8 @@ struct Clip
|
||||
bool audio_reset;
|
||||
bool audio_just_reset;
|
||||
long audio_target_frame;
|
||||
private:
|
||||
QVector<Marker> markers;
|
||||
};
|
||||
|
||||
#endif // CLIP_H
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ class QGridLayout;
|
||||
class QPushButton;
|
||||
class QMouseEvent;
|
||||
|
||||
struct Clip;
|
||||
class Clip;
|
||||
class QXmlStreamReader;
|
||||
class QXmlStreamWriter;
|
||||
class Effect;
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ enum VideoInterlacingMode {
|
||||
};
|
||||
|
||||
struct Sequence;
|
||||
struct Clip;
|
||||
class Clip;
|
||||
class PreviewGenerator;
|
||||
class MediaThrobber;
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
#include "project/marker.h"
|
||||
#include "project/selection.h"
|
||||
|
||||
struct Clip;
|
||||
class Clip;
|
||||
class Transition;
|
||||
class Media;
|
||||
|
||||
|
||||
+2
-2
@@ -814,7 +814,7 @@ AddMarkerAction::AddMarkerAction(bool is_sequence, void* s, long t, QString n) :
|
||||
void AddMarkerAction::undo() {
|
||||
QVector<Marker>& markers = is_sequence_internal ?
|
||||
static_cast<Sequence*>(target)->markers :
|
||||
static_cast<Clip*>(target)->markers;
|
||||
static_cast<Clip*>(target)->get_markers();
|
||||
|
||||
if (index == -1) {
|
||||
markers.removeLast();
|
||||
@@ -830,7 +830,7 @@ void AddMarkerAction::redo() {
|
||||
|
||||
QVector<Marker>& markers = is_sequence_internal ?
|
||||
static_cast<Sequence*>(target)->markers :
|
||||
static_cast<Clip*>(target)->markers;
|
||||
static_cast<Clip*>(target)->get_markers();
|
||||
|
||||
for (int i=0;i<markers.size();i++) {
|
||||
if (markers.at(i).frame == time) {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class EffectRow;
|
||||
class EffectField;
|
||||
class Transition;
|
||||
class EffectGizmo;
|
||||
struct Clip;
|
||||
class Clip;
|
||||
struct Sequence;
|
||||
struct Footage;
|
||||
struct EffectMeta;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
|
||||
struct Clip;
|
||||
class Clip;
|
||||
class Effect;
|
||||
class EffectRow;
|
||||
class EffectField;
|
||||
|
||||
@@ -8,7 +8,7 @@ class Effect;
|
||||
class Viewer;
|
||||
class QOpenGLShaderProgram;
|
||||
struct Sequence;
|
||||
struct Clip;
|
||||
class Clip;
|
||||
|
||||
struct ComposeSequenceParams {
|
||||
Viewer* viewer;
|
||||
|
||||
@@ -1267,8 +1267,8 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
|
||||
// if the ghost is attached to a clip, snap its markers too
|
||||
if (panel_timeline->trim_target == -1 && g.clip >= 0) {
|
||||
Clip* c = sequence->clips.at(g.clip);
|
||||
for (int j=0;j<c->markers.size();j++) {
|
||||
long marker_real_time = c->markers.at(j).frame + c->timeline_in - c->clip_in;
|
||||
for (int j=0;j<c->get_markers().size();j++) {
|
||||
long marker_real_time = c->get_markers().at(j).frame + c->timeline_in - c->clip_in;
|
||||
fm = marker_real_time + frame_diff;
|
||||
if (panel_timeline->snap_to_timeline(&fm, true, true, true)) {
|
||||
frame_diff = fm - marker_real_time;
|
||||
@@ -2430,8 +2430,8 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
}
|
||||
|
||||
// draw clip markers
|
||||
for (int j=0;j<clip->markers.size();j++) {
|
||||
const Marker& m = clip->markers.at(j);
|
||||
for (int j=0;j<clip->get_markers().size();j++) {
|
||||
const Marker& m = clip->get_markers().at(j);
|
||||
|
||||
// convert marker time (in clip time) to sequence time
|
||||
long marker_time = m.frame + clip->timeline_in - clip->clip_in;
|
||||
@@ -2440,6 +2440,7 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
draw_marker(p, marker_x, clip_rect.bottom()-p.fontMetrics().height(), clip_rect.bottom(), false, false);
|
||||
}
|
||||
}
|
||||
p.setBrush(Qt::NoBrush);
|
||||
|
||||
// draw clip transitions
|
||||
draw_transition(p, clip, clip_rect, text_rect, TA_OPENING_TRANSITION);
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
#define TRACK_HEIGHT_INCREMENT 10
|
||||
|
||||
struct Sequence;
|
||||
struct Clip;
|
||||
class Clip;
|
||||
struct FootageStream;
|
||||
class Timeline;
|
||||
class TimelineAction;
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
#include <QOpenGLFunctions>
|
||||
|
||||
class Viewer;
|
||||
struct Clip;
|
||||
class Clip;
|
||||
struct FootageStream;
|
||||
class QOpenGLFramebufferObject;
|
||||
class Effect;
|
||||
|
||||
Reference in New Issue
Block a user