further improvements
This commit is contained in:
+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