further improvements

This commit is contained in:
itsmattkc
2019-02-14 12:37:30 -08:00
parent e9fe837236
commit abe76c7941
35 changed files with 737 additions and 878 deletions
+3 -3
View File
@@ -95,7 +95,7 @@ void EffectControls::menu_select(QAction* q) {
}
}
}
undo_stack.push(ca);
Olive::UndoStack.push(ca);
if (effect_menu_type == EFFECT_TYPE_TRANSITION) {
update_ui(true);
} else {
@@ -146,7 +146,7 @@ void EffectControls::copy(bool del) {
delete del_com;
}
}
undo_stack.push(ca);
Olive::UndoStack.push(ca);
}
}
@@ -529,7 +529,7 @@ void EffectControls::delete_effects() {
}
}
if (command->clips.size() > 0) {
undo_stack.push(command);
Olive::UndoStack.push(command);
panel_sequence_viewer->viewer_widget->frame_update();
} else {
delete command;
+6 -6
View File
@@ -314,7 +314,7 @@ void Project::duplicate_selected() {
}
}
if (duped) {
undo_stack.push(ca);
Olive::UndoStack.push(ca);
} else {
delete ca;
}
@@ -340,7 +340,7 @@ void Project::replace_media(Media* item, QString filename) {
}
if (!filename.isEmpty()) {
ReplaceMediaCommand* rmc = new ReplaceMediaCommand(item, filename);
undo_stack.push(rmc);
Olive::UndoStack.push(rmc);
}
}
@@ -394,7 +394,7 @@ void Project::open_properties() {
item->get_name());
if (!new_name.isEmpty()) {
MediaRename* mr = new MediaRename(item, new_name);
undo_stack.push(mr);
Olive::UndoStack.push(mr);
}
}
}
@@ -608,7 +608,7 @@ void Project::delete_selected_media() {
}
}
}
undo_stack.push(ca);
Olive::UndoStack.push(ca);
// redraw clips
if (redraw) {
@@ -785,7 +785,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
}
if (create_undo_action) {
if (imported) {
undo_stack.push(ca);
Olive::UndoStack.push(ca);
for (int i=0;i<last_imported_media.size();i++) {
// generate waveform/thumbnail in another thread
@@ -898,7 +898,7 @@ void Project::delete_clips_using_selected_media() {
if (delete_clips_in_clipboard_with_media(ca, m)) deleted = true;
}
if (deleted) {
undo_stack.push(ca);
Olive::UndoStack.push(ca);
update_ui(true);
} else {
delete ca;
+30 -10
View File
@@ -357,7 +357,7 @@ void Timeline::add_transition() {
}
if (adding) {
undo_stack.push(ca);
Olive::UndoStack.push(ca);
} else {
delete ca;
}
@@ -569,9 +569,29 @@ void Timeline::delete_in_out(bool ripple) {
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));
undo_stack.push(ca);
Olive::UndoStack.push(ca);
update_ui(true);
}
}
}
void Timeline::toggle_enable_on_selected_clips() {
if (Olive::ActiveSequence != nullptr) {
ComboAction* ca = new ComboAction();
bool push_undo = false;
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
Clip* c = Olive::ActiveSequence->clips.at(i);
if (c != nullptr && is_clip_selected(c, true)) {
ca->append(new SetBool(&c->enabled, !c->enabled));
push_undo = true;
}
}
if (push_undo) {
Olive::UndoStack.push(ca);
update_ui(true);
} else {
delete ca;
}
}
}
void Timeline::delete_selection(QVector<Selection>& selections, bool ripple_delete) {
@@ -631,7 +651,7 @@ void Timeline::delete_selection(QVector<Selection>& selections, bool ripple_dele
}
}
undo_stack.push(ca);
Olive::UndoStack.push(ca);
update_ui(true);
}
@@ -1065,7 +1085,7 @@ void Timeline::paste(bool insert) {
ca->append(new AddClipCommand(Olive::ActiveSequence, pasted_clips));
undo_stack.push(ca);
Olive::UndoStack.push(ca);
update_ui(true);
@@ -1139,8 +1159,8 @@ void Timeline::paste(bool insert) {
}
}
if (push) {
ca->appendPost(new ReloadEffectsCommand());
undo_stack.push(ca);
ca->appendPost(new ReloadEffectsCommand());
Olive::UndoStack.push(ca);
} else {
delete ca;
}
@@ -1244,7 +1264,7 @@ void Timeline::ripple_to_in_point(bool in, bool ripple) {
}
if (push_undo) {
undo_stack.push(ca);
Olive::UndoStack.push(ca);
update_ui(true);
@@ -1353,7 +1373,7 @@ void Timeline::split_at_playhead() {
}
if (split_selected) {
undo_stack.push(ca);
Olive::UndoStack.push(ca);
update_ui(true);
} else {
delete ca;
@@ -1501,7 +1521,7 @@ void Timeline::toggle_links() {
}
}
if (command->clips.size() > 0) {
undo_stack.push(command);
Olive::UndoStack.push(command);
repaint_timeline();
} else {
delete command;
+4 -2
View File
@@ -95,8 +95,6 @@ public:
bool has_clip_been_split(int c);
void ripple_to_in_point(bool in, bool ripple);
void delete_in_out(bool ripple);
void previous_cut();
void next_cut();
void create_ghosts_from_media(Sequence *seq, long entry_point, QVector<Media *> &media_list);
void add_clips_from_ghosts(ComboAction *ca, Sequence *s);
@@ -215,6 +213,10 @@ public slots:
void toggle_links();
void split_at_playhead();
void ripple_delete_empty_space();
void toggle_enable_on_selected_clips();
void previous_cut();
void next_cut();
private slots:
void zoom_in();
+4 -4
View File
@@ -440,7 +440,7 @@ void Viewer::pause() {
QVector<Clip*> add_clips;
add_clips.append(c);
undo_stack.push(new AddClipCommand(seq, add_clips)); // add clip
Olive::UndoStack.push(new AddClipCommand(seq, add_clips)); // add clip
}
}
}
@@ -500,21 +500,21 @@ void Viewer::update_viewer() {
void Viewer::clear_in() {
if (seq->using_workarea) {
undo_stack.push(new SetTimelineInOutCommand(seq, true, 0, seq->workarea_out));
Olive::UndoStack.push(new SetTimelineInOutCommand(seq, true, 0, seq->workarea_out));
update_parents();
}
}
void Viewer::clear_out() {
if (seq->using_workarea) {
undo_stack.push(new SetTimelineInOutCommand(seq, true, seq->workarea_in, seq->getEndFrame()));
Olive::UndoStack.push(new SetTimelineInOutCommand(seq, true, seq->workarea_in, seq->getEndFrame()));
update_parents();
}
}
void Viewer::clear_inout_point() {
if (seq->using_workarea) {
undo_stack.push(new SetTimelineInOutCommand(seq, false, 0, 0));
Olive::UndoStack.push(new SetTimelineInOutCommand(seq, false, 0, 0));
update_parents();
}
}