Files
oak-editor/app/dialog/speedduration/speedduration.h
T
itsmattkc b308f753b3 with Block::set_length_and_* functions, keep the speeds correct
With differently set speeds, these functions would mess with the timing in ways
that would be confusing to the user. Now they act in a much more intuitive way
and also prevent negative media times.
2019-12-19 02:26:30 +11:00

48 lines
1.1 KiB
C++

#ifndef SPEEDDURATIONDIALOG_H
#define SPEEDDURATIONDIALOG_H
#include <QCheckBox>
#include <QDialog>
#include <QUndoCommand>
#include "node/block/clip/clip.h"
#include "node/output/track/track.h"
#include "widget/slider/floatslider.h"
#include "widget/slider/timeslider.h"
class SpeedDurationDialog : public QDialog
{
Q_OBJECT
public:
SpeedDurationDialog(const rational& timebase, const QList<ClipBlock*>& clips, QWidget* parent = nullptr);
public slots:
virtual void accept() override;
private:
double GetUnadjustedLengthTimestamp(ClipBlock* clip) const;
int64_t GetAdjustedDuration(ClipBlock* clip, const double& new_speed) const;
double GetAdjustedSpeed(ClipBlock* clip, const int64_t& new_duration) const;
QList<ClipBlock*> clips_;
FloatSlider* speed_slider_;
TimeSlider* duration_slider_;
rational timebase_;
QCheckBox* link_speed_and_duration_;
QCheckBox* reverse_speed_checkbox_;
QCheckBox* maintain_audio_pitch_checkbox_;
QCheckBox* ripple_clips_checkbox_;
private slots:
void SpeedChanged();
void DurationChanged();
};
#endif // SPEEDDURATIONDIALOG_H