speeddurdialog now sets speed correctly

This commit is contained in:
itsmattkc
2021-08-01 13:34:42 -07:00
parent b20a839332
commit c36efddf86
6 changed files with 211 additions and 19 deletions
+2 -14
View File
@@ -22,7 +22,6 @@
#include "core.h"
#include "common/timecodefunctions.h"
#include "dialog/speedduration/speeddurationdialog.h"
#include "panel/panelmanager.h"
#include "panel/timeline/timeline.h"
#include "window/mainwindow/mainwindow.h"
@@ -47,7 +46,7 @@ MenuShared::MenuShared()
edit_delete_item_ = Menu::CreateItem(this, "delete", this, &MenuShared::DeleteSelectedTriggered, "Del");
edit_ripple_delete_item_ = Menu::CreateItem(this, "rippledelete", this, &MenuShared::RippleDeleteTriggered, "Shift+Del");
edit_split_item_ = Menu::CreateItem(this, "split", this, &MenuShared::SplitAtPlayheadTriggered, "Ctrl+K");
edit_speedduration_item_ = Menu::CreateItem(this, "speeddur", this, &MenuShared::SpeedDurationTriggered);
edit_speedduration_item_ = Menu::CreateItem(this, "speeddur", this, &MenuShared::SpeedDurationTriggered, "Ctrl+R");
// "In/Out" menu shared items
inout_set_in_item_ = Menu::CreateItem(this, "setinpoint", this, &MenuShared::SetInTriggered, "I");
@@ -310,18 +309,7 @@ void MenuShared::SpeedDurationTriggered()
TimelinePanel* timeline = PanelManager::instance()->MostRecentlyFocused<TimelinePanel>();
if (timeline) {
QVector<Block*> sel = timeline->GetSelectedBlocks();
QVector<ClipBlock*> clips;
foreach (Block *b, sel) {
ClipBlock *c = dynamic_cast<ClipBlock*>(b);
if (c) {
clips.append(c);
}
}
SpeedDurationDialog sdd(clips, Core::instance()->main_window());
sdd.exec();
timeline->ShowSpeedDurationDialogForSelectedClips();
}
}
@@ -30,6 +30,7 @@
#include "common/timecodefunctions.h"
#include "dialog/nodeproperties/nodepropertiesdialog.h"
#include "dialog/sequence/sequence.h"
#include "dialog/speedduration/speeddurationdialog.h"
#include "node/block/transition/transition.h"
#include "tool/add.h"
#include "tool/beam.h"
@@ -738,6 +739,23 @@ void TimelineWidget::NudgeRight()
}
}
void TimelineWidget::ShowSpeedDurationDialogForSelectedClips()
{
QVector<ClipBlock*> clips;
foreach (Block *b, selected_blocks_) {
ClipBlock *c = dynamic_cast<ClipBlock*>(b);
if (c) {
clips.append(c);
}
}
if (!clips.isEmpty()) {
SpeedDurationDialog sdd(clips, timebase(), this);
sdd.exec();
}
}
void TimelineWidget::InsertGapsAt(const rational &earliest_point, const rational &insert_length, MultiUndoCommand *command)
{
for (int i=0;i<Track::kCount;i++) {
@@ -95,6 +95,8 @@ public:
void NudgeRight();
void ShowSpeedDurationDialogForSelectedClips();
/**
* @brief Timelines should always be connected to sequences
*/