Navigation
Unreal Engine C++ API Reference > Runtime > TimeManagement
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
Type | Name | Description | |
---|---|---|---|
FFrameNumberInterface
(
const TAttribute< EFrameNumberDisplayFormats >& InDisplayFormatAttr, |
Functions
Type | Name | Description | |
---|---|---|---|
void | |||
FString | Gets the string suffix used when a stringified value represents a time between whole frames. | ||
void | SetSubframeIndicator
(
const FString& InSubframeIndicator |
Sets the string suffix to use when a stringified value represents a time between whole frames. |
Overridden from INumericTypeInterface
Type | Name | Description | |
---|---|---|---|
TOptional< double > | FromString
(
const FString& InString, |
||
int32 | |||
int32 | Gets the minimum and maximum fractional digits. | ||
FOnSettingChanged * | Optional callback to broadcast when a setting in the type interface changes | ||
bool | IsCharacterValid
(
TCHAR InChar |
Check whether the typed character is valid | |
void | SetMaxFractionalDigits
(
const TAttribute< TOptional< int32 >>& NewValue |
||
void | SetMinFractionalDigits
(
const TAttribute< TOptional< int32 >>& NewValue |
Sets the minimum and maximum fractional digits - A minimum greater than 0 will always have that many trailing zeros | |
FString | ToString
(
const double& Value |
Convert the type to/from a string |