Merge branch 'master' of https://github.com/olive-editor/olive into project_icons
This commit is contained in:
@@ -41,7 +41,6 @@ EffectControls::EffectControls(QWidget *parent) :
|
||||
|
||||
setup_ui();
|
||||
|
||||
init_effects();
|
||||
clear_effects(false);
|
||||
headers->viewer = panel_sequence_viewer;
|
||||
headers->snapping = false;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QUndoCommand>
|
||||
#include <QMutex>
|
||||
|
||||
struct Clip;
|
||||
class QMenu;
|
||||
@@ -50,6 +51,8 @@ public:
|
||||
|
||||
ResizableScrollBar* horizontalScrollBar;
|
||||
QScrollBar* verticalScrollBar;
|
||||
|
||||
QMutex effects_loaded;
|
||||
public slots:
|
||||
void update_keyframes();
|
||||
private slots:
|
||||
|
||||
@@ -152,6 +152,7 @@ void alloc_panels(QWidget* parent) {
|
||||
panel_project = new Project(parent);
|
||||
panel_project->setObjectName("proj_root");
|
||||
panel_effect_controls = new EffectControls(parent);
|
||||
init_effects();
|
||||
panel_effect_controls->setObjectName("fx_controls");
|
||||
panel_timeline = new Timeline(parent);
|
||||
panel_timeline->setObjectName("timeline");
|
||||
|
||||
+44
-12
@@ -248,11 +248,19 @@ void Viewer::seek(long p) {
|
||||
}
|
||||
|
||||
void Viewer::go_to_start() {
|
||||
if (seq != NULL) seek(0);
|
||||
}
|
||||
|
||||
void Viewer::go_to_end() {
|
||||
if (seq != NULL) seek(seq->getEndFrame());
|
||||
}
|
||||
|
||||
void Viewer::go_to_in() {
|
||||
if (seq != NULL) {
|
||||
if (seq->using_workarea && seq->playhead != seq->workarea_in) {
|
||||
if (seq->using_workarea) {
|
||||
seek(seq->workarea_in);
|
||||
} else {
|
||||
seek(0);
|
||||
go_to_start();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -265,12 +273,12 @@ void Viewer::next_frame() {
|
||||
if (seq != NULL) seek(seq->playhead+1);
|
||||
}
|
||||
|
||||
void Viewer::go_to_end() {
|
||||
void Viewer::go_to_out() {
|
||||
if (seq != NULL) {
|
||||
if (seq->using_workarea && seq->playhead != seq->workarea_out) {
|
||||
if (seq->using_workarea) {
|
||||
seek(seq->workarea_out);
|
||||
} else {
|
||||
seek(seq->getEndFrame());
|
||||
go_to_end();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,6 +315,12 @@ void Viewer::play() {
|
||||
if (panel_footage_viewer->playing) panel_footage_viewer->pause();
|
||||
|
||||
if (seq != NULL) {
|
||||
if (!is_recording_cued()
|
||||
&& seq->playhead >= get_seq_out()
|
||||
&& (config.loop || !main_sequence)) {
|
||||
seek(get_seq_in());
|
||||
}
|
||||
|
||||
reset_all_audio();
|
||||
if (is_recording_cued() && !start_recording()) {
|
||||
dout << "[ERROR] Failed to record audio";
|
||||
@@ -455,6 +469,18 @@ void Viewer::set_sb_max() {
|
||||
headers->set_scrollbar_max(horizontal_bar, seq->getEndFrame(), headers->width());
|
||||
}
|
||||
|
||||
long Viewer::get_seq_in() {
|
||||
return (seq->using_workarea)
|
||||
? seq->workarea_in
|
||||
: 0;
|
||||
}
|
||||
|
||||
long Viewer::get_seq_out() {
|
||||
return (seq->using_workarea && previous_playhead < seq->workarea_out)
|
||||
? seq->workarea_out
|
||||
: seq->getEndFrame();
|
||||
}
|
||||
|
||||
void Viewer::setup_ui() {
|
||||
QWidget* contents = new QWidget();
|
||||
|
||||
@@ -499,7 +525,7 @@ void Viewer::setup_ui() {
|
||||
goToStartIcon.addFile(QStringLiteral(":/icons/prev.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
goToStartIcon.addFile(QStringLiteral(":/icons/prev-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
btnSkipToStart->setIcon(goToStartIcon);
|
||||
connect(btnSkipToStart, SIGNAL(clicked(bool)), this, SLOT(go_to_start()));
|
||||
connect(btnSkipToStart, SIGNAL(clicked(bool)), this, SLOT(go_to_in()));
|
||||
playback_control_layout->addWidget(btnSkipToStart);
|
||||
|
||||
btnRewind = new QPushButton(playback_controls);
|
||||
@@ -530,7 +556,7 @@ void Viewer::setup_ui() {
|
||||
nextIcon.addFile(QStringLiteral(":/icons/next.png"), QSize(), QIcon::Normal, QIcon::Off);
|
||||
nextIcon.addFile(QStringLiteral(":/icons/next-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off);
|
||||
btnSkipToEnd->setIcon(nextIcon);
|
||||
connect(btnSkipToEnd, SIGNAL(clicked(bool)), this, SLOT(go_to_end()));
|
||||
connect(btnSkipToEnd, SIGNAL(clicked(bool)), this, SLOT(go_to_out()));
|
||||
playback_control_layout->addWidget(btnSkipToEnd);
|
||||
|
||||
lower_control_layout->addWidget(playback_controls);
|
||||
@@ -637,17 +663,23 @@ void Viewer::update_playhead() {
|
||||
}
|
||||
|
||||
void Viewer::timer_update() {
|
||||
long previous_playhead = seq->playhead;
|
||||
previous_playhead = seq->playhead;
|
||||
|
||||
seq->playhead = qRound(playhead_start + ((QDateTime::currentMSecsSinceEpoch()-start_msecs) * 0.001 * seq->frame_rate));
|
||||
update_parents();
|
||||
|
||||
long end_frame = (seq->using_workarea && previous_playhead < seq->workarea_out) ? seq->workarea_out : seq->getEndFrame();
|
||||
if ((!recording
|
||||
long end_frame = get_seq_out();
|
||||
if (!recording
|
||||
&& playing
|
||||
&& seq->playhead >= end_frame
|
||||
&& previous_playhead < end_frame)
|
||||
|| (recording && recording_start != recording_end && seq->playhead >= recording_end)) {
|
||||
&& previous_playhead < end_frame) {
|
||||
if (!config.pause_at_out_point && config.loop) {
|
||||
seek(get_seq_in());
|
||||
play();
|
||||
} else if (config.pause_at_out_point || !main_sequence) {
|
||||
pause();
|
||||
}
|
||||
} else if (recording && recording_start != recording_end && seq->playhead >= recording_end) {
|
||||
pause();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,9 +72,11 @@ public:
|
||||
public slots:
|
||||
void play_wake();
|
||||
void go_to_start();
|
||||
void go_to_in();
|
||||
void previous_frame();
|
||||
void toggle_play();
|
||||
void next_frame();
|
||||
void go_to_out();
|
||||
void go_to_end();
|
||||
|
||||
private slots:
|
||||
@@ -94,6 +96,9 @@ private:
|
||||
void set_zoom_value(double d);
|
||||
void set_sb_max();
|
||||
|
||||
long get_seq_in();
|
||||
long get_seq_out();
|
||||
|
||||
QIcon playIcon;
|
||||
|
||||
void setup_ui();
|
||||
@@ -112,6 +117,8 @@ private:
|
||||
|
||||
bool cue_recording_internal;
|
||||
QTimer recording_flasher;
|
||||
|
||||
long previous_playhead;
|
||||
};
|
||||
|
||||
#endif // VIEWER_H
|
||||
|
||||
Reference in New Issue
Block a user