attached clip markers to footage markers
This commit is contained in:
+2
-2
@@ -151,8 +151,8 @@ void Clip::queue_remove_earliest() {
|
||||
}
|
||||
|
||||
QVector<Marker> &Clip::get_markers() {
|
||||
if (media != nullptr && media->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
return media->to_sequence()->markers;
|
||||
if (media != nullptr) {
|
||||
return media->get_markers();
|
||||
}
|
||||
return markers;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <QPixmap>
|
||||
#include <QIcon>
|
||||
|
||||
#include "project/marker.h"
|
||||
|
||||
enum VideoInterlacingMode {
|
||||
VIDEO_PROGRESSIVE,
|
||||
VIDEO_TOP_FIELD_FIRST,
|
||||
@@ -45,6 +47,7 @@ struct Footage {
|
||||
Footage();
|
||||
~Footage();
|
||||
|
||||
// footage metadata
|
||||
QString url;
|
||||
QString name;
|
||||
int64_t length;
|
||||
@@ -60,13 +63,19 @@ struct Footage {
|
||||
bool proxy;
|
||||
QString proxy_path;
|
||||
|
||||
// thumbnail/waveform generation
|
||||
PreviewGenerator* preview_gen;
|
||||
QMutex ready_lock;
|
||||
|
||||
// in/out points
|
||||
bool using_inout;
|
||||
long in;
|
||||
long out;
|
||||
|
||||
// markers
|
||||
QVector<Marker> markers;
|
||||
|
||||
// functions
|
||||
long get_length_in_frames(double frame_rate);
|
||||
FootageStream *get_stream_from_file_index(bool video, int index);
|
||||
void reset();
|
||||
|
||||
+14
-1
@@ -329,5 +329,18 @@ Media *Media::parentItem() {
|
||||
}
|
||||
|
||||
void Media::removeChild(int i) {
|
||||
children.removeAt(i);
|
||||
children.removeAt(i);
|
||||
}
|
||||
|
||||
QVector<Marker> &Media::get_markers() {
|
||||
// returns the marker array from the internal object
|
||||
//
|
||||
// NOTE: if this media object is not footage or a sequence, the result is
|
||||
// undefined - most likely a crash
|
||||
|
||||
if (get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
return to_footage()->markers;
|
||||
} else {
|
||||
return to_sequence()->markers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
|
||||
#include "project/marker.h"
|
||||
|
||||
#define MEDIA_TYPE_FOOTAGE 0
|
||||
#define MEDIA_TYPE_SEQUENCE 1
|
||||
#define MEDIA_TYPE_FOLDER 2
|
||||
@@ -46,6 +48,9 @@ public:
|
||||
Media *parentItem();
|
||||
void removeChild(int i);
|
||||
|
||||
// get markers from internal object
|
||||
QVector<Marker>& get_markers();
|
||||
|
||||
bool root;
|
||||
int temp_id;
|
||||
int temp_id2;
|
||||
|
||||
@@ -41,10 +41,11 @@ bool ProjectFilter::filterAcceptsRow(int source_row, const QModelIndex &source_p
|
||||
// search markers if media is a sequene
|
||||
bool marker_contains_search = false;
|
||||
|
||||
if (media->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
Sequence* s = media->to_sequence();
|
||||
for (int i=0;i<s->markers.size();i++) {
|
||||
if (s->markers.at(i).name.contains(search_filter, Qt::CaseInsensitive)) {
|
||||
if (media->get_type() == MEDIA_TYPE_SEQUENCE
|
||||
|| media->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
QVector<Marker>& markers = media->get_markers();
|
||||
for (int i=0;i<markers.size();i++) {
|
||||
if (markers.at(i).name.contains(search_filter, Qt::CaseInsensitive)) {
|
||||
marker_contains_search = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user