FFrameNumberInterface

A large portion of the SequencerUI is built around using SpinBox and NumericBox because the framerate used to be stored in (float) seconds.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

INumericTypeInterface

FFrameNumberInterface

References

Module

TimeManagement

Header

/Engine/Source/Runtime/TimeManagement/Public/FrameNumberNumericInterface.h

Include

#include "FrameNumberNumericInterface.h"

Syntax

struct FFrameNumberInterface : public INumericTypeInterface< double >

Remarks

A large portion of the SequencerUI is built around using SpinBox and NumericBox because the framerate used to be stored in (float) seconds. This creates a convenient UI as it allows the users to type in numbers (for frames or seconds), or to drag the mouse to change the time. When Sequencer was converted to using integer based frames and frame rates (expressed as numerator/denominator) the spinbox-based UI became an issue as SpinBox and NumericBox internally convert to a double to perform various calculations. This is an issue if your Spinbox type (ie: FQualifiedFrameTime) is not implicitly convertible to double, which the new Sequencer types are not (due to accidental type coercion when using outside the UI).

To solve this, the Spinboxes will still use double as their type, but double now means frame number and not time. A double can store the entire range of int32 (which backs FFrameNumber) without precision loss, and we can execute callbacks to find out what framerate the sequence is running at. This allows us to display in Timecode, Time or Frames and convert back and forth to double for the UI, and from double into the backing FFrameNumber for the sequence.

Constructors

Name Description

Public function

FFrameNumberInterface

(
    const TAttribute< EFrameNumberDispl...,
    const TAttribute< uint8 >& InOnGet...,
    const TAttribute< FFrameRate >& In...,
    const TAttribute< FFrameRate >& In...
)

Overridden from INumericTypeInterface

Name Description

Public function Virtual

TOptional< d...

 

FromString

(
    const FString& InString,
    const double& InExistingValue
)

Public function Virtual Const

int32

 

GetMaxFractionalDigits()

Public function Virtual Const

int32

 

GetMinFractionalDigits()

Gets the minimum and maximum fractional digits.

Public function Virtual Const

bool

 

IsCharacterValid

(
    TCHAR InChar
)

Check whether the typed character is valid

Public function Virtual

void

 

SetMaxFractionalDigits

(
    const TAttribute< TOptional< int32 ...
)

Public function Virtual

void

 

SetMinFractionalDigits

(
    const TAttribute< TOptional< int32 ...
)

Sets the minimum and maximum fractional digits - A minimum greater than 0 will always have that many trailing zeros

Public function Virtual Const

FString

 

ToString

(
    const double& Value
)

Convert the type to/from a string