Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
DoubleField Class Reference

The DoubleField class. More...

#include <doublefield.h>

Inheritance diagram for DoubleField:
EffectField

Signals

void MaximumChanged (double maximum)
 Signal emitted when the field's maximum value has changed. More...
 
void MinimumChanged (double minimum)
 Signal emitted when the field's minimum value has changed. More...
 
- Signals inherited from EffectField
void Changed ()
 Changed signal. More...
 
void Clicked ()
 Clicked signal. More...
 
void EnabledChanged (bool)
 Enable change state signal. More...
 

Public Member Functions

 DoubleField (EffectRow *parent, const QString &id)
 Reimplementation of EffectField::EffectField(). More...
 
double GetDoubleAt (double timecode)
 Get double value at timecode. More...
 
void SetMinimum (double minimum)
 Sets the minimum allowed number for the user to set to minimum. More...
 
void SetMaximum (double maximum)
 Sets the maximum allowed number for the user to set to maximum. More...
 
void SetDefault (double d)
 Sets the default number for this field to d. More...
 
void SetDisplayType (LabelSlider::DisplayType type)
 Sets the UI display type to a member of LabelSlider::DisplayType. More...
 
void SetFrameRate (const double &rate)
 For a timecode-based display type, sets the frame rate to be used for the displayed timecode. More...
 
virtual QVariant ConvertStringToValue (const QString &s) override
 Reimplementation of EffectField::ConvertStringToValue() More...
 
virtual QString ConvertValueToString (const QVariant &v) override
 Reimplementation of EffectField::ConvertValueToString() More...
 
virtual QWidget * CreateWidget (QWidget *existing=nullptr) override
 Reimplementation of EffectField::CreateWidget() More...
 
virtual void UpdateWidgetValue (QWidget *widget, double timecode) override
 Reimplementation of EffectField::UpdateWidgetValue() More...
 
- Public Member Functions inherited from EffectField
 EffectField (EffectRow *parent, const QString &i, EffectFieldType t)
 EffectField Constructor. More...
 
EffectRowGetParentRow ()
 Get the EffectRow that this field is a member of. More...
 
const EffectFieldTypetype ()
 Get the type of data to expect from this field. More...
 
const QString & id ()
 Get the unique identifier of this field set in the constructor. More...
 
QVariant GetValueAt (double timecode)
 Get the value of this field at a given timecode. More...
 
void SetValueAt (double time, const QVariant &value)
 Set the value of this field at a given timecode. More...
 
double Now ()
 Get the current clip/media time. More...
 
void PrepareDataForKeyframing (bool enabled, ComboAction *ca)
 Set up keyframing on this field. More...
 
int GetColumnSpan ()
 Get field's column span. More...
 
void SetColumnSpan (int i)
 Set field's column span. More...
 
double GetValidKeyframeHandlePosition (int key, bool post)
 Get the correct X position/time value of a bezier keyframe's handles. More...
 
bool IsEnabled ()
 Return whether this field is enabled or not. More...
 
void SetEnabled (bool e)
 Set the enabled state of this field. More...
 

Private Slots

void ValueHasBeenSet ()
 Connected to EffectField::Changed() to ensure value_set_ gets set to TRUE whenever a value is set on this field. More...
 
void UpdateFromWidget (double d)
 Internal function connected to any QWidget made from CreateWidget() to update the value based on user input. More...
 

Private Attributes

double min_
 Internal minimum value. More...
 
double max_
 Internal maximum value. More...
 
double default_
 Internal default value. More...
 
LabelSlider::DisplayType display_type_
 Internal display type value. More...
 
double frame_rate_
 Internal frame rate value. More...
 
bool value_set_
 Internal value used to allow SetDefault() to set the value as well if none has been set. More...
 
KeyframeDataChangekdc_
 An internal KeyframeDataChange undoable command. More...
 

Additional Inherited Members

- Public Types inherited from EffectField
enum  EffectFieldType {
  EFFECT_FIELD_DOUBLE, EFFECT_FIELD_COLOR, EFFECT_FIELD_STRING, EFFECT_FIELD_BOOL,
  EFFECT_FIELD_COMBO, EFFECT_FIELD_FONT, EFFECT_FIELD_FILE, EFFECT_FIELD_UI
}
 The EffectFieldType enum. More...
 
- Public Attributes inherited from EffectField
QVariant persistent_data_
 Persistent data object. More...
 
QVector< EffectKeyframekeyframes
 Keyframe array. More...
 

Detailed Description

The DoubleField class.

An EffectField derivative the produces number values (integer or floating-point) and uses a LabelSlider as its visual representation.

Constructor & Destructor Documentation

DoubleField::DoubleField ( EffectRow parent,
const QString &  id 
)

Reimplementation of EffectField::EffectField().

Member Function Documentation

QVariant DoubleField::ConvertStringToValue ( const QString &  s)
overridevirtual

Reimplementation of EffectField::ConvertStringToValue()

Reimplemented from EffectField.

QString DoubleField::ConvertValueToString ( const QVariant &  v)
overridevirtual

Reimplementation of EffectField::ConvertValueToString()

Reimplemented from EffectField.

QWidget * DoubleField::CreateWidget ( QWidget *  existing = nullptr)
overridevirtual

Reimplementation of EffectField::CreateWidget()

Creates and connects to a LabelSlider.

Implements EffectField.

double DoubleField::GetDoubleAt ( double  timecode)

Get double value at timecode.

Convenience function. Equivalent to GetValueAt().toDouble()

Parameters
timecodeTimecode to retrieve value at
Returns

Double value at the set timecode

void DoubleField::MaximumChanged ( double  maximum)
signal

Signal emitted when the field's maximum value has changed.

This signal gets connected to any LabelSlider created from CreateWidget() so the maximum value is always synchronized between them.

Note: A connection is not made both ways as you should never manipulate a UI object created from an EffectField directly. Always access data through the EffectField itself.

See Also
SetMaximum()
Parameters
maximumThe new maximum value.
void DoubleField::MinimumChanged ( double  minimum)
signal

Signal emitted when the field's minimum value has changed.

This signal gets connected to any LabelSlider created from CreateWidget() so the minimum value is always synchronized between them.

Note: A connection is not made both ways as you should never manipulate a UI object created from an EffectField directly. Always access data through the EffectField itself.

See Also
SetMinimum()
Parameters
minimumThe new minimum value.
void DoubleField::SetDefault ( double  d)

Sets the default number for this field to d.

void DoubleField::SetDisplayType ( LabelSlider::DisplayType  type)

Sets the UI display type to a member of LabelSlider::DisplayType.

void DoubleField::SetFrameRate ( const double &  rate)

For a timecode-based display type, sets the frame rate to be used for the displayed timecode.

See Also
SetDisplayType() and LabelSlider::SetFrameRate().
void DoubleField::SetMaximum ( double  maximum)

Sets the maximum allowed number for the user to set to maximum.

void DoubleField::SetMinimum ( double  minimum)

Sets the minimum allowed number for the user to set to minimum.

void DoubleField::UpdateFromWidget ( double  d)
privateslot

Internal function connected to any QWidget made from CreateWidget() to update the value based on user input.

Parameters
bThe current number value of the QWidget (LabelSlider in this case). Automatically set when this slot is connected to the LabelSlider::valueChanged() signal.
void DoubleField::UpdateWidgetValue ( QWidget *  widget,
double  timecode 
)
overridevirtual

Reimplementation of EffectField::UpdateWidgetValue()

Reimplemented from EffectField.

void DoubleField::ValueHasBeenSet ( )
privateslot

Connected to EffectField::Changed() to ensure value_set_ gets set to TRUE whenever a value is set on this field.

Member Data Documentation

double DoubleField::default_
private

Internal default value.

See Also
SetDefault().
LabelSlider::DisplayType DoubleField::display_type_
private

Internal display type value.

See Also
SetDisplayType().
double DoubleField::frame_rate_
private

Internal frame rate value.

See Also
SetFrameRate().
KeyframeDataChange* DoubleField::kdc_
private

An internal KeyframeDataChange undoable command.

This is stored to allow for the value to be changed by dragging without every single "step" being pushed to the undo stack. Instead an undo command can be created at the start of a drag, and then pushed at the end to make it one single undoable action.

double DoubleField::max_
private

Internal maximum value.

See Also
SetMaximum().
double DoubleField::min_
private

Internal minimum value.

See Also
SetMinimum().
bool DoubleField::value_set_
private

Internal value used to allow SetDefault() to set the value as well if none has been set.

Initialized to FALSE, then set to TRUE indefinitely whenever the value gets set on this field.


The documentation for this class was generated from the following files: