further improvements
This commit is contained in:
@@ -185,7 +185,7 @@ void MediaPropertiesDialog::accept() {
|
||||
}
|
||||
ca->appendPost(new UpdateViewer());
|
||||
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ void NewSequenceDialog::create() {
|
||||
|
||||
ComboAction* ca = new ComboAction();
|
||||
panel_project->new_sequence(ca, s, true, nullptr);
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
} else {
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
@@ -98,7 +98,7 @@ void NewSequenceDialog::create() {
|
||||
}
|
||||
}
|
||||
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
}
|
||||
|
||||
accept();
|
||||
|
||||
@@ -101,7 +101,7 @@ void ReplaceClipMediaDialog::replace() {
|
||||
}
|
||||
}
|
||||
|
||||
undo_stack.push(rcmc);
|
||||
Olive::UndoStack.push(rcmc);
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ void SpeedDialog::accept() {
|
||||
sel_command->new_data = Olive::ActiveSequence->selections;
|
||||
ca->append(sel_command);
|
||||
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
|
||||
update_ui(true);
|
||||
QDialog::accept();
|
||||
|
||||
@@ -36,6 +36,8 @@ struct VSTRect {
|
||||
extern "C" {
|
||||
// Main host callback
|
||||
intptr_t hostCallback(AEffect* effect, int32_t opcode, int32_t index, intptr_t value, void* ptr, float opt) {
|
||||
Q_UNUSED(value)
|
||||
|
||||
switch(opcode) {
|
||||
case audioMasterAutomate:
|
||||
effect->setParameter(effect, index, opt);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#include "avtogl.h"
|
||||
|
||||
extern "C" {
|
||||
#include <libavutil/avutil.h>
|
||||
}
|
||||
|
||||
enum QOpenGLTexture::PixelFormat get_gl_pix_fmt_from_av(int format) {
|
||||
/*switch (format) {
|
||||
case AV_PIX_FMT_RGB24: return QOpenGLTexture::RGB;
|
||||
}*/
|
||||
return QOpenGLTexture::RGBA;
|
||||
}
|
||||
|
||||
enum QOpenGLTexture::TextureFormat get_gl_tex_fmt_from_av(int format) {
|
||||
/*switch (format) {
|
||||
case AV_PIX_FMT_RGB24: return QOpenGLTexture::RGB8_UNorm;
|
||||
}*/
|
||||
return QOpenGLTexture::RGBA8_UNorm;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
#ifndef AVTOGL_H
|
||||
#define AVTOGL_H
|
||||
|
||||
#include <QOpenGLTexture>
|
||||
|
||||
enum QOpenGLTexture::PixelFormat get_gl_pix_fmt_from_av(int format);
|
||||
enum QOpenGLTexture::TextureFormat get_gl_tex_fmt_from_av(int format);
|
||||
|
||||
#endif // AVTOGL_H
|
||||
+18
-56
@@ -432,20 +432,24 @@ void MainWindow::ripple_delete() {
|
||||
}
|
||||
|
||||
void MainWindow::editMenu_About_To_Be_Shown() {
|
||||
undo_action->setEnabled(undo_stack.canUndo());
|
||||
redo_action->setEnabled(undo_stack.canRedo());
|
||||
undo_action->setEnabled(Olive::UndoStack.canUndo());
|
||||
redo_action->setEnabled(Olive::UndoStack.canRedo());
|
||||
}
|
||||
|
||||
void MainWindow::undo() {
|
||||
if (!panel_timeline->importing) { // workaround to prevent crash (and also users should never need to do this)
|
||||
undo_stack.undo();
|
||||
// workaround to prevent crash (and also users should never need to do this)
|
||||
if (!panel_timeline->importing) {
|
||||
Olive::UndoStack.undo();
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::redo() {
|
||||
undo_stack.redo();
|
||||
update_ui(true);
|
||||
// workaround to prevent crash (and also users should never need to do this)
|
||||
if (!panel_timeline->importing) {
|
||||
Olive::UndoStack.redo();
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::open_speed_dialog() {
|
||||
@@ -558,7 +562,7 @@ void MainWindow::setup_menus() {
|
||||
|
||||
edit_menu->addAction(tr("Add Default Transition"), this, SLOT(add_default_transition()), QKeySequence("Ctrl+Shift+D"))->setProperty("id", "deftransition");
|
||||
edit_menu->addAction(tr("Link/Unlink"), panel_timeline, SLOT(toggle_links()), QKeySequence("Ctrl+L"))->setProperty("id", "linkunlink");
|
||||
edit_menu->addAction(tr("Enable/Disable"), this, SLOT(toggle_enable_clips()), QKeySequence("Shift+E"))->setProperty("id", "enabledisable");
|
||||
edit_menu->addAction(tr("Enable/Disable"), panel_timeline, SLOT(toggle_enable_on_selected_clips()), QKeySequence("Shift+E"))->setProperty("id", "enabledisable");
|
||||
edit_menu->addAction(tr("Nest"), this, SLOT(nest()))->setProperty("id", "nest");
|
||||
|
||||
edit_menu->addSeparator();
|
||||
@@ -585,8 +589,8 @@ void MainWindow::setup_menus() {
|
||||
|
||||
view_menu->addAction(tr("Zoom In"), this, SLOT(zoom_in()), QKeySequence("="))->setProperty("id", "zoomin");
|
||||
view_menu->addAction(tr("Zoom Out"), this, SLOT(zoom_out()), QKeySequence("-"))->setProperty("id", "zoomout");
|
||||
view_menu->addAction(tr("Increase Track Height"), this, SLOT(zoom_in_tracks()), QKeySequence("Ctrl+="))->setProperty("id", "vzoomin");
|
||||
view_menu->addAction(tr("Decrease Track Height"), this, SLOT(zoom_out_tracks()), QKeySequence("Ctrl+-"))->setProperty("id", "vzoomout");
|
||||
view_menu->addAction(tr("Increase Track Height"), panel_timeline, SLOT(increase_track_height()), QKeySequence("Ctrl+="))->setProperty("id", "vzoomin");
|
||||
view_menu->addAction(tr("Decrease Track Height"), panel_timeline, SLOT(decrease_track_height()), QKeySequence("Ctrl+-"))->setProperty("id", "vzoomout");
|
||||
|
||||
show_all = view_menu->addAction(tr("Toggle Show All"), panel_timeline, SLOT(toggle_show_all()), QKeySequence("\\"));
|
||||
show_all->setProperty("id", "showall");
|
||||
@@ -672,8 +676,8 @@ void MainWindow::setup_menus() {
|
||||
playback_menu->addAction(tr("Next Frame"), this, SLOT(next_frame()), QKeySequence("Right"))->setProperty("id", "nextframe");
|
||||
playback_menu->addAction(tr("Go to End"), this, SLOT(go_to_end()), QKeySequence("End"))->setProperty("id", "gotoend");
|
||||
playback_menu->addSeparator();
|
||||
playback_menu->addAction(tr("Go to Previous Cut"), this, SLOT(prev_cut()), QKeySequence("Up"))->setProperty("id", "prevcut");
|
||||
playback_menu->addAction(tr("Go to Next Cut"), this, SLOT(next_cut()), QKeySequence("Down"))->setProperty("id", "nextcut");
|
||||
playback_menu->addAction(tr("Go to Previous Cut"), panel_timeline, SLOT(previous_cut()), QKeySequence("Up"))->setProperty("id", "prevcut");
|
||||
playback_menu->addAction(tr("Go to Next Cut"), panel_timeline, SLOT(next_cut()), QKeySequence("Down"))->setProperty("id", "nextcut");
|
||||
playback_menu->addSeparator();
|
||||
playback_menu->addAction(tr("Go to In Point"), this, SLOT(go_to_in()), QKeySequence("Shift+I"))->setProperty("id", "gotoin");
|
||||
playback_menu->addAction(tr("Go to Out Point"), this, SLOT(go_to_out()), QKeySequence("Shift+O"))->setProperty("id", "gotoout");
|
||||
@@ -975,7 +979,7 @@ void MainWindow::paintEvent(QPaintEvent *event) {
|
||||
}
|
||||
|
||||
void MainWindow::clear_undo_stack() {
|
||||
undo_stack.clear();
|
||||
Olive::UndoStack.clear();
|
||||
}
|
||||
|
||||
void MainWindow::show_action_search() {
|
||||
@@ -1086,20 +1090,6 @@ void MainWindow::decrease_speed() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::prev_cut() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (Olive::ActiveSequence != nullptr && (panel_timeline == focused_panel || panel_sequence_viewer == focused_panel)) {
|
||||
panel_timeline->previous_cut();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::next_cut() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (Olive::ActiveSequence != nullptr && (panel_timeline == focused_panel || panel_sequence_viewer == focused_panel)) {
|
||||
panel_timeline->next_cut();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::maximize_panel() {
|
||||
// toggles between normal state and a state of one panel being maximized
|
||||
if (temp_panel_state.isEmpty()) {
|
||||
@@ -1137,14 +1127,6 @@ void MainWindow::preferences() {
|
||||
pd.exec();
|
||||
}
|
||||
|
||||
void MainWindow::zoom_in_tracks() {
|
||||
panel_timeline->increase_track_height();
|
||||
}
|
||||
|
||||
void MainWindow::zoom_out_tracks() {
|
||||
panel_timeline->decrease_track_height();
|
||||
}
|
||||
|
||||
void MainWindow::full_screen_viewer() {
|
||||
if (get_focused_panel() == panel_footage_viewer) {
|
||||
panel_footage_viewer->viewer_widget->set_fullscreen();
|
||||
@@ -1229,7 +1211,7 @@ void MainWindow::add_default_transition() {
|
||||
|
||||
void MainWindow::new_folder() {
|
||||
Media* m = panel_project->new_folder(nullptr);
|
||||
undo_stack.push(new AddMediaCommand(m, panel_project->get_selected_folder()));
|
||||
Olive::UndoStack.push(new AddMediaCommand(m, panel_project->get_selected_folder()));
|
||||
|
||||
QModelIndex index = project_model.create_index(m->row(), 0, m);
|
||||
switch (config.project_view_type) {
|
||||
@@ -1393,26 +1375,6 @@ void MainWindow::set_marker() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::toggle_enable_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 SetEnableCommand(c, !c->enabled));
|
||||
push_undo = true;
|
||||
}
|
||||
}
|
||||
if (push_undo) {
|
||||
undo_stack.push(ca);
|
||||
update_ui(true);
|
||||
} else {
|
||||
delete ca;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::edit_to_in_point() {
|
||||
QDockWidget* focused_panel = get_focused_panel();
|
||||
if (focused_panel == panel_timeline) panel_timeline->ripple_to_in_point(true, false);
|
||||
@@ -1478,7 +1440,7 @@ void MainWindow::nest() {
|
||||
panel_effect_controls->clear_effects(true);
|
||||
Olive::ActiveSequence->selections.clear();
|
||||
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
|
||||
update_ui(true);
|
||||
}
|
||||
|
||||
+1
-6
@@ -16,8 +16,6 @@ public:
|
||||
|
||||
void updateTitle();
|
||||
|
||||
void launch_with_project(const QString& s);
|
||||
|
||||
void load_shortcuts(const QString &fn, bool first = false);
|
||||
void save_shortcuts(const QString &fn);
|
||||
|
||||
@@ -74,10 +72,7 @@ private slots:
|
||||
void maximize_panel();
|
||||
void reset_layout();
|
||||
|
||||
void preferences();
|
||||
|
||||
void zoom_in_tracks();
|
||||
void zoom_out_tracks();
|
||||
void preferences();
|
||||
|
||||
void full_screen_viewer();
|
||||
|
||||
|
||||
@@ -112,7 +112,6 @@ SOURCES += \
|
||||
project/effectgizmo.cpp \
|
||||
io/clipboard.cpp \
|
||||
dialogs/stabilizerdialog.cpp \
|
||||
io/avtogl.cpp \
|
||||
ui/resizablescrollbar.cpp \
|
||||
ui/sourceiconview.cpp \
|
||||
project/sourcescommon.cpp \
|
||||
@@ -219,7 +218,6 @@ HEADERS += \
|
||||
project/effectgizmo.h \
|
||||
io/clipboard.h \
|
||||
dialogs/stabilizerdialog.h \
|
||||
io/avtogl.h \
|
||||
ui/resizablescrollbar.h \
|
||||
ui/sourceiconview.h \
|
||||
project/sourcescommon.h \
|
||||
|
||||
+2
-2
@@ -86,7 +86,7 @@ void OliveGlobal::new_project() {
|
||||
panel_project->new_project();
|
||||
|
||||
// clear undo stack
|
||||
undo_stack.clear();
|
||||
Olive::UndoStack.clear();
|
||||
|
||||
// empty current project filename
|
||||
update_project_filename("");
|
||||
@@ -188,5 +188,5 @@ void OliveGlobal::save_autorecovery_file() {
|
||||
void OliveGlobal::open_project_worker(const QString& fn, bool autorecovery) {
|
||||
update_project_filename(fn);
|
||||
panel_project->load_project(autorecovery);
|
||||
undo_stack.clear();
|
||||
Olive::UndoStack.clear();
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "panels/effectcontrols.h"
|
||||
#include "project/media.h"
|
||||
#include "io/config.h"
|
||||
#include "io/avtogl.h"
|
||||
#include "io/proxygenerator.h"
|
||||
#include "debug.h"
|
||||
|
||||
@@ -36,8 +35,6 @@ extern "C" {
|
||||
//#define GCF_DEBUG
|
||||
#endif
|
||||
|
||||
bool rendering = false;
|
||||
|
||||
long refactor_frame_number(long framenumber, double source_frame_rate, double target_frame_rate) {
|
||||
return qRound((double(framenumber)/source_frame_rate)*target_frame_rate);
|
||||
}
|
||||
@@ -327,12 +324,16 @@ void get_clip_frame(Clip* c, long playhead, bool& texture_failed) {
|
||||
|
||||
memcpy(data_buffer_1, target_frame->data[0], frame_size);
|
||||
}
|
||||
e->process_image(get_timecode(c, playhead), using_db_1 ? data_buffer_1 : data_buffer_2, using_db_1 ? data_buffer_2 : data_buffer_1, frame_size);
|
||||
e->process_image(get_timecode(c, playhead),
|
||||
using_db_1 ? data_buffer_1 : data_buffer_2,
|
||||
using_db_1 ? data_buffer_2 : data_buffer_1,
|
||||
frame_size
|
||||
);
|
||||
using_db_1 = !using_db_1;
|
||||
}
|
||||
}
|
||||
|
||||
c->texture->setData(get_gl_pix_fmt_from_av(c->pix_fmt), QOpenGLTexture::UInt8, const_cast<const uint8_t*>(using_db_1 ? data_buffer_1 : data_buffer_2));
|
||||
c->texture->setData(QOpenGLTexture::RGBA, QOpenGLTexture::UInt8, const_cast<const uint8_t*>(using_db_1 ? data_buffer_1 : data_buffer_2));
|
||||
|
||||
if (data_buffer_1 != target_frame->data[0]) {
|
||||
delete [] data_buffer_1;
|
||||
|
||||
+5
-5
@@ -412,7 +412,7 @@ void Effect::delete_self() {
|
||||
EffectDeleteCommand* command = new EffectDeleteCommand();
|
||||
command->clips.append(parent_clip);
|
||||
command->fx.append(get_index_in_clip());
|
||||
undo_stack.push(command);
|
||||
Olive::UndoStack.push(command);
|
||||
update_ui(true);
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ void Effect::move_up() {
|
||||
command->clip = parent_clip;
|
||||
command->from = get_index_in_clip();
|
||||
command->to = command->from - 1;
|
||||
undo_stack.push(command);
|
||||
Olive::UndoStack.push(command);
|
||||
panel_effect_controls->reload_clips();
|
||||
panel_sequence_viewer->viewer_widget->frame_update();
|
||||
}
|
||||
@@ -431,7 +431,7 @@ void Effect::move_down() {
|
||||
command->clip = parent_clip;
|
||||
command->from = get_index_in_clip();
|
||||
command->to = command->from + 1;
|
||||
undo_stack.push(command);
|
||||
Olive::UndoStack.push(command);
|
||||
panel_effect_controls->reload_clips();
|
||||
panel_sequence_viewer->viewer_widget->frame_update();
|
||||
}
|
||||
@@ -478,7 +478,7 @@ void Effect::load_from_file() {
|
||||
QFile file_handle(file);
|
||||
if (file_handle.open(QFile::ReadOnly)) {
|
||||
|
||||
undo_stack.push(new SetEffectData(this, file_handle.readAll()));
|
||||
Olive::UndoStack.push(new SetEffectData(this, file_handle.readAll()));
|
||||
|
||||
file_handle.close();
|
||||
|
||||
@@ -942,7 +942,7 @@ void Effect::gizmo_move(EffectGizmo* gizmo, int x_movement, int y_movement, doub
|
||||
gizmo->y_field2->set_double_value(gizmo->y_field2->get_double_value(timecode) + y_movement*gizmo->y_field_multi2);
|
||||
gizmo->y_field2->make_key_from_change(ca);
|
||||
}
|
||||
if (done) undo_stack.push(ca);
|
||||
if (done) Olive::UndoStack.push(ca);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ void EffectField::ui_element_change() {
|
||||
ComboAction* ca = nullptr;
|
||||
if (!dragging_double) ca = new ComboAction();
|
||||
make_key_from_change(ca);
|
||||
if (!dragging_double) undo_stack.push(ca);
|
||||
if (!dragging_double) Olive::UndoStack.push(ca);
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ void EffectRow::set_keyframe_enabled(bool enabled) {
|
||||
ComboAction* ca = new ComboAction();
|
||||
ca->append(new SetKeyframing(this, true));
|
||||
set_keyframe_now(ca);
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
} else {
|
||||
if (QMessageBox::question(panel_effect_controls,
|
||||
tr("Disable Keyframes"),
|
||||
@@ -86,7 +86,7 @@ void EffectRow::set_keyframe_enabled(bool enabled) {
|
||||
}
|
||||
}
|
||||
ca->append(new SetKeyframing(this, false));
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
panel_effect_controls->update_keyframes();
|
||||
} else {
|
||||
setKeyframing(true);
|
||||
@@ -133,7 +133,7 @@ void EffectRow::toggle_key() {
|
||||
ca->append(new KeyframeDelete(key_fields.at(i), key_field_index.at(i)));
|
||||
}
|
||||
}
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
update_ui(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ void delete_keyframes(QVector<EffectField *>& selected_key_fields, QVector<int>
|
||||
for (int i=0;i<key_indices.size();i++) {
|
||||
ca->append(new KeyframeDelete(fields.at(i), key_indices.at(i)));
|
||||
}
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
selected_keys.clear();
|
||||
selected_key_fields.clear();
|
||||
update_ui(false);
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
#include <QInputDialog>
|
||||
#include <QCoreApplication>
|
||||
|
||||
void draw_marker(QPainter &p, int x, int y, int bottom, bool selected, bool flipped) {
|
||||
void draw_marker(QPainter &p, int x, int y, int bottom, bool selected) {
|
||||
const QPoint points[5] = {
|
||||
QPoint(x, bottom),
|
||||
QPoint(x + MARKER_SIZE, bottom - MARKER_SIZE),
|
||||
@@ -90,7 +90,7 @@ void set_marker_internal(Sequence* seq, const QVector<int>& clips) {
|
||||
|
||||
|
||||
// push action
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
|
||||
// redraw UI for new markers
|
||||
update_ui(false);
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ struct Marker {
|
||||
QString name;
|
||||
};
|
||||
|
||||
void draw_marker(QPainter& p, int x, int y, int bottom, bool selected, bool flipped);
|
||||
void draw_marker(QPainter& p, int x, int y, int bottom, bool selected);
|
||||
|
||||
void set_marker_internal(Sequence* seq, const QVector<int>& clips);
|
||||
void set_marker_internal(Sequence* seq);
|
||||
|
||||
+1
-1
@@ -244,7 +244,7 @@ bool Media::setData(int col, const QVariant &value) {
|
||||
if (col == 0) {
|
||||
QString n = value.toString();
|
||||
if (!n.isEmpty() && get_name() != n) {
|
||||
undo_stack.push(new MediaRename(this, value.toString()));
|
||||
Olive::UndoStack.push(new MediaRename(this, value.toString()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void SourcesCommon::create_seq_from_selected() {
|
||||
panel_timeline->add_clips_from_ghosts(ca, s);
|
||||
|
||||
project_parent->new_sequence(ca, s, true, nullptr);
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ void SourcesCommon::mouseDoubleClickEvent(QMouseEvent *, const QModelIndexList&
|
||||
panel_footage_viewer->setFocus();
|
||||
break;
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
undo_stack.push(new ChangeSequenceAction(item->to_sequence()));
|
||||
Olive::UndoStack.push(new ChangeSequenceAction(item->to_sequence()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -306,7 +306,7 @@ void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIn
|
||||
MediaMove* mm = new MediaMove();
|
||||
mm->to = m;
|
||||
mm->items = move_items;
|
||||
undo_stack.push(mm);
|
||||
Olive::UndoStack.push(mm);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -350,7 +350,7 @@ void SourcesCommon::rename_interval() {
|
||||
void SourcesCommon::item_renamed(Media* item) {
|
||||
if (editing_item == item) {
|
||||
MediaRename* mr = new MediaRename(item, "idk");
|
||||
undo_stack.push(mr);
|
||||
Olive::UndoStack.push(mr);
|
||||
editing_item = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
+385
-459
File diff suppressed because it is too large
Load Diff
+214
-243
@@ -25,14 +25,16 @@ struct EffectMeta;
|
||||
#include <QVariant>
|
||||
#include <QModelIndex>
|
||||
|
||||
extern QUndoStack undo_stack;
|
||||
namespace Olive {
|
||||
extern QUndoStack UndoStack;
|
||||
}
|
||||
|
||||
class ComboAction : public QUndoCommand {
|
||||
public:
|
||||
ComboAction();
|
||||
~ComboAction();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~ComboAction() override;
|
||||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
void append(QUndoCommand* u);
|
||||
void appendPost(QUndoCommand* u);
|
||||
private:
|
||||
@@ -40,11 +42,33 @@ private:
|
||||
QVector<QUndoCommand*> post_commands;
|
||||
};
|
||||
|
||||
class MoveClipAction : public QUndoCommand {
|
||||
class OliveAction : public QUndoCommand {
|
||||
public:
|
||||
OliveAction(bool iset_window_modified = true);
|
||||
virtual ~OliveAction() override;
|
||||
|
||||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
|
||||
virtual void doUndo() = 0;
|
||||
virtual void doRedo() = 0;
|
||||
private:
|
||||
/**
|
||||
* @brief Setting whether to change the windowModified state of MainWindow
|
||||
*/
|
||||
bool set_window_modified;
|
||||
|
||||
/**
|
||||
* @brief Cache previous window modified value to return to if the user undoes this action
|
||||
*/
|
||||
bool old_window_modified;
|
||||
};
|
||||
|
||||
class MoveClipAction : public OliveAction {
|
||||
public:
|
||||
MoveClipAction(Clip* c, long iin, long iout, long iclip_in, int itrack, bool irelative);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Clip* clip;
|
||||
|
||||
@@ -58,16 +82,14 @@ private:
|
||||
long new_clip_in;
|
||||
int new_track;
|
||||
|
||||
bool relative;
|
||||
|
||||
bool old_project_changed;
|
||||
bool relative;
|
||||
};
|
||||
|
||||
class RippleAction : public QUndoCommand {
|
||||
class RippleAction : public OliveAction {
|
||||
public:
|
||||
RippleAction(Sequence *is, long ipoint, long ilength, const QVector<int>& iignore);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Sequence *s;
|
||||
long point;
|
||||
@@ -76,12 +98,12 @@ private:
|
||||
ComboAction* ca;
|
||||
};
|
||||
|
||||
class DeleteClipAction : public QUndoCommand {
|
||||
class DeleteClipAction : public OliveAction {
|
||||
public:
|
||||
DeleteClipAction(Sequence* s, int clip);
|
||||
~DeleteClipAction();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~DeleteClipAction() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Sequence* seq;
|
||||
Clip* ref;
|
||||
@@ -91,86 +113,80 @@ private:
|
||||
int closing_transition;
|
||||
|
||||
QVector<int> linkClipIndex;
|
||||
QVector<int> linkLinkIndex;
|
||||
|
||||
bool old_project_changed;
|
||||
QVector<int> linkLinkIndex;
|
||||
};
|
||||
|
||||
class ChangeSequenceAction : public QUndoCommand {
|
||||
class ChangeSequenceAction : public OliveAction {
|
||||
public:
|
||||
ChangeSequenceAction(Sequence* s);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Sequence* old_sequence;
|
||||
Sequence* new_sequence;
|
||||
};
|
||||
|
||||
class AddEffectCommand : public QUndoCommand {
|
||||
class AddEffectCommand : public OliveAction {
|
||||
public:
|
||||
AddEffectCommand(Clip* c, Effect *e, const EffectMeta* m, int insert_pos = -1);
|
||||
~AddEffectCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~AddEffectCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Clip* clip;
|
||||
const EffectMeta* meta;
|
||||
Effect* ref;
|
||||
int pos;
|
||||
bool done;
|
||||
bool old_project_changed;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddTransitionCommand : public QUndoCommand {
|
||||
class AddTransitionCommand : public OliveAction {
|
||||
public:
|
||||
AddTransitionCommand(Clip* c, Clip* s, Transition *copy, const EffectMeta* itransition, int itype, int ilength);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Clip* clip;
|
||||
Clip* secondary;
|
||||
Transition* transition_to_copy;
|
||||
const EffectMeta* transition;
|
||||
int type;
|
||||
int length;
|
||||
bool old_project_changed;
|
||||
int length;
|
||||
int old_ptransition;
|
||||
int old_stransition;
|
||||
};
|
||||
|
||||
class ModifyTransitionCommand : public QUndoCommand {
|
||||
class ModifyTransitionCommand : public OliveAction {
|
||||
public:
|
||||
ModifyTransitionCommand(Clip* c, int itype, long ilength);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Clip* clip;
|
||||
int type;
|
||||
long new_length;
|
||||
long old_length;
|
||||
bool old_project_changed;
|
||||
long old_length;
|
||||
};
|
||||
|
||||
class DeleteTransitionCommand : public QUndoCommand {
|
||||
class DeleteTransitionCommand : public OliveAction {
|
||||
public:
|
||||
DeleteTransitionCommand(Sequence* s, int transition_index);
|
||||
~DeleteTransitionCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~DeleteTransitionCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Sequence* seq;
|
||||
int index;
|
||||
Transition* transition;
|
||||
Clip* otc;
|
||||
Clip* ctc;
|
||||
bool old_project_changed;
|
||||
Clip* ctc;
|
||||
};
|
||||
|
||||
class SetTimelineInOutCommand : public QUndoCommand {
|
||||
class SetTimelineInOutCommand : public OliveAction {
|
||||
public:
|
||||
SetTimelineInOutCommand(Sequence* s, bool enabled, long in, long out);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Sequence* seq;
|
||||
|
||||
@@ -180,299 +196,263 @@ private:
|
||||
|
||||
bool new_enabled;
|
||||
long new_in;
|
||||
long new_out;
|
||||
|
||||
bool old_project_changed;
|
||||
long new_out;
|
||||
};
|
||||
|
||||
class NewSequenceCommand : public QUndoCommand {
|
||||
class NewSequenceCommand : public OliveAction {
|
||||
public:
|
||||
NewSequenceCommand(Media *s, Media* iparent);
|
||||
~NewSequenceCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~NewSequenceCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* seq;
|
||||
Media* parent;
|
||||
bool done;
|
||||
bool old_project_changed;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddMediaCommand : public QUndoCommand {
|
||||
class AddMediaCommand : public OliveAction {
|
||||
public:
|
||||
AddMediaCommand(Media* iitem, Media* iparent);
|
||||
~AddMediaCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~AddMediaCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
Media* parent;
|
||||
bool done;
|
||||
bool old_project_changed;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class DeleteMediaCommand : public QUndoCommand {
|
||||
class DeleteMediaCommand : public OliveAction {
|
||||
public:
|
||||
DeleteMediaCommand(Media *i);
|
||||
~DeleteMediaCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~DeleteMediaCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
Media* parent;
|
||||
bool old_project_changed;
|
||||
Media* parent;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class AddClipCommand : public QUndoCommand {
|
||||
class AddClipCommand : public OliveAction {
|
||||
public:
|
||||
AddClipCommand(Sequence* s, QVector<Clip*>& add);
|
||||
~AddClipCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~AddClipCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Sequence* seq;
|
||||
QVector<Clip*> clips;
|
||||
QVector<Clip*> undone_clips;
|
||||
bool old_project_changed;
|
||||
QVector<Clip*> undone_clips;
|
||||
};
|
||||
|
||||
class LinkCommand : public QUndoCommand {
|
||||
class LinkCommand : public OliveAction {
|
||||
public:
|
||||
LinkCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
Sequence* s;
|
||||
QVector<int> clips;
|
||||
bool link;
|
||||
private:
|
||||
QVector< QVector<int> > old_links;
|
||||
bool old_project_changed;
|
||||
QVector< QVector<int> > old_links;
|
||||
};
|
||||
|
||||
class CheckboxCommand : public QUndoCommand {
|
||||
class CheckboxCommand : public OliveAction {
|
||||
public:
|
||||
CheckboxCommand(QCheckBox* b);
|
||||
~CheckboxCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~CheckboxCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QCheckBox* box;
|
||||
bool checked;
|
||||
bool done;
|
||||
bool old_project_changed;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class ReplaceMediaCommand : public QUndoCommand {
|
||||
class ReplaceMediaCommand : public OliveAction {
|
||||
public:
|
||||
ReplaceMediaCommand(Media*, QString);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media *item;
|
||||
QString old_filename;
|
||||
QString new_filename;
|
||||
bool old_project_changed;
|
||||
QString new_filename;
|
||||
void replace(QString& filename);
|
||||
};
|
||||
|
||||
class ReplaceClipMediaCommand : public QUndoCommand {
|
||||
class ReplaceClipMediaCommand : public OliveAction {
|
||||
public:
|
||||
ReplaceClipMediaCommand(Media *, Media *, bool);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<Clip*> clips;
|
||||
private:
|
||||
Media* old_media;
|
||||
Media* new_media;
|
||||
bool preserve_clip_ins;
|
||||
bool old_project_changed;
|
||||
bool preserve_clip_ins;
|
||||
QVector<int> old_clip_ins;
|
||||
void replace(bool undo);
|
||||
};
|
||||
|
||||
class EffectDeleteCommand : public QUndoCommand {
|
||||
class EffectDeleteCommand : public OliveAction {
|
||||
public:
|
||||
EffectDeleteCommand();
|
||||
~EffectDeleteCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~EffectDeleteCommand() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<Clip*> clips;
|
||||
QVector<int> fx;
|
||||
private:
|
||||
bool done;
|
||||
bool old_project_changed;
|
||||
bool done;
|
||||
QVector<Effect*> deleted_objects;
|
||||
};
|
||||
|
||||
class MediaMove : public QUndoCommand {
|
||||
class MediaMove : public OliveAction {
|
||||
public:
|
||||
MediaMove();
|
||||
QVector<Media*> items;
|
||||
Media* to;
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QVector<Media*> froms;
|
||||
bool old_project_changed;
|
||||
QVector<Media*> froms;
|
||||
};
|
||||
|
||||
class MediaRename : public QUndoCommand {
|
||||
class MediaRename : public OliveAction {
|
||||
public:
|
||||
MediaRename(Media* iitem, QString to);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
bool old_project_changed;
|
||||
Media* item;
|
||||
QString from;
|
||||
QString to;
|
||||
};
|
||||
|
||||
class KeyframeDelete : public QUndoCommand {
|
||||
class KeyframeDelete : public OliveAction {
|
||||
public:
|
||||
KeyframeDelete(EffectField* ifield, int iindex);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectField* field;
|
||||
int index;
|
||||
bool done;
|
||||
EffectKeyframe deleted_key;
|
||||
bool old_project_changed;
|
||||
EffectKeyframe deleted_key;
|
||||
};
|
||||
|
||||
// a more modern version of the above, could probably replace it
|
||||
// assumes the keyframe already exists
|
||||
class KeyframeFieldSet : public QUndoCommand {
|
||||
class KeyframeFieldSet : public OliveAction {
|
||||
public:
|
||||
KeyframeFieldSet(EffectField* ifield, int ii);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectField* field;
|
||||
int index;
|
||||
EffectKeyframe key;
|
||||
bool done;
|
||||
bool old_project_changed;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class EffectFieldUndo : public QUndoCommand {
|
||||
class EffectFieldUndo : public OliveAction {
|
||||
public:
|
||||
EffectFieldUndo(EffectField* field);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectField* field;
|
||||
QVariant old_val;
|
||||
QVariant new_val;
|
||||
bool done;
|
||||
bool old_project_changed;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class SetAutoscaleAction : public QUndoCommand {
|
||||
class SetAutoscaleAction : public OliveAction {
|
||||
public:
|
||||
SetAutoscaleAction();
|
||||
void undo();
|
||||
void redo();
|
||||
QVector<Clip*> clips;
|
||||
private:
|
||||
bool old_project_changed;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<Clip*> clips;
|
||||
};
|
||||
|
||||
class AddMarkerAction : public QUndoCommand {
|
||||
class AddMarkerAction : public OliveAction {
|
||||
public:
|
||||
AddMarkerAction(QVector<Marker>* m, long t, QString n);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QVector<Marker>* active_array;
|
||||
long time;
|
||||
QString name;
|
||||
QString old_name;
|
||||
bool old_project_changed;
|
||||
QString old_name;
|
||||
int index;
|
||||
};
|
||||
|
||||
class MoveMarkerAction : public QUndoCommand {
|
||||
class MoveMarkerAction : public OliveAction {
|
||||
public:
|
||||
MoveMarkerAction(Marker* m, long o, long n);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Marker* marker;
|
||||
long old_time;
|
||||
long new_time;
|
||||
bool old_project_changed;
|
||||
long new_time;
|
||||
};
|
||||
|
||||
class DeleteMarkerAction : public QUndoCommand {
|
||||
class DeleteMarkerAction : public OliveAction {
|
||||
public:
|
||||
DeleteMarkerAction(QVector<Marker>* m);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<int> markers;
|
||||
private:
|
||||
QVector<Marker>* active_array;
|
||||
QVector<Marker> copies;
|
||||
bool sorted;
|
||||
bool old_project_changed;
|
||||
bool sorted;
|
||||
};
|
||||
|
||||
class SetSpeedAction : public QUndoCommand {
|
||||
class SetSpeedAction : public OliveAction {
|
||||
public:
|
||||
SetSpeedAction(Clip* c, double speed);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Clip* clip;
|
||||
double old_speed;
|
||||
double new_speed;
|
||||
bool old_project_changed;
|
||||
double new_speed;
|
||||
};
|
||||
|
||||
class SetBool : public QUndoCommand {
|
||||
class SetBool : public OliveAction {
|
||||
public:
|
||||
SetBool(bool* b, bool setting);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
bool* boolean;
|
||||
bool old_setting;
|
||||
bool new_setting;
|
||||
bool old_project_changed;
|
||||
bool new_setting;
|
||||
};
|
||||
|
||||
class SetSelectionsCommand : public QUndoCommand {
|
||||
class SetSelectionsCommand : public OliveAction {
|
||||
public:
|
||||
SetSelectionsCommand(Sequence *s);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
QVector<Selection> old_data;
|
||||
QVector<Selection> new_data;
|
||||
private:
|
||||
Sequence* seq;
|
||||
bool done;
|
||||
bool old_project_changed;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class SetEnableCommand : public QUndoCommand {
|
||||
public:
|
||||
SetEnableCommand(Clip* c, bool enable);
|
||||
void undo();
|
||||
void redo();
|
||||
private:
|
||||
Clip* clip;
|
||||
bool old_val;
|
||||
bool new_val;
|
||||
bool old_project_changed;
|
||||
};
|
||||
|
||||
class EditSequenceCommand : public QUndoCommand {
|
||||
class EditSequenceCommand : public OliveAction {
|
||||
public:
|
||||
EditSequenceCommand(Media *i, Sequence* s);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
void update();
|
||||
|
||||
QString name;
|
||||
@@ -483,8 +463,7 @@ public:
|
||||
int audio_layout;
|
||||
private:
|
||||
Media* item;
|
||||
Sequence* seq;
|
||||
bool old_project_changed;
|
||||
Sequence* seq;
|
||||
|
||||
QString old_name;
|
||||
int old_width;
|
||||
@@ -494,111 +473,103 @@ private:
|
||||
int old_audio_layout;
|
||||
};
|
||||
|
||||
class SetInt : public QUndoCommand {
|
||||
class SetInt : public OliveAction {
|
||||
public:
|
||||
SetInt(int* pointer, int new_value);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
int* p;
|
||||
int oldval;
|
||||
int newval;
|
||||
bool old_project_changed;
|
||||
int newval;
|
||||
};
|
||||
|
||||
class SetLong : public QUndoCommand {
|
||||
class SetLong : public OliveAction {
|
||||
public:
|
||||
SetLong(long* pointer, long old_value, long new_value);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
long* p;
|
||||
long oldval;
|
||||
long newval;
|
||||
bool old_project_changed;
|
||||
long newval;
|
||||
};
|
||||
|
||||
class SetDouble : public QUndoCommand {
|
||||
class SetDouble : public OliveAction {
|
||||
public:
|
||||
SetDouble(double* pointer, double old_value, double new_value);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
double* p;
|
||||
double oldval;
|
||||
double newval;
|
||||
bool old_project_changed;
|
||||
double newval;
|
||||
};
|
||||
|
||||
class SetString : public QUndoCommand {
|
||||
class SetString : public OliveAction {
|
||||
public:
|
||||
SetString(QString* pointer, QString new_value);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QString* p;
|
||||
QString oldval;
|
||||
QString newval;
|
||||
bool old_project_changed;
|
||||
QString newval;
|
||||
};
|
||||
|
||||
class CloseAllClipsCommand : public QUndoCommand {
|
||||
class CloseAllClipsCommand : public OliveAction {
|
||||
public:
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
};
|
||||
|
||||
class UpdateFootageTooltip : public QUndoCommand {
|
||||
class UpdateFootageTooltip : public OliveAction {
|
||||
public:
|
||||
UpdateFootageTooltip(Media* i);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* item;
|
||||
};
|
||||
|
||||
class MoveEffectCommand : public QUndoCommand {
|
||||
class MoveEffectCommand : public OliveAction {
|
||||
public:
|
||||
MoveEffectCommand();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
Clip* clip;
|
||||
int from;
|
||||
int to;
|
||||
private:
|
||||
bool old_project_changed;
|
||||
int to;
|
||||
};
|
||||
|
||||
class RemoveClipsFromClipboard : public QUndoCommand {
|
||||
class RemoveClipsFromClipboard : public OliveAction {
|
||||
public:
|
||||
RemoveClipsFromClipboard(int index);
|
||||
~RemoveClipsFromClipboard();
|
||||
void undo();
|
||||
void redo();
|
||||
virtual ~RemoveClipsFromClipboard() override;
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
int pos;
|
||||
Clip* clip;
|
||||
bool old_project_changed;
|
||||
Clip* clip;
|
||||
bool done;
|
||||
};
|
||||
|
||||
class RenameClipCommand : public QUndoCommand {
|
||||
class RenameClipCommand : public OliveAction {
|
||||
public:
|
||||
RenameClipCommand();
|
||||
QVector<Clip*> clips;
|
||||
QString new_name;
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QVector<QString> old_names;
|
||||
bool old_project_changed;
|
||||
QVector<QString> old_names;
|
||||
};
|
||||
|
||||
class SetPointer : public QUndoCommand {
|
||||
class SetPointer : public OliveAction {
|
||||
public:
|
||||
SetPointer(void** pointer, void* data);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
bool old_changed;
|
||||
void** p;
|
||||
@@ -606,53 +577,53 @@ private:
|
||||
void* old_data;
|
||||
};
|
||||
|
||||
class ReloadEffectsCommand : public QUndoCommand {
|
||||
class ReloadEffectsCommand : public OliveAction {
|
||||
public:
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
};
|
||||
|
||||
class SetQVariant : public QUndoCommand {
|
||||
class SetQVariant : public OliveAction {
|
||||
public:
|
||||
SetQVariant(QVariant* itarget, const QVariant& iold, const QVariant& inew);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
QVariant* target;
|
||||
QVariant old_val;
|
||||
QVariant new_val;
|
||||
};
|
||||
|
||||
class SetKeyframing : public QUndoCommand {
|
||||
class SetKeyframing : public OliveAction {
|
||||
public:
|
||||
SetKeyframing(EffectRow* irow, bool ib);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
EffectRow* row;
|
||||
bool b;
|
||||
};
|
||||
|
||||
class RefreshClips : public QUndoCommand {
|
||||
class RefreshClips : public OliveAction {
|
||||
public:
|
||||
RefreshClips(Media* m);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Media* media;
|
||||
};
|
||||
|
||||
class UpdateViewer : public QUndoCommand {
|
||||
class UpdateViewer : public OliveAction {
|
||||
public:
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
};
|
||||
|
||||
class SetEffectData : public QUndoCommand {
|
||||
class SetEffectData : public OliveAction {
|
||||
public:
|
||||
SetEffectData(Effect* e, const QByteArray &s);
|
||||
void undo();
|
||||
void redo();
|
||||
virtual void doUndo() override;
|
||||
virtual void doRedo() override;
|
||||
private:
|
||||
Effect* effect;
|
||||
QByteArray data;
|
||||
|
||||
+1
-1
@@ -8,5 +8,5 @@ CheckboxEx::CheckboxEx(QWidget* parent) : QCheckBox(parent) {
|
||||
|
||||
void CheckboxEx::checkbox_command() {
|
||||
CheckboxCommand* c = new CheckboxCommand(this);
|
||||
undo_stack.push(c);
|
||||
Olive::UndoStack.push(c);
|
||||
}
|
||||
|
||||
+3
-3
@@ -679,7 +679,7 @@ void GraphView::mouseMoveEvent(QMouseEvent *event) {
|
||||
|
||||
void GraphView::mouseReleaseEvent(QMouseEvent *) {
|
||||
if (click_add_proc) {
|
||||
undo_stack.push(new KeyframeFieldSet(click_add_field, click_add_key));
|
||||
Olive::UndoStack.push(new KeyframeFieldSet(click_add_field, click_add_key));
|
||||
} else if (moved_keys && selected_keys.size() > 0) {
|
||||
ComboAction* ca = new ComboAction();
|
||||
switch (current_handle) {
|
||||
@@ -701,7 +701,7 @@ void GraphView::mouseReleaseEvent(QMouseEvent *) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
}
|
||||
moved_keys = false;
|
||||
mousedown = false;
|
||||
@@ -772,7 +772,7 @@ void GraphView::set_selected_keyframe_type(int type) {
|
||||
EffectKeyframe& key = row->field(selected_keys_fields.at(i))->keyframes[selected_keys.at(i)];
|
||||
ca->append(new SetInt(&key.type, type));
|
||||
}
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
update_ui(false);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ void KeyframeView::menu_set_key_type(QAction* a) {
|
||||
EffectField* f = selected_fields.at(i);
|
||||
ca->append(new SetInt(&f->keyframes[selected_keyframes.at(i)].type, a->data().toInt()));
|
||||
}
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
update_ui(false);
|
||||
}
|
||||
}
|
||||
@@ -405,7 +405,7 @@ void KeyframeView::mouseReleaseEvent(QMouseEvent*) {
|
||||
selected_fields.at(i)->keyframes.at(selected_keyframes.at(i)).time
|
||||
));
|
||||
}
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
}
|
||||
|
||||
select_rect = false;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include "io/math.h"
|
||||
#include "io/config.h"
|
||||
#include "io/avtogl.h"
|
||||
|
||||
#include "panels/timeline.h"
|
||||
#include "panels/viewer.h"
|
||||
@@ -281,10 +280,10 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
|
||||
c->texture = new QOpenGLTexture(QOpenGLTexture::Target2D);
|
||||
c->texture->setSize(c->stream->codecpar->width, c->stream->codecpar->height);
|
||||
c->texture->setFormat(get_gl_tex_fmt_from_av(c->pix_fmt));
|
||||
c->texture->setFormat(QOpenGLTexture::RGBA8_UNorm);
|
||||
c->texture->setMipLevels(c->texture->maximumMipLevels());
|
||||
c->texture->setMinMagFilters(QOpenGLTexture::Linear, QOpenGLTexture::Linear);
|
||||
c->texture->allocateStorage(get_gl_pix_fmt_from_av(c->pix_fmt), QOpenGLTexture::UInt8);
|
||||
c->texture->allocateStorage(QOpenGLTexture::RGBA, QOpenGLTexture::UInt8);
|
||||
}
|
||||
|
||||
// retrieve video frame from cache and store it in c->texture
|
||||
@@ -304,7 +303,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
// create 3 fbos for nested sequences, 2 for most clips
|
||||
int fbo_count = (c->media != nullptr && c->media->get_type() == MEDIA_TYPE_SEQUENCE) ? 3 : 2;
|
||||
|
||||
c->fbo = new QOpenGLFramebufferObject* [fbo_count];
|
||||
c->fbo = new QOpenGLFramebufferObject* [size_t(fbo_count)];
|
||||
|
||||
for (int j=0;j<fbo_count;j++) {
|
||||
c->fbo[j] = new QOpenGLFramebufferObject(video_width, video_height);
|
||||
|
||||
@@ -217,6 +217,8 @@ void RenderThread::paint() {
|
||||
}
|
||||
|
||||
void RenderThread::start_render(QOpenGLContext *share, Sequence *s, const QString& save, GLvoid* pixels, int pixel_linesize, int idivider) {
|
||||
Q_UNUSED(idivider);
|
||||
|
||||
seq = s;
|
||||
|
||||
// stall any dependent actions
|
||||
|
||||
@@ -95,7 +95,7 @@ void TimelineHeader::set_in_point(long new_in) {
|
||||
new_out = viewer->seq->getEndFrame();
|
||||
}
|
||||
|
||||
undo_stack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
|
||||
Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
|
||||
update_parents();
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void TimelineHeader::set_out_point(long new_out) {
|
||||
new_in = 0;
|
||||
}
|
||||
|
||||
undo_stack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
|
||||
Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
|
||||
update_parents();
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ void TimelineHeader::mouseReleaseEvent(QMouseEvent*) {
|
||||
if (viewer->seq != nullptr) {
|
||||
dragging = false;
|
||||
if (resizing_workarea) {
|
||||
undo_stack.push(new SetTimelineInOutCommand(viewer->seq, true, temp_workarea_in, temp_workarea_out));
|
||||
Olive::UndoStack.push(new SetTimelineInOutCommand(viewer->seq, true, temp_workarea_in, temp_workarea_out));
|
||||
} else if (dragging_markers && selected_markers.size() > 0) {
|
||||
bool moved = false;
|
||||
ComboAction* ca = new ComboAction();
|
||||
@@ -272,7 +272,7 @@ void TimelineHeader::mouseReleaseEvent(QMouseEvent*) {
|
||||
}
|
||||
}
|
||||
if (moved) {
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
} else {
|
||||
delete ca;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ void TimelineHeader::delete_markers() {
|
||||
for (int i=0;i<selected_markers.size();i++) {
|
||||
dma->markers.append(selected_markers.at(i));
|
||||
}
|
||||
undo_stack.push(dma);
|
||||
Olive::UndoStack.push(dma);
|
||||
update_parents();
|
||||
}
|
||||
}
|
||||
@@ -418,7 +418,7 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
|
||||
}
|
||||
}
|
||||
|
||||
draw_marker(p, marker_x, yoff, height()-1, selected, false);
|
||||
draw_marker(p, marker_x, yoff, height()-1, selected);
|
||||
}
|
||||
|
||||
// draw playhead triangle
|
||||
|
||||
+22
-12
@@ -79,8 +79,8 @@ void TimelineWidget::show_context_menu(const QPoint& pos) {
|
||||
QAction* redoAction = menu.addAction(tr("&Redo"));
|
||||
connect(undoAction, SIGNAL(triggered(bool)), Olive::MainWindow, SLOT(undo()));
|
||||
connect(redoAction, SIGNAL(triggered(bool)), Olive::MainWindow, SLOT(redo()));
|
||||
undoAction->setEnabled(undo_stack.canUndo());
|
||||
redoAction->setEnabled(undo_stack.canRedo());
|
||||
undoAction->setEnabled(Olive::UndoStack.canUndo());
|
||||
redoAction->setEnabled(Olive::UndoStack.canRedo());
|
||||
menu.addSeparator();
|
||||
|
||||
// collect all the selected clips
|
||||
@@ -180,7 +180,7 @@ void TimelineWidget::toggle_autoscale() {
|
||||
}
|
||||
}
|
||||
if (action->clips.size() > 0) {
|
||||
undo_stack.push(action);
|
||||
Olive::UndoStack.push(action);
|
||||
} else {
|
||||
delete action;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ void TimelineWidget::rename_clip() {
|
||||
RenameClipCommand* rcc = new RenameClipCommand();
|
||||
rcc->new_name = s;
|
||||
rcc->clips = selected_clips;
|
||||
undo_stack.push(rcc);
|
||||
Olive::UndoStack.push(rcc);
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
@@ -302,7 +302,7 @@ void TimelineWidget::dragEnterEvent(QDragEnterEvent *event) {
|
||||
}
|
||||
|
||||
if (media_list.isEmpty()) {
|
||||
undo_stack.undo();
|
||||
Olive::UndoStack.undo();
|
||||
} else {
|
||||
import_init = true;
|
||||
panel_timeline->importing_files = true;
|
||||
@@ -369,7 +369,7 @@ void TimelineWidget::dragLeaveEvent(QDragLeaveEvent* event) {
|
||||
event->accept();
|
||||
if (panel_timeline->importing) {
|
||||
if (panel_timeline->importing_files) {
|
||||
undo_stack.undo();
|
||||
Olive::UndoStack.undo();
|
||||
}
|
||||
panel_timeline->importing_files = false;
|
||||
panel_timeline->ghosts.clear();
|
||||
@@ -496,7 +496,7 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
|
||||
panel_timeline->add_clips_from_ghosts(ca, s);
|
||||
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
|
||||
setFocus();
|
||||
|
||||
@@ -1133,7 +1133,7 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
}
|
||||
|
||||
if (push_undo) {
|
||||
undo_stack.push(ca);
|
||||
Olive::UndoStack.push(ca);
|
||||
} else {
|
||||
delete ca;
|
||||
}
|
||||
@@ -2257,7 +2257,7 @@ void draw_waveform(Clip* clip, const FootageStream* ms, long media_length, QPain
|
||||
int last_waveform_index = -1;
|
||||
|
||||
for (int i=waveform_start;i<waveform_limit;i++) {
|
||||
int waveform_index = qFloor((((clip->clip_in + ((double) i/zoom))/media_length) * ms->audio_preview.size())/divider)*divider;
|
||||
int waveform_index = qFloor((((clip->clip_in + (double(i)/zoom))/media_length) * ms->audio_preview.size())/divider)*divider;
|
||||
if (last_waveform_index < 0) last_waveform_index = waveform_index;
|
||||
|
||||
if (clip->reverse) {
|
||||
@@ -2455,13 +2455,23 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
space_for_thumb -= getScreenPointFromFrame(panel_timeline->zoom, clip->get_closing_transition()->get_true_length());
|
||||
}
|
||||
int thumb_height = clip_rect.height()-thumb_y;
|
||||
int thumb_width = (thumb_height*((double)ms->video_preview.width()/(double)ms->video_preview.height()));
|
||||
int thumb_width = qRound(thumb_height*(double(ms->video_preview.width())/double(ms->video_preview.height())));
|
||||
if (thumb_x + thumb_width >= 0
|
||||
&& thumb_height > thumb_y
|
||||
&& thumb_y + thumb_height >= 0
|
||||
&& space_for_thumb > MAX_TEXT_WIDTH) {
|
||||
int thumb_clip_width = qMin(thumb_width, space_for_thumb);
|
||||
p.drawImage(QRect(thumb_x, clip_rect.y()+thumb_y, thumb_clip_width, thumb_height), ms->video_preview, QRect(0, 0, thumb_clip_width*((double)ms->video_preview.width()/(double)thumb_width), ms->video_preview.height()));
|
||||
p.drawImage(QRect(thumb_x,
|
||||
clip_rect.y()+thumb_y,
|
||||
thumb_clip_width,
|
||||
thumb_height),
|
||||
ms->video_preview,
|
||||
QRect(0,
|
||||
0,
|
||||
qRound(thumb_clip_width*(double(ms->video_preview.width())/double(thumb_width))),
|
||||
ms->video_preview.height()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (clip->timeline_out - clip->timeline_in + clip->clip_in > clip->getMaximumLength()) {
|
||||
@@ -2526,7 +2536,7 @@ void TimelineWidget::paintEvent(QPaintEvent*) {
|
||||
long marker_time = m.frame + clip->timeline_in - clip->clip_in;
|
||||
int marker_x = panel_timeline->getTimelineScreenPointFromFrame(marker_time);
|
||||
if (marker_x > clip_rect.x() && marker_x < clip_rect.right()) {
|
||||
draw_marker(p, marker_x, clip_rect.bottom()-p.fontMetrics().height(), clip_rect.bottom(), false, false);
|
||||
draw_marker(p, marker_x, clip_rect.bottom()-p.fontMetrics().height(), clip_rect.bottom(), false);
|
||||
}
|
||||
}
|
||||
p.setBrush(Qt::NoBrush);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "project/undo.h"
|
||||
#include "project/media.h"
|
||||
#include "ui/viewercontainer.h"
|
||||
#include "io/avtogl.h"
|
||||
#include "ui/timelinewidget.h"
|
||||
#include "ui/renderfunctions.h"
|
||||
#include "ui/renderthread.h"
|
||||
|
||||
Reference in New Issue
Block a user