#include <effectui.h>
Signals | |
void | CutRequested () |
Cut signal. More... | |
void | CopyRequested () |
Copy signal. More... | |
![]() | |
void | deselect_others (QWidget *) |
void | visibleChanged (bool) |
Public Member Functions | |
EffectUI (Effect *e) | |
EffectUI Constructor. More... | |
void | AddAdditionalEffect (Effect *e) |
Attach additional effects to this UI. More... | |
Effect * | GetEffect () |
Get the primary Effect that this UI object was created for. More... | |
int | GetRowY (int row, QWidget *mapToWidget) |
Get the Y position of a given row. More... | |
void | UpdateFromEffect () |
Update widgets with the current Effect's values. More... | |
bool | IsAttachedToClip (Clip *c) |
Check if a given Clip has an Effect referenced by this EffectUI. More... | |
![]() | |
CollapsibleWidget (QWidget *parent=nullptr) | |
void | SetContents (QWidget *c) |
QString | Title () |
void | SetTitle (const QString &) |
bool | IsFocused () |
bool | IsExpanded () |
void | SetExpanded (bool s) |
bool | IsSelected () |
Private Slots | |
void | show_context_menu (const QPoint &) |
Slot for titlebar's right-click signal to show a context menu for extra Effect functions. More... | |
Private Member Functions | |
QWidget * | Widget (int row, int field) |
Retrieve the QWidget corresponding a specific EffectField. More... | |
void | AttachKeyframeNavigationToRow (EffectRow *row, KeyframeNavigator *nav) |
Attach a KeyframeNavigator object to an EffectRow. More... | |
Private Attributes | |
Effect * | effect_ |
Internal reference to the Effect this object was constructed around. More... | |
QVector< Effect * > | additional_effects_ |
Internal array of additional Effect objects attached to this UI. More... | |
QGridLayout * | layout_ |
Layout for UI widgets. More... | |
QVector< QVector< QWidget * > > | widgets_ |
Grid array of QWidgets corresponding to the Effect's rows and fields. More... | |
QVector< QLabel * > | labels_ |
Array of QLabel objects corresponding to each row's name(). More... | |
QVector< KeyframeNavigator * > | keyframe_navigators_ |
Array of KeyframeNavigator objects corresponding to each row. More... | |
Additional Inherited Members | |
![]() | |
void | header_click (bool s, bool deselect) |
![]() | |
QCheckBox * | enabled_check |
CollapsibleWidgetHeader * | title_bar |
QWidget * | contents |
The EffectUI class.
EffectUI is a complete QWidget-based representation of an Effect that can be added to any Qt layout. It overrides CollapsibleWidget (meaning the Effect can be collapsed to just a titlebar to save space). The titlebar is automatically set to the Effect's name and the contents are composed of a grid layout (QGridLayout) corresponding to the Effect's EffectRow and EffectField children.
Many EffectUIs can be created from a single Effect, and many Effects can be attached to a single EffectUI (provided the Effects are all the same type). Neither gains ownership of each other and deleting an EffectUI without any other work is perfectly safe (deleting an Effect with an open EffectUI however, is not).
EffectUI::EffectUI | ( | Effect * | e | ) |
void EffectUI::AddAdditionalEffect | ( | Effect * | e | ) |
Attach additional effects to this UI.
Olive allows users to modify several effects (of the same type) with one UI representation. To do this, you can add any amount of extra Effect objects using this function and the UI will attach all of its UI functions to that Effect as well without creating any new QWidgets.
e | The Effect to add to this UI object. |
|
private |
Attach a KeyframeNavigator object to an EffectRow.
Internal function for connecting a KeyframeNavigator UI object to an EffectRow.
row | The EffectRow object. |
nav | The KeyframeNavigator object. |
|
signal |
Copy signal.
Emitted when the user selects Copy from the right-click context menu.
|
signal |
Cut signal.
Emitted when the user selects Cut from the right-click context menu.
Effect * EffectUI::GetEffect | ( | ) |
int EffectUI::GetRowY | ( | int | row, |
QWidget * | mapToWidget | ||
) |
Get the Y position of a given row.
Retrieve the on-screen Y position of the attached Effect's EffectRow at a given index. This is primarily used for displaying UI elements that align with the the row's on-screen widgets (e.g. keyframes in the EffectControls panel).
The Y value provided is specifically the center point of the row's name label. It gets mapped to a provided QWidget object so it can be used locally by that QWidget without further modification.
row | The index of the EffectRow to retrieve the Y position of. |
mapToWidget | The widget to map the Y value to. |
The row's Y position.
bool EffectUI::IsAttachedToClip | ( | Clip * | c | ) |
Check if a given Clip has an Effect referenced by this EffectUI.
Olive allows users to modify several effects (of the same type) with one UI representation. The behavior is if multiple clips are selected that have effects of the same type, all those Effects can be modified by the same EffectUI object. However this behavior is undesirable if a single Clip has more than one of the same type of Effect (e.g. two or more blurs). In this scenario, the user will most likely expect two separate UI objects for each of these effects individually, rather than consolidating them into one UI object.
To address this, EffectControls will check this function to determine if this EffectUI already references an Effect of this type from this Clip. If it does, it's assumed a new EffectUI should be made rather than consolidating that Effect into the same EffectUI.
c | The Clip to determine whether an Effect of this type is already referenced by this EffectUI. |
True is an Effect from this Clip is already attached to this EffectUI.
|
privateslot |
Slot for titlebar's right-click signal to show a context menu for extra Effect functions.
void EffectUI::UpdateFromEffect | ( | ) |
Update widgets with the current Effect's values.
When the Timeline playhead moves, the current values in the Effect might change if its fields are keyframed. In order to visually update these values on the UI, this function should be called. It will loop through all fields of all attached effects and update them to the value at the current Timeline playhead.
Currently this function is called by update_ui() which is also responsible for updating other parts of the UI like the Timeline and Viewer so they all get updated together.
|
private |
Retrieve the QWidget corresponding a specific EffectField.
Convenience function equivalent to widgets_.at(row).at(field).
row | EffectRow index to retrieve field QWidget from |
field | EffectField index to retrieve QWidget from |
The QWidget at this row and field index.
|
private |
Internal array of additional Effect objects attached to this UI.
|
private |
Internal reference to the Effect this object was constructed around.
|
private |
Array of KeyframeNavigator objects corresponding to each row.
|
private |
Array of QLabel objects corresponding to each row's name().
|
private |
Layout for UI widgets.
|
private |
Grid array of QWidgets corresponding to the Effect's rows and fields.