merged master
This commit is contained in:
+6
-6
@@ -113,9 +113,9 @@ void Clip::refresh() {
|
||||
Footage* m = media->to_footage();
|
||||
|
||||
if (track < 0 && m->video_tracks.size() > 0) {
|
||||
media_stream = m->video_tracks.at(0)->file_index;
|
||||
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;
|
||||
media_stream = m->audio_tracks.at(0).file_index;
|
||||
}
|
||||
}
|
||||
replaced = false;
|
||||
@@ -241,8 +241,8 @@ void Clip::recalculateMaxLength() {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
Footage* m = media->to_footage();
|
||||
FootageStream* ms = m->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != NULL && ms->infinite_length) {
|
||||
const FootageStream* ms = m->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != NULL && ms->infinite_length) {
|
||||
calculated_length = LONG_MAX;
|
||||
} else {
|
||||
calculated_length = m->get_length_in_frames(fr);
|
||||
@@ -269,7 +269,7 @@ int Clip::getWidth() {
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
FootageStream* ms = media->to_footage()->get_stream_from_file_index(track < 0, media_stream);
|
||||
const FootageStream* ms = media->to_footage()->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != NULL) return ms->video_width;
|
||||
if (sequence != NULL) return sequence->width;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ int Clip::getHeight() {
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
FootageStream* ms = media->to_footage()->get_stream_from_file_index(track < 0, media_stream);
|
||||
const FootageStream* ms = media->to_footage()->get_stream_from_file_index(track < 0, media_stream);
|
||||
if (ms != NULL) return ms->video_height;
|
||||
if (sequence != NULL) return sequence->height;
|
||||
}
|
||||
|
||||
+4
-10
@@ -24,12 +24,6 @@ void Footage::reset() {
|
||||
preview_gen->cancel();
|
||||
preview_gen->wait();
|
||||
}
|
||||
for (int i=0;i<video_tracks.size();i++) {
|
||||
delete video_tracks.at(i);
|
||||
}
|
||||
for (int i=0;i<audio_tracks.size();i++) {
|
||||
delete audio_tracks.at(i);
|
||||
}
|
||||
video_tracks.clear();
|
||||
audio_tracks.clear();
|
||||
ready = false;
|
||||
@@ -43,14 +37,14 @@ long Footage::get_length_in_frames(double frame_rate) {
|
||||
FootageStream* Footage::get_stream_from_file_index(bool video, int index) {
|
||||
if (video) {
|
||||
for (int i=0;i<video_tracks.size();i++) {
|
||||
if (video_tracks.at(i)->file_index == index) {
|
||||
return video_tracks.at(i);
|
||||
if (video_tracks.at(i).file_index == index) {
|
||||
return &video_tracks[i];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i=0;i<audio_tracks.size();i++) {
|
||||
if (audio_tracks.at(i)->file_index == index) {
|
||||
return audio_tracks.at(i);
|
||||
if (audio_tracks.at(i).file_index == index) {
|
||||
return &audio_tracks[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -29,6 +29,7 @@ struct FootageStream {
|
||||
int audio_channels;
|
||||
int audio_layout;
|
||||
int audio_frequency;
|
||||
bool enabled;
|
||||
|
||||
// preview thumbnail/waveform
|
||||
bool preview_done;
|
||||
@@ -45,8 +46,8 @@ struct Footage {
|
||||
QString url;
|
||||
QString name;
|
||||
int64_t length;
|
||||
QVector<FootageStream*> video_tracks;
|
||||
QVector<FootageStream*> audio_tracks;
|
||||
QVector<FootageStream> video_tracks;
|
||||
QVector<FootageStream> audio_tracks;
|
||||
int save_id;
|
||||
bool ready;
|
||||
bool invalid;
|
||||
@@ -59,7 +60,7 @@ struct Footage {
|
||||
long out;
|
||||
|
||||
long get_length_in_frames(double frame_rate);
|
||||
FootageStream* get_stream_from_file_index(bool video, int index);
|
||||
FootageStream *get_stream_from_file_index(bool video, int index);
|
||||
void reset();
|
||||
};
|
||||
|
||||
|
||||
+17
-16
@@ -104,21 +104,21 @@ void Media::update_tooltip(const QString& error) {
|
||||
if (i > 0) {
|
||||
tooltip += ", ";
|
||||
}
|
||||
tooltip += QString::number(f->video_tracks.at(i)->video_width) + "x" + QString::number(f->video_tracks.at(i)->video_height);
|
||||
tooltip += QString::number(f->video_tracks.at(i).video_width) + "x" + QString::number(f->video_tracks.at(i).video_height);
|
||||
}
|
||||
tooltip += "\n";
|
||||
|
||||
if (!f->video_tracks.at(0)->infinite_length) {
|
||||
if (!f->video_tracks.at(0).infinite_length) {
|
||||
tooltip += "Frame Rate: ";
|
||||
for (int i=0;i<f->video_tracks.size();i++) {
|
||||
if (i > 0) {
|
||||
tooltip += ", ";
|
||||
}
|
||||
if (f->video_tracks.at(i)->video_interlacing == VIDEO_PROGRESSIVE) {
|
||||
tooltip += QString::number(f->video_tracks.at(i)->video_frame_rate);
|
||||
if (f->video_tracks.at(i).video_interlacing == VIDEO_PROGRESSIVE) {
|
||||
tooltip += QString::number(f->video_tracks.at(i).video_frame_rate);
|
||||
} else {
|
||||
tooltip += QString::number(f->video_tracks.at(i)->video_frame_rate * 2);
|
||||
tooltip += " fields (" + QString::number(f->video_tracks.at(i)->video_frame_rate) + " frames)";
|
||||
tooltip += QString::number(f->video_tracks.at(i).video_frame_rate * 2);
|
||||
tooltip += " fields (" + QString::number(f->video_tracks.at(i).video_frame_rate) + " frames)";
|
||||
}
|
||||
}
|
||||
tooltip += "\n";
|
||||
@@ -129,7 +129,7 @@ void Media::update_tooltip(const QString& error) {
|
||||
if (i > 0) {
|
||||
tooltip += ", ";
|
||||
}
|
||||
tooltip += get_interlacing_name(f->video_tracks.at(i)->video_interlacing);
|
||||
tooltip += get_interlacing_name(f->video_tracks.at(i).video_interlacing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ void Media::update_tooltip(const QString& error) {
|
||||
if (i > 0) {
|
||||
tooltip += ", ";
|
||||
}
|
||||
tooltip += QString::number(f->audio_tracks.at(i)->audio_frequency);
|
||||
tooltip += QString::number(f->audio_tracks.at(i).audio_frequency);
|
||||
}
|
||||
tooltip += "\n";
|
||||
|
||||
@@ -150,7 +150,7 @@ void Media::update_tooltip(const QString& error) {
|
||||
if (i > 0) {
|
||||
tooltip += ", ";
|
||||
}
|
||||
tooltip += get_channel_layout_name(f->audio_tracks.at(i)->audio_channels, f->audio_tracks.at(i)->audio_layout);
|
||||
tooltip += get_channel_layout_name(f->audio_tracks.at(i).audio_channels, f->audio_tracks.at(i).audio_layout);
|
||||
}
|
||||
// tooltip += "\n";
|
||||
}
|
||||
@@ -202,8 +202,8 @@ double Media::get_frame_rate(int stream) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
Footage* f = to_footage();
|
||||
if (stream < 0) return f->video_tracks.at(0)->video_frame_rate;
|
||||
return f->get_stream_from_file_index(true, stream)->video_frame_rate;
|
||||
if (stream < 0) return f->video_tracks.at(0).video_frame_rate;
|
||||
return f->get_stream_from_file_index(true, stream)->video_frame_rate;
|
||||
}
|
||||
case MEDIA_TYPE_SEQUENCE: return to_sequence()->frame_rate;
|
||||
}
|
||||
@@ -215,8 +215,8 @@ int Media::get_sampling_rate(int stream) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
Footage* f = to_footage();
|
||||
if (stream < 0) return f->audio_tracks.at(0)->audio_frequency;
|
||||
return to_footage()->get_stream_from_file_index(false, stream)->audio_frequency;
|
||||
if (stream < 0) return f->audio_tracks.at(0).audio_frequency;
|
||||
return to_footage()->get_stream_from_file_index(false, stream)->audio_frequency;
|
||||
}
|
||||
case MEDIA_TYPE_SEQUENCE: return to_sequence()->audio_frequency;
|
||||
}
|
||||
@@ -258,8 +258,8 @@ QVariant Media::data(int column, int role) {
|
||||
if (get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
Footage* f = to_footage();
|
||||
if (f->video_tracks.size() > 0
|
||||
&& f->video_tracks.at(0)->preview_done) {
|
||||
return f->video_tracks.at(0)->video_preview_square;
|
||||
&& f->video_tracks.at(0).preview_done) {
|
||||
return f->video_tracks.at(0).video_preview_square;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,8 @@ QVariant Media::data(int column, int role) {
|
||||
Footage* f = to_footage();
|
||||
double r = 30;
|
||||
|
||||
if (f->video_tracks.size() > 0 && !qIsNull(f->video_tracks.at(0)->video_frame_rate)) r = f->video_tracks.at(0)->video_frame_rate;
|
||||
if (f->video_tracks.size() > 0 && !qIsNull(f->video_tracks.at(0).video_frame_rate))
|
||||
r = f->video_tracks.at(0).video_frame_rate;
|
||||
|
||||
long len = f->get_length_in_frames(r);
|
||||
if (len > 0) return frame_to_timecode(len, config.timecode_view, r);
|
||||
|
||||
+1
-6
@@ -1055,12 +1055,7 @@ void EditSequenceCommand::update() {
|
||||
item->set_sequence(seq);
|
||||
|
||||
for (int i=0;i<seq->clips.size();i++) {
|
||||
// TODO shift in/out/clipin points to match new frame rate
|
||||
// BUT ALSO copy/paste must need a similar routine, no?
|
||||
// See if one exists or if you have to make one, make it
|
||||
// re-usable
|
||||
|
||||
seq->clips.at(i)->refresh();
|
||||
if (seq->clips.at(i) != NULL) seq->clips.at(i)->refresh();
|
||||
}
|
||||
|
||||
if (sequence == seq) {
|
||||
|
||||
Reference in New Issue
Block a user