removed disable in/out, fixes #426
This commit is contained in:
+12
-13
@@ -970,7 +970,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
stream.writeAttribute("proxy", QString::number(f->proxy));
|
||||
stream.writeAttribute("proxypath", f->proxy_path);
|
||||
|
||||
// save video stream metadata
|
||||
// save video stream metadata
|
||||
for (int j=0;j<f->video_tracks.size();j++) {
|
||||
const FootageStream& ms = f->video_tracks.at(j);
|
||||
stream.writeStartElement("video");
|
||||
@@ -979,10 +979,10 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
stream.writeAttribute("height", QString::number(ms.video_height));
|
||||
stream.writeAttribute("framerate", QString::number(ms.video_frame_rate, 'f', 10));
|
||||
stream.writeAttribute("infinite", QString::number(ms.infinite_length));
|
||||
stream.writeEndElement(); // video
|
||||
stream.writeEndElement(); // video
|
||||
}
|
||||
|
||||
// save audio stream metadata
|
||||
// save audio stream metadata
|
||||
for (int j=0;j<f->audio_tracks.size();j++) {
|
||||
const FootageStream& ms = f->audio_tracks.at(j);
|
||||
stream.writeStartElement("audio");
|
||||
@@ -990,15 +990,15 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
stream.writeAttribute("channels", QString::number(ms.audio_channels));
|
||||
stream.writeAttribute("layout", QString::number(ms.audio_layout));
|
||||
stream.writeAttribute("frequency", QString::number(ms.audio_frequency));
|
||||
stream.writeEndElement(); // audio
|
||||
stream.writeEndElement(); // audio
|
||||
}
|
||||
|
||||
// save footage markers
|
||||
for (int j=0;j<f->markers.size();j++) {
|
||||
save_marker(stream, f->markers.at(j));
|
||||
}
|
||||
// save footage markers
|
||||
for (int j=0;j<f->markers.size();j++) {
|
||||
save_marker(stream, f->markers.at(j));
|
||||
}
|
||||
|
||||
stream.writeEndElement(); // footage
|
||||
stream.writeEndElement(); // footage
|
||||
media_id++;
|
||||
} else if (type == MEDIA_TYPE_SEQUENCE) {
|
||||
Sequence* s = m->to_sequence();
|
||||
@@ -1019,7 +1019,6 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
stream.writeAttribute("open", "1");
|
||||
}
|
||||
stream.writeAttribute("workarea", QString::number(s->using_workarea));
|
||||
stream.writeAttribute("workareaEnabled", QString::number(s->enable_workarea));
|
||||
stream.writeAttribute("workareaIn", QString::number(s->workarea_in));
|
||||
stream.writeAttribute("workareaOut", QString::number(s->workarea_out));
|
||||
|
||||
@@ -1071,8 +1070,8 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
}
|
||||
|
||||
// save markers
|
||||
// only necessary for null media clips, since media has its own markers
|
||||
if (c->media == nullptr) {
|
||||
// only necessary for null media clips, since media has its own markers
|
||||
if (c->media == nullptr) {
|
||||
for (int k=0;k<c->get_markers().size();k++) {
|
||||
save_marker(stream, c->get_markers().at(k));
|
||||
}
|
||||
@@ -1096,7 +1095,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
stream.writeEndElement(); // clip
|
||||
}
|
||||
}
|
||||
for (int j=0;j<s->markers.size();j++) {
|
||||
for (int j=0;j<s->markers.size();j++) {
|
||||
save_marker(stream, s->markers.at(j));
|
||||
}
|
||||
stream.writeEndElement();
|
||||
|
||||
+26
-26
@@ -143,15 +143,15 @@ void ripple_clips(ComboAction* ca, Sequence *s, long point, long length, const Q
|
||||
}
|
||||
|
||||
void Timeline::toggle_show_all() {
|
||||
if (sequence != nullptr) {
|
||||
showing_all = !showing_all;
|
||||
if (showing_all) {
|
||||
old_zoom = zoom;
|
||||
set_zoom_value(double(timeline_area->width() - 200) / double(sequence->getEndFrame()));
|
||||
} else {
|
||||
set_zoom_value(old_zoom);
|
||||
}
|
||||
}
|
||||
if (sequence != nullptr) {
|
||||
showing_all = !showing_all;
|
||||
if (showing_all) {
|
||||
old_zoom = zoom;
|
||||
set_zoom_value(double(timeline_area->width() - 200) / double(sequence->getEndFrame()));
|
||||
} else {
|
||||
set_zoom_value(old_zoom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::create_ghosts_from_media(Sequence* seq, long entry_point, QVector<Media*>& media_list) {
|
||||
@@ -235,7 +235,7 @@ void Timeline::create_ghosts_from_media(Sequence* seq, long entry_point, QVector
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
g.out = entry_point + sequence_length - default_clip_in;
|
||||
|
||||
if (s->using_workarea && s->enable_workarea) {
|
||||
if (s->using_workarea) {
|
||||
g.out -= (sequence_length - default_clip_out);
|
||||
}
|
||||
|
||||
@@ -1430,8 +1430,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->get_markers().size();j++) {
|
||||
if (snap_to_point(c->get_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;
|
||||
}
|
||||
}
|
||||
@@ -1444,7 +1444,7 @@ bool Timeline::snap_to_timeline(long* l, bool use_playhead, bool use_markers, bo
|
||||
|
||||
void Timeline::set_marker() {
|
||||
// determine if any clips are selected, and if so add markers to clips rather than the sequence
|
||||
QVector<int> clips_selected;
|
||||
QVector<int> clips_selected;
|
||||
bool clip_mode = false;
|
||||
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
@@ -1452,26 +1452,26 @@ void Timeline::set_marker() {
|
||||
if (c != nullptr
|
||||
&& 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(i);
|
||||
}
|
||||
// only add markers if the playhead is inside the clip
|
||||
if (sequence->playhead >= c->timeline_in
|
||||
&& sequence->playhead <= c->timeline_out) {
|
||||
clips_selected.append(i);
|
||||
}
|
||||
|
||||
// we are definitely adding markers to clips though
|
||||
// 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;
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
|
||||
// pass off to internal set marker function
|
||||
set_marker_internal(sequence, clips_selected);
|
||||
// pass off to internal set marker function
|
||||
set_marker_internal(sequence, clips_selected);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+14
-21
@@ -282,7 +282,7 @@ void Viewer::close_media() {
|
||||
|
||||
void Viewer::go_to_in() {
|
||||
if (seq != nullptr) {
|
||||
if (seq->using_workarea && seq->enable_workarea) {
|
||||
if (seq->using_workarea) {
|
||||
seek(seq->workarea_in);
|
||||
} else {
|
||||
go_to_start();
|
||||
@@ -300,7 +300,7 @@ void Viewer::next_frame() {
|
||||
|
||||
void Viewer::go_to_out() {
|
||||
if (seq != nullptr) {
|
||||
if (seq->using_workarea && seq->enable_workarea) {
|
||||
if (seq->using_workarea) {
|
||||
seek(seq->workarea_out);
|
||||
} else {
|
||||
go_to_end();
|
||||
@@ -363,7 +363,7 @@ void Viewer::play(bool in_to_out) {
|
||||
uncue_recording();
|
||||
}
|
||||
|
||||
bool seek_to_in = (seq->using_workarea && config.loop);
|
||||
bool seek_to_in = (seq->using_workarea && (config.loop || playing_in_to_out));
|
||||
if (!is_recording_cued()
|
||||
&& (playing_in_to_out
|
||||
|| seq->playhead >= seq->getEndFrame()
|
||||
@@ -471,16 +471,16 @@ void Viewer::update_parents(bool reload_fx) {
|
||||
update_ui(reload_fx);
|
||||
} else {
|
||||
update_viewer();
|
||||
panel_timeline->repaint_timeline();
|
||||
panel_timeline->repaint_timeline();
|
||||
}
|
||||
}
|
||||
|
||||
int Viewer::get_playback_speed() {
|
||||
return playback_speed;
|
||||
return playback_speed;
|
||||
}
|
||||
|
||||
void Viewer::set_marker() {
|
||||
set_marker_internal(seq);
|
||||
set_marker_internal(seq);
|
||||
}
|
||||
|
||||
void Viewer::resizeEvent(QResizeEvent *) {
|
||||
@@ -518,13 +518,6 @@ void Viewer::clear_inout_point() {
|
||||
}
|
||||
}
|
||||
|
||||
void Viewer::toggle_enable_inout() {
|
||||
if (seq != nullptr && seq->using_workarea) {
|
||||
undo_stack.push(new SetBool(&seq->enable_workarea, !seq->enable_workarea));
|
||||
update_parents();
|
||||
}
|
||||
}
|
||||
|
||||
void Viewer::set_in_point() {
|
||||
headers->set_in_point(seq->playhead);
|
||||
}
|
||||
@@ -580,13 +573,13 @@ void Viewer::set_playback_speed(int s) {
|
||||
}
|
||||
|
||||
long Viewer::get_seq_in() {
|
||||
return ((config.loop || playing_in_to_out) && seq->using_workarea && seq->enable_workarea)
|
||||
return ((config.loop || playing_in_to_out) && seq->using_workarea)
|
||||
? seq->workarea_in
|
||||
: 0;
|
||||
}
|
||||
|
||||
long Viewer::get_seq_out() {
|
||||
return ((config.loop || playing_in_to_out) && seq->using_workarea && seq->enable_workarea && previous_playhead < seq->workarea_out)
|
||||
return ((config.loop || playing_in_to_out) && seq->using_workarea && previous_playhead < seq->workarea_out)
|
||||
? seq->workarea_out
|
||||
: seq->getEndFrame();
|
||||
}
|
||||
@@ -690,16 +683,16 @@ void Viewer::setup_ui() {
|
||||
|
||||
void Viewer::set_media(Media* m) {
|
||||
main_sequence = false;
|
||||
media = m;
|
||||
media = m;
|
||||
|
||||
clean_created_seq();
|
||||
clean_created_seq();
|
||||
if (media != nullptr) {
|
||||
switch (media->get_type()) {
|
||||
case MEDIA_TYPE_FOOTAGE:
|
||||
{
|
||||
Footage* footage = media->to_footage();
|
||||
|
||||
marker_ref = &footage->markers;
|
||||
marker_ref = &footage->markers;
|
||||
|
||||
seq = new Sequence();
|
||||
created_sequence = true;
|
||||
@@ -865,9 +858,9 @@ void Viewer::set_sequence(bool main, Sequence *s) {
|
||||
|
||||
viewer_container->adjust();
|
||||
|
||||
if (!created_sequence) {
|
||||
marker_ref = &seq->markers;
|
||||
}
|
||||
if (!created_sequence) {
|
||||
marker_ref = &seq->markers;
|
||||
}
|
||||
} else {
|
||||
update_playhead_timecode(0);
|
||||
update_end_timecode();
|
||||
|
||||
+4
-5
@@ -42,7 +42,6 @@ public:
|
||||
void clear_in();
|
||||
void clear_out();
|
||||
void clear_inout_point();
|
||||
void toggle_enable_inout();
|
||||
void set_in_point();
|
||||
void set_out_point();
|
||||
void set_zoom(bool in);
|
||||
@@ -73,12 +72,12 @@ public:
|
||||
ViewerWidget* viewer_widget;
|
||||
|
||||
Media* media;
|
||||
Sequence* seq;
|
||||
QVector<Marker>* marker_ref;
|
||||
Sequence* seq;
|
||||
QVector<Marker>* marker_ref;
|
||||
|
||||
void set_marker();
|
||||
void set_marker();
|
||||
|
||||
TimelineHeader* headers;
|
||||
TimelineHeader* headers;
|
||||
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user