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

The EffectRow class. More...

#include <effectrow.h>

Inheritance diagram for EffectRow:

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...
 
EffectFieldField (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...
 
EffectGetParentEffect ()
 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

EffectRow::EffectRow ( Effect parent,
const QString &  n,
bool  savable = true,
bool  keyframable = true 
)

EffectRow Constructor.

Parameters
parentEvery 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.
nRow name. This is not used as an internal identifier, it's just for the user interface, so it can be translated with no issue.
savableWhether 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.
keyframableWhether 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.

Member Function Documentation

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.

Parameters
FieldThe field to add to this row.
EffectField * EffectRow::Field ( int  i)

Retrieve the EffectField at this index. Must be less than FieldCount().

Parameters
iIndex to retrieve the EffectField at.
Returns

EffectField at the provided index.

int EffectRow::FieldCount ( )

Number of fields currently contained in this row.

Returns
The number of fields currently contained in this row as an integer. Any field index (retrieved with Field()) is guaranteed to be valid >= 0 and < FieldCount().
void EffectRow::FocusRow ( )
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 ( )

Get parent Effect.

Equivalent to static_cast<Effect*>(parent()).

Returns
The parent Effect object that this row is attached to.
void EffectRow::GoToNextKeyframe ( )
slot

Go to next keyframe.

Gets the closest keyframe after the current playhead and seeks to it.

Attach to KeyframeNavigator::goto_next_key() signal.

void EffectRow::GoToPreviousKeyframe ( )
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.

Returns
True if this row can be keyframed. This value is set in the constructor.
bool EffectRow::IsKeyframing ( )

Get whether this row is keyframing or not.

Returns
True if this row is keyframing.
bool EffectRow::IsSavable ( )

Get whether this row should be saved into a project file or not.

Returns
True if this row should be saved. This value is set in the constructor.
void EffectRow::KeyframingSetChanged ( bool  )
signal

Keyframing setting changed signal.

Emitted whenever keyframing is enabled or disabled.

Parameters
Trueif keyframing was enabled, false if keyframing was disabled.
const QString & EffectRow::name ( )

Return the row's name.

Returns
The name specified in the constructor as a QString
void EffectRow::SetKeyframeOnAllFields ( ComboAction ca)

Set a keyframe at the current playhead on all fields contained within this row.

Parameters
caThe ComboAction to add this action to. This may not be nullptr.
void EffectRow::SetKeyframingEnabled ( bool  enabled)
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.

void EffectRow::ToggleKeyframe ( )
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.

Member Data Documentation

QVector<EffectField*> EffectRow::fields_
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.

bool EffectRow::keyframable_
private

Internal variable for whether this row can be keyframed.

Set in the constructor, retrieved with IsKeyframable().

bool EffectRow::keyframing_
private

Internal variable for whether this row is currently keyframing.

Set by SetKeyframingInternal() and retrieved with IsKeyframing().

QString EffectRow::name_
private

Internal variable for the row's name.

Set in the constructor, retrieved with name().

bool EffectRow::savable_
private

Internal variable for whether this row should be saved.

Set in the constructor, retrieved with IsSavable().


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