Merge branch 'master' into hashremoval
This commit is contained in:
@@ -226,7 +226,10 @@ bool KeyframeView::Paste(std::function<Node *(const QString &)> find_node_functi
|
|||||||
|
|
||||||
if (node_with_id) {
|
if (node_with_id) {
|
||||||
for (NodeKeyframe *key : it.value()) {
|
for (NodeKeyframe *key : it.value()) {
|
||||||
key->set_time(key->time() - min);
|
// Adjust sequence time to node's time
|
||||||
|
rational t = key->time() - min;
|
||||||
|
t = GetAdjustedTime(GetTimeTarget(), node_with_id, t, true);
|
||||||
|
key->set_time(t);
|
||||||
|
|
||||||
if (NodeKeyframe *existing = node_with_id->GetKeyframeAtTimeOnTrack(key->input(), key->time(), key->track(), key->element())) {
|
if (NodeKeyframe *existing = node_with_id->GetKeyframeAtTimeOnTrack(key->input(), key->time(), key->track(), key->element())) {
|
||||||
command->add_child(new NodeParamRemoveKeyframeCommand(existing));
|
command->add_child(new NodeParamRemoveKeyframeCommand(existing));
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ ViewerDisplayWidget::ViewerDisplayWidget(QWidget *parent) :
|
|||||||
show_fps_(false),
|
show_fps_(false),
|
||||||
frames_skipped_(0),
|
frames_skipped_(0),
|
||||||
show_widget_background_(false),
|
show_widget_background_(false),
|
||||||
|
playback_speed_(0),
|
||||||
push_mode_(kPushNull),
|
push_mode_(kPushNull),
|
||||||
add_band_(nullptr),
|
add_band_(nullptr),
|
||||||
queue_starved_(false)
|
queue_starved_(false)
|
||||||
@@ -882,6 +883,7 @@ void ViewerDisplayWidget::RequestStartEditingText()
|
|||||||
void ViewerDisplayWidget::Play(const int64_t &start_timestamp, const int &playback_speed, const rational &timebase)
|
void ViewerDisplayWidget::Play(const int64_t &start_timestamp, const int &playback_speed, const rational &timebase)
|
||||||
{
|
{
|
||||||
playback_timebase_ = timebase;
|
playback_timebase_ = timebase;
|
||||||
|
playback_speed_ = playback_speed;
|
||||||
|
|
||||||
timer_.Start(start_timestamp, playback_speed, timebase.toDouble());
|
timer_.Start(start_timestamp, playback_speed, timebase.toDouble());
|
||||||
|
|
||||||
@@ -924,7 +926,7 @@ void ViewerDisplayWidget::UpdateFromQueue()
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} else if (pf.timestamp > time) {
|
} else if ((pf.timestamp > time) == (playback_speed_ > 0)) {
|
||||||
|
|
||||||
// The next frame in the queue is too new, so just do a regular update. Either the
|
// The next frame in the queue is too new, so just do a regular update. Either the
|
||||||
// frame we want will arrive in time, or we'll just have to skip it.
|
// frame we want will arrive in time, or we'll just have to skip it.
|
||||||
|
|||||||
@@ -360,6 +360,8 @@ private:
|
|||||||
|
|
||||||
QVariant load_frame_;
|
QVariant load_frame_;
|
||||||
|
|
||||||
|
int playback_speed_;
|
||||||
|
|
||||||
enum PushMode {
|
enum PushMode {
|
||||||
/// New frame to push to internal texture
|
/// New frame to push to internal texture
|
||||||
kPushFrame,
|
kPushFrame,
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
if (this->empty() || (this->back().timestamp < f.timestamp) == (playback_speed > 0)) {
|
if (this->empty() || (this->back().timestamp < f.timestamp) == (playback_speed > 0)) {
|
||||||
this->push_back(f);
|
this->push_back(f);
|
||||||
} else {
|
} else {
|
||||||
for (iterator i=this->begin(); i!=this->end(); i++) {
|
for (auto i=this->begin(); i!=this->end(); i++) {
|
||||||
if ((i->timestamp > f.timestamp) == (playback_speed > 0)) {
|
if ((i->timestamp > f.timestamp) == (playback_speed > 0)) {
|
||||||
this->insert(i, f);
|
this->insert(i, f);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user