#include <effectrow.h>
Public Slots | |
void | GoToPreviousKeyframe () |
Go to previous keyframe. More... | |
void | ToggleKeyframe () |
Toggle a keyframe at this point in time. More... | |
void | GoToNextKeyframe () |
Go to next keyframe. More... | |
void | FocusRow () |
Slot for whenever this EffectRow is focused. More... | |
Signals | |
void | KeyframingSetChanged (bool) |
Keyframing setting changed signal. More... | |
Public Member Functions | |
EffectRow (Effect *parent, const QString &n, bool savable=true, bool keyframable=true) | |
EffectRow Constructor. More... | |
void | AddField (EffectField *Field) |
Add a field to this row. More... | |
EffectField * | Field (int i) |
Retrieve the EffectField at this index. Must be less than FieldCount(). More... | |
int | FieldCount () |
Number of fields currently contained in this row. More... | |
void | SetKeyframeOnAllFields (ComboAction *ca) |
Set a keyframe at the current playhead on all fields contained within this row. More... | |
Effect * | GetParentEffect () |
Get parent Effect. More... | |
const QString & | name () |
Return the row's name. More... | |
bool | IsKeyframing () |
Get whether this row is keyframing or not. More... | |
void | SetKeyframingInternal (bool) |
Set whether this row is keyframing or not. More... | |
bool | IsSavable () |
Get whether this row should be saved into a project file or not. More... | |
bool | IsKeyframable () |
Get whether this row can be keyframed or not. More... | |
Private Slots | |
void | SetKeyframingEnabled (bool) |
Set keyframing enabled state. More... | |
Private Attributes | |
QString | name_ |
Internal variable for the row's name. More... | |
bool | keyframable_ |
Internal variable for whether this row can be keyframed. More... | |
bool | keyframing_ |
Internal variable for whether this row is currently keyframing. More... | |
bool | savable_ |
Internal variable for whether this row should be saved. More... | |
QVector< EffectField * > | fields_ |
Internal array of EffectField objects. More... | |
The EffectRow class.
Primarily a way of grouping EffectField objects together. As UI objects, Effects are largely formatted as a table and you can think of EffectRows as the rows of the table and EffectFields as the columns.
Within Olive, keyframing is enabled on the EffectRow (rather than individual EffectFields) so all attached fields will be keyframed together.
Unlike EffectField, there's no reason to derive from EffectRow as it's simply a container of fields and a few keyframe functions.
EffectRow::EffectRow | ( | Effect * | parent, |
const QString & | n, | ||
bool | savable = true , |
||
bool | keyframable = true |
||
) |
EffectRow Constructor.
parent | Every EffectRow object must be attached to a valid Effect object. The Effect object takes ownership of the EffectRow and automatically frees it through the QObject parent/child system. EffectRows are never intended to change parents throughout their lifetimes. |
n | Row name. This is not used as an internal identifier, it's just for the user interface, so it can be translated with no issue. |
savable | Whether the fields in this row should be saved to the project file. This is true by default. If the row contains non-value UI widgets, setting this to false is recommended. |
keyframable | Whether keyframing can be enabled on this row or not. This is true by default. Some values you may want to prevent the user from keyframing (e.g. the filename of a VST plugin), which can be done by setting this to false. |
void EffectRow::AddField | ( | EffectField * | Field | ) |
Add a field to this row.
Ownership of the EffectField is transferred to this row and the row will free its memory. In the Effect's UI, this will add the field to an additional column.
Field | The field to add to this row. |
EffectField * EffectRow::Field | ( | int | i | ) |
Retrieve the EffectField at this index. Must be less than FieldCount().
i | Index to retrieve the EffectField at. |
EffectField at the provided index.
int EffectRow::FieldCount | ( | ) |
Number of fields currently contained in this row.
|
slot |
Slot for whenever this EffectRow is focused.
Connect UI objects gaining focus to this slot. Automatically updates the Graph Editor to attach to this row.
Effect * EffectRow::GetParentEffect | ( | ) |
|
slot |
Go to next keyframe.
Gets the closest keyframe after the current playhead and seeks to it.
Attach to KeyframeNavigator::goto_next_key() signal.
|
slot |
Go to previous keyframe.
Gets the closest keyframe prior to the current playhead and seeks to it.
Attach to KeyframeNavigator::goto_previous_key() signal.
bool EffectRow::IsKeyframable | ( | ) |
Get whether this row can be keyframed or not.
bool EffectRow::IsKeyframing | ( | ) |
Get whether this row is keyframing or not.
bool EffectRow::IsSavable | ( | ) |
Get whether this row should be saved into a project file or not.
|
signal |
Keyframing setting changed signal.
Emitted whenever keyframing is enabled or disabled.
True | if keyframing was enabled, false if keyframing was disabled. |
const QString & EffectRow::name | ( | ) |
Return the row's name.
void EffectRow::SetKeyframeOnAllFields | ( | ComboAction * | ca | ) |
Set a keyframe at the current playhead on all fields contained within this row.
ca | The ComboAction to add this action to. This may not be nullptr. |
|
privateslot |
Set keyframing enabled state.
A user-friendly function for enabling or disabling keyframes on this row. Preferred to SetKeyframingInternal() for any user-initiated change. Automatically creates an undoable action so users can undo the enabling/disabling. Also confirms with the user when disabling keyframing whether they wish to continue and remove all the current keyframes.
Attach to KeyframeNavigator::keyframe_enabled_changed() signal.
void EffectRow::SetKeyframingInternal | ( | bool | b | ) |
Set whether this row is keyframing or not.
It's not recommended to use this function for any user-initiated keyframe setting change as it doesn't create any undoable actions. Use SetKeyframingEnabled() instead for a user-friendly variant.
|
slot |
Toggle a keyframe at this point in time.
Either deletes (if any child EffectFields have any keyframes here) or creates (if none do) a keyframe on all EffectField children at the current time.
Attach to KeyframeNavigator::toggle_key() signal.
|
private |
Internal array of EffectField objects.
It is not necessary to delete the elements in this array as they're already children of this QObject, so they'll get freed automatically.
|
private |
Internal variable for whether this row can be keyframed.
Set in the constructor, retrieved with IsKeyframable().
|
private |
Internal variable for whether this row is currently keyframing.
Set by SetKeyframingInternal() and retrieved with IsKeyframing().
|
private |
Internal variable for the row's name.
Set in the constructor, retrieved with name().
|
private |
Internal variable for whether this row should be saved.
Set in the constructor, retrieved with IsSavable().