reimplemented double and bool widgets separately
This commit is contained in:
@@ -258,12 +258,15 @@ void EffectControls::Clear(bool clear_cache) {
|
||||
deselect_all_effects(nullptr);
|
||||
|
||||
// clear graph editor
|
||||
if (panel_graph_editor != nullptr) panel_graph_editor->set_row(nullptr);
|
||||
if (panel_graph_editor != nullptr) {
|
||||
panel_graph_editor->set_row(nullptr);
|
||||
}
|
||||
|
||||
for (int i=0;i<open_effects_.size();i++) {
|
||||
delete open_effects_.at(i);
|
||||
}
|
||||
open_effects_.clear();
|
||||
keyframeView->SetEffects(open_effects_);
|
||||
|
||||
vcontainer->setVisible(false);
|
||||
acontainer->setVisible(false);
|
||||
@@ -295,14 +298,16 @@ void EffectControls::deselect_all_effects(QWidget* sender) {
|
||||
}
|
||||
}
|
||||
|
||||
panel_sequence_viewer->viewer_widget->update();
|
||||
if (panel_sequence_viewer != nullptr) {
|
||||
panel_sequence_viewer->viewer_widget->update();
|
||||
}
|
||||
}
|
||||
|
||||
void EffectControls::open_effect(QVBoxLayout* layout, Effect* e) {
|
||||
EffectUI* container = new EffectUI(e);
|
||||
|
||||
connect(container, SIGNAL(CutRequested()), this, SLOT(cut()));
|
||||
connect(container, SIGNAL(CopyRequested()), this, SLOT(copy(bool)));
|
||||
connect(container, SIGNAL(CopyRequested()), this, SLOT(copy()));
|
||||
connect(container, SIGNAL(deselect_others(QWidget*)), this, SLOT(deselect_all_effects(QWidget*)));
|
||||
|
||||
open_effects_.append(container);
|
||||
@@ -596,8 +601,12 @@ void EffectControls::Load() {
|
||||
open_effect(layout, c->closing_transition.get());
|
||||
}
|
||||
}
|
||||
|
||||
keyframeView->SetEffects(open_effects_);
|
||||
|
||||
if (selected_clips_.size() > 0) {
|
||||
keyframeView->setEnabled(true);
|
||||
|
||||
headers->setVisible(true);
|
||||
|
||||
QTimer::singleShot(50, this, SLOT(queue_post_update()));
|
||||
|
||||
+11
-9
@@ -292,7 +292,9 @@ SequencePtr create_sequence_from_media(QVector<Media*>& media_list) {
|
||||
break;
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
{
|
||||
Sequence* seq = media->to_sequence();
|
||||
// Clone all attributes of the original sequence (seq) into the new one (s)
|
||||
Sequence* seq = media->to_sequence().get();
|
||||
|
||||
s->width = seq->width;
|
||||
s->height = seq->height;
|
||||
s->frame_rate = seq->frame_rate;
|
||||
@@ -442,13 +444,13 @@ Media* Project::create_sequence_internal(ComboAction *ca, SequencePtr s, bool op
|
||||
ca->append(new NewSequenceCommand(item, parent));
|
||||
|
||||
if (open) {
|
||||
ca->append(new ChangeSequenceAction(s.get()));
|
||||
ca->append(new ChangeSequenceAction(s));
|
||||
}
|
||||
} else {
|
||||
olive::project_model.appendChild(parent, item);
|
||||
|
||||
if (open) {
|
||||
olive::Global->set_sequence(s.get());
|
||||
olive::Global->set_sequence(s);
|
||||
}
|
||||
}
|
||||
return item;
|
||||
@@ -535,7 +537,7 @@ void Project::delete_selected_media() {
|
||||
Footage* media = item->to_footage();
|
||||
bool confirm_delete = false;
|
||||
for (int j=0;j<sequence_items.size();j++) {
|
||||
Sequence* s = sequence_items.at(j)->to_sequence();
|
||||
Sequence* s = sequence_items.at(j)->to_sequence().get();
|
||||
for (int k=0;k<s->clips.size();k++) {
|
||||
ClipPtr c = s->clips.at(k);
|
||||
if (c != nullptr && c->media() == item) {
|
||||
@@ -621,9 +623,9 @@ void Project::delete_selected_media() {
|
||||
if (items.at(i)->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
redraw = true;
|
||||
|
||||
Sequence* s = items.at(i)->to_sequence();
|
||||
Sequence* s = items.at(i)->to_sequence().get();
|
||||
|
||||
if (s == olive::ActiveSequence) {
|
||||
if (s == olive::ActiveSequence.get()) {
|
||||
ca->append(new ChangeSequenceAction(nullptr));
|
||||
}
|
||||
|
||||
@@ -990,7 +992,7 @@ void Project::delete_clips_using_selected_media() {
|
||||
for (int j=0;j<items.size();j++) {
|
||||
Media* m = item_to_media(items.at(j));
|
||||
if (c->media() == m) {
|
||||
ca->append(new DeleteClipAction(olive::ActiveSequence, i));
|
||||
ca->append(new DeleteClipAction(olive::ActiveSequence.get(), i));
|
||||
deleted = true;
|
||||
}
|
||||
}
|
||||
@@ -1129,7 +1131,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
stream.writeEndElement(); // footage
|
||||
media_id++;
|
||||
} else if (type == MEDIA_TYPE_SEQUENCE) {
|
||||
Sequence* s = m->to_sequence();
|
||||
Sequence* s = m->to_sequence().get();
|
||||
if (set_ids_only) {
|
||||
s->save_id = sequence_id;
|
||||
sequence_id++;
|
||||
@@ -1143,7 +1145,7 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
stream.writeAttribute("framerate", QString::number(s->frame_rate, 'f', 10));
|
||||
stream.writeAttribute("afreq", QString::number(s->audio_frequency));
|
||||
stream.writeAttribute("alayout", QString::number(s->audio_layout));
|
||||
if (s == olive::ActiveSequence) {
|
||||
if (s == olive::ActiveSequence.get()) {
|
||||
stream.writeAttribute("open", "1");
|
||||
}
|
||||
stream.writeAttribute("workarea", QString::number(s->using_workarea));
|
||||
|
||||
+25
-23
@@ -219,7 +219,7 @@ void Timeline::create_ghosts_from_media(Sequence* seq, long entry_point, QVector
|
||||
}
|
||||
break;
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
s = medium->to_sequence();
|
||||
s = medium->to_sequence().get();
|
||||
sequence_length = s->getEndFrame();
|
||||
if (seq != nullptr) sequence_length = rescale_frame_number(sequence_length, s->frame_rate, seq->frame_rate);
|
||||
can_import = (s != seq && sequence_length != 0);
|
||||
@@ -330,8 +330,7 @@ void Timeline::add_clips_from_ghosts(ComboAction* ca, Sequence* s) {
|
||||
// sequence (red?ish?)
|
||||
c->set_color(192, 128, 128);
|
||||
|
||||
Sequence* media = c->media()->to_sequence();
|
||||
c->set_name(media->name);
|
||||
c->set_name(c->media()->to_sequence()->name);
|
||||
}
|
||||
c->refresh();
|
||||
added_clips.append(c);
|
||||
@@ -432,7 +431,7 @@ void Timeline::nest() {
|
||||
// copy all selected clips to the nest
|
||||
for (int i=0;i<selected_clips.size();i++) {
|
||||
// delete clip from old sequence
|
||||
ca->append(new DeleteClipAction(olive::ActiveSequence, selected_clips.at(i)));
|
||||
ca->append(new DeleteClipAction(olive::ActiveSequence.get(), selected_clips.at(i)));
|
||||
|
||||
// copy to new
|
||||
ClipPtr copy(olive::ActiveSequence->clips.at(selected_clips.at(i))->copy(s.get()));
|
||||
@@ -450,8 +449,8 @@ void Timeline::nest() {
|
||||
// add nested sequence to active sequence
|
||||
QVector<Media*> media_list;
|
||||
media_list.append(m);
|
||||
create_ghosts_from_media(olive::ActiveSequence, earliest_point, media_list);
|
||||
add_clips_from_ghosts(ca, olive::ActiveSequence);
|
||||
create_ghosts_from_media(olive::ActiveSequence.get(), earliest_point, media_list);
|
||||
add_clips_from_ghosts(ca, olive::ActiveSequence.get());
|
||||
|
||||
panel_effect_controls->Clear(true);
|
||||
olive::ActiveSequence->selections.clear();
|
||||
@@ -648,8 +647,11 @@ void Timeline::delete_in_out_internal(bool ripple) {
|
||||
}
|
||||
ComboAction* ca = new ComboAction();
|
||||
delete_areas_and_relink(ca, areas, true);
|
||||
if (ripple) ripple_clips(ca, olive::ActiveSequence, olive::ActiveSequence->workarea_in, olive::ActiveSequence->workarea_in - olive::ActiveSequence->workarea_out);
|
||||
ca->append(new SetTimelineInOutCommand(olive::ActiveSequence, false, 0, 0));
|
||||
if (ripple) ripple_clips(ca,
|
||||
olive::ActiveSequence.get(),
|
||||
olive::ActiveSequence->workarea_in,
|
||||
olive::ActiveSequence->workarea_in - olive::ActiveSequence->workarea_out);
|
||||
ca->append(new SetTimelineInOutCommand(olive::ActiveSequence.get(), false, 0, 0));
|
||||
olive::UndoStack.push(ca);
|
||||
update_ui(true);
|
||||
}
|
||||
@@ -732,7 +734,7 @@ void Timeline::delete_selection(QVector<Selection>& selections, bool ripple_dele
|
||||
}
|
||||
|
||||
if (can_ripple) {
|
||||
ripple_clips(ca, olive::ActiveSequence, ripple_point, -ripple_length);
|
||||
ripple_clips(ca, olive::ActiveSequence.get(), ripple_point, -ripple_length);
|
||||
panel_sequence_viewer->seek(ripple_point-1);
|
||||
}
|
||||
|
||||
@@ -851,7 +853,7 @@ ClipPtr Timeline::split_clip(ComboAction* ca, bool transitions, int p, long fram
|
||||
if (pre->timeline_in() < frame && pre->timeline_out() > frame) {
|
||||
// duplicate clip without duplicating its transitions, we'll restore them later
|
||||
|
||||
ClipPtr post = ClipPtr(pre->copy(olive::ActiveSequence));
|
||||
ClipPtr post = pre->copy(olive::ActiveSequence.get());
|
||||
|
||||
long new_clip_length = frame - pre->timeline_in();
|
||||
|
||||
@@ -961,7 +963,7 @@ bool Timeline::split_clip_and_relink(ComboAction *ca, int clip, long frame, bool
|
||||
|
||||
relink_clips_using_ids(pre_clips, post_clips);
|
||||
}
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence, post_clips));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence.get(), post_clips));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1032,7 +1034,7 @@ void Timeline::delete_areas_and_relink(ComboAction* ca, QVector<Selection>& area
|
||||
ca->append(new DeleteTransitionCommand(c->closing_transition));
|
||||
} else if (c->timeline_in() >= s.in && c->timeline_out() <= s.out) {
|
||||
// clips falls entirely within deletion area
|
||||
ca->append(new DeleteClipAction(olive::ActiveSequence, j));
|
||||
ca->append(new DeleteClipAction(olive::ActiveSequence.get(), j));
|
||||
} else if (c->timeline_in() < s.in && c->timeline_out() > s.out) {
|
||||
// middle of clip is within deletion area
|
||||
|
||||
@@ -1078,7 +1080,7 @@ void Timeline::delete_areas_and_relink(ComboAction* ca, QVector<Selection>& area
|
||||
}
|
||||
|
||||
relink_clips_using_ids(pre_clips, post_clips);
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence, post_clips));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence.get(), post_clips));
|
||||
}
|
||||
|
||||
void Timeline::copy(bool del) {
|
||||
@@ -1171,7 +1173,7 @@ void Timeline::paste(bool insert) {
|
||||
ClipPtr c = std::static_pointer_cast<Clip>(clipboard.at(i));
|
||||
|
||||
// create copy of clip and offset by playhead
|
||||
ClipPtr cc(c->copy(olive::ActiveSequence));
|
||||
ClipPtr cc = c->copy(olive::ActiveSequence.get());
|
||||
|
||||
// convert frame rates
|
||||
cc->set_timeline_in(rescale_frame_number(cc->timeline_in(), c->cached_frame_rate(), olive::ActiveSequence->frame_rate));
|
||||
@@ -1198,7 +1200,7 @@ void Timeline::paste(bool insert) {
|
||||
if (insert) {
|
||||
split_cache.clear();
|
||||
split_all_clips_at_point(ca, olive::ActiveSequence->playhead);
|
||||
ripple_clips(ca, olive::ActiveSequence, paste_start, paste_end - paste_start);
|
||||
ripple_clips(ca, olive::ActiveSequence.get(), paste_start, paste_end - paste_start);
|
||||
} else {
|
||||
delete_areas_and_relink(ca, delete_areas, false);
|
||||
}
|
||||
@@ -1218,7 +1220,7 @@ void Timeline::paste(bool insert) {
|
||||
}
|
||||
}
|
||||
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence, pasted_clips));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence.get(), pasted_clips));
|
||||
|
||||
olive::UndoStack.push(ca);
|
||||
|
||||
@@ -1367,7 +1369,7 @@ void Timeline::edit_to_point_internal(bool in, bool ripple) {
|
||||
// trim and move clips around the in point
|
||||
delete_areas_and_relink(ca, areas, true);
|
||||
|
||||
if (ripple) ripple_clips(ca, olive::ActiveSequence, in_point, -1);
|
||||
if (ripple) ripple_clips(ca, olive::ActiveSequence.get(), in_point, -1);
|
||||
} else {
|
||||
push_undo = false;
|
||||
}
|
||||
@@ -1391,7 +1393,7 @@ void Timeline::edit_to_point_internal(bool in, bool ripple) {
|
||||
|
||||
// trim and move clips around the in point
|
||||
delete_areas_and_relink(ca, areas, true);
|
||||
if (ripple) ripple_clips(ca, olive::ActiveSequence, s.in, s.in - s.out);
|
||||
if (ripple) ripple_clips(ca, olive::ActiveSequence.get(), s.in, s.in - s.out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1449,8 +1451,8 @@ bool Timeline::split_selection(ComboAction* ca) {
|
||||
relink_clips_using_ids(pre_splits, post_splits);
|
||||
relink_clips_using_ids(pre_splits, secondary_post_splits);
|
||||
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence, post_splits));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence, secondary_post_splits));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence.get(), post_splits));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence.get(), secondary_post_splits));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1495,7 +1497,7 @@ void Timeline::split_at_playhead() {
|
||||
if (split_selected) {
|
||||
// relink clips if we split
|
||||
relink_clips_using_ids(pre_clips, post_clips);
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence, post_clips));
|
||||
ca->append(new AddClipCommand(olive::ActiveSequence.get(), post_clips));
|
||||
} else {
|
||||
// split a selection if not
|
||||
split_selected = split_selection(ca);
|
||||
@@ -1646,7 +1648,7 @@ void Timeline::set_marker() {
|
||||
}
|
||||
|
||||
// pass off to internal set marker function
|
||||
set_marker_internal(olive::ActiveSequence, clips_selected);
|
||||
set_marker_internal(olive::ActiveSequence.get(), clips_selected);
|
||||
|
||||
}
|
||||
|
||||
@@ -1676,7 +1678,7 @@ void Timeline::edit_to_out_point() {
|
||||
|
||||
void Timeline::toggle_links() {
|
||||
LinkCommand* command = new LinkCommand();
|
||||
command->s = olive::ActiveSequence;
|
||||
command->s = olive::ActiveSequence.get();
|
||||
for (int i=0;i<olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = olive::ActiveSequence->clips.at(i).get();
|
||||
if (c != nullptr && olive::ActiveSequence->IsClipSelected(c, true)) {
|
||||
|
||||
+8
-6
@@ -83,7 +83,7 @@ Viewer::Viewer(QWidget *parent) :
|
||||
current_timecode_slider->set_default_value(qSNaN());
|
||||
current_timecode_slider->set_value(0, false);
|
||||
current_timecode_slider->set_display_type(LabelSlider::LABELSLIDER_FRAMENUMBER);
|
||||
connect(current_timecode_slider, SIGNAL(valueChanged()), this, SLOT(update_playhead()));
|
||||
connect(current_timecode_slider, SIGNAL(valueChanged(double)), this, SLOT(update_playhead()));
|
||||
|
||||
recording_flasher.setInterval(500);
|
||||
|
||||
@@ -790,11 +790,11 @@ void Viewer::set_media(Media* m) {
|
||||
}
|
||||
break;
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
seq = SequencePtr(media->to_sequence());
|
||||
seq = media->to_sequence();
|
||||
break;
|
||||
}
|
||||
}
|
||||
set_sequence(false, seq.get());
|
||||
set_sequence(false, seq);
|
||||
}
|
||||
|
||||
void Viewer::update_playhead() {
|
||||
@@ -857,17 +857,19 @@ void Viewer::clean_created_seq() {
|
||||
}
|
||||
}
|
||||
|
||||
void Viewer::set_sequence(bool main, Sequence* s) {
|
||||
void Viewer::set_sequence(bool main, SequencePtr s) {
|
||||
pause();
|
||||
|
||||
reset_all_audio();
|
||||
|
||||
main_sequence = main;
|
||||
|
||||
// If we had a current sequence open, close it
|
||||
if (seq != nullptr) {
|
||||
close_active_clips(seq.get());
|
||||
}
|
||||
|
||||
main_sequence = main;
|
||||
seq = SequencePtr((main) ? olive::ActiveSequence : s);
|
||||
seq = (main) ? olive::ActiveSequence : s;
|
||||
|
||||
bool null_sequence = (seq == nullptr);
|
||||
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ private:
|
||||
|
||||
void update_window_title();
|
||||
void clean_created_seq();
|
||||
void set_sequence(bool main, Sequence *s);
|
||||
void set_sequence(bool main, SequencePtr s);
|
||||
bool main_sequence;
|
||||
bool created_sequence;
|
||||
long cached_end_frame;
|
||||
|
||||
Reference in New Issue
Block a user