![]() |
LIDL Soundboard
1.9.0
A simple soundboard, yet better than EXP Soundboard forsenE
|
#include <SfxSettingsWidget.h>
Signals | |
void | sliderValueChanged (int sliderIndex, int newValue, int specialValue) |
sliderValueChanged Emitted when a slider's value changed. More... | |
void | comboBoxValueChanged (int comboBoxIndex, int newIndex, int enumValue) |
comboBoxValueChanged Emitted when a combo box text has changed. More... | |
void | checkBoxStateChanged (bool newState) |
checkBoxStateChanged Emitted when checkbox is toggled. More... | |
Public Member Functions | |
SfxSettingsWidget (QWidget *parent=nullptr) | |
SfxSettingsWidget Default constructor. More... | |
SfxSettingsWidget (QString sfxName, LIDL::SFX_TYPE type=LIDL::SFX_TYPE::NONE, bool showCheckmarkAndPresets=true, QWidget *parent=nullptr) | |
SfxSettingsWidget Overloaded constructor to account for SFX name. More... | |
void | addSlider (QString label="", int min=0, int max=100, QString suffix="", int specialValue=-1, QString prefix="") |
addSlider More... | |
void | addComboBox (QString label, QStringList values, int enumValue=-1) |
addComboBox Add a combo box to the widget. More... | |
void | setSliderValue (int sliderIndex, int newValue) |
setSliderValue Set a slider's value. More... | |
void | setComboBoxIndex (int comboIndex, int newItemIndex) |
setComboBoxIndex Set a combobox's displayed item. More... | |
void | setValueOfEnumParam (int enumValue, int newValue) |
setValueOfEnumParam Will set the value of a widget item settings. More... | |
int | getValueOfEnumParam (int enumValue) const |
getValueOfEnumParam Get the value of a widget item settings. More... | |
void | setCheckboxState (bool state) |
setCheckboxState Set this widget checkbox checked state. More... | |
void | deactivateAll () |
deactivateAll Deactivates all widgets except the checkbox. More... | |
void | addSpacer () |
addSpacer Add a spacer to the layout so that every one have the same line height. More... | |
QSize | sizeHint () const |
sizeHint Reimplemented to account for the QScrollArea so that the spoiler doesn't make a mess. More... | |
std::map< int, int > | getSFXAsMap () const |
getSFXAsStructure Returns the SFX structure associated with the widget More... | |
Private Attributes | |
QWidget * | _container |
QCheckBox * | _checkbox |
QGridLayout * | _layout |
QVector< SliderSpin * > | _sliders |
QVector< QComboBox * > | _comboBox |
std::map< int, QWidget * > | _specialMap |
QComboBox * | _presetBox |
LIDL::SFX_TYPE | _type |
|
explicit |
SfxSettingsWidget Default constructor.
Sets widget and QScrollArea properties to achieve A E S T H E T I C purposes.
parent |
References _container, and _layout.
SfxSettingsWidget::SfxSettingsWidget | ( | QString | sfxName, |
LIDL::SFX_TYPE | type = LIDL::SFX_TYPE::NONE , |
||
bool | showCheckmarkAndPresets = true , |
||
QWidget * | parent = nullptr |
||
) |
SfxSettingsWidget Overloaded constructor to account for SFX name.
sfxName | The sfx name. Will add a label and a checkbox for enabling/disabling purposes. \pztzm type LIDL Sfx type, used for the presets. |
parent | eShrug. |
References _checkbox, _comboBox, _layout, _presetBox, _sliders, _type, checkBoxStateChanged(), LIDL::PresetController::GetInstance(), and LIDL::NONE.
void SfxSettingsWidget::addComboBox | ( | QString | label, |
QStringList | values, | ||
int | enumValue = -1 |
||
) |
addComboBox Add a combo box to the widget.
label | The label shown along the combobox. |
values | String List of possible values. |
References _comboBox, _layout, _specialMap, and comboBoxValueChanged().
Referenced by PresetWizardIntroPage::addWidgets(), and WrapperProperties::WrapperProperties().
void SfxSettingsWidget::addSlider | ( | QString | label = "" , |
int | min = 0 , |
||
int | max = 100 , |
||
QString | suffix = "" , |
||
int | specialValue = -1 , |
||
QString | prefix = "" |
||
) |
addSlider
label | The label to be shown alongside the slider+spinbox. |
min | The minimum value. |
max | The maximum value. |
suffix | The suffix of the spinbox. |
prefix | The prefix of the spinbox. |
References _layout, _sliders, _specialMap, sliderValueChanged(), and SliderSpin::valueChanged().
Referenced by PresetWizardIntroPage::addWidgets(), and WrapperProperties::WrapperProperties().
void SfxSettingsWidget::addSpacer | ( | ) |
addSpacer Add a spacer to the layout so that every one have the same line height.
References _layout.
Referenced by PresetWizardIntroPage::addWidgets().
|
signal |
checkBoxStateChanged Emitted when checkbox is toggled.
newState | The new state of the checkbox. |
Referenced by WrapperProperties::setUpConnection(), and SfxSettingsWidget().
|
signal |
comboBoxValueChanged Emitted when a combo box text has changed.
comboBoxIndex | The index of the combobox in the _comboBox array. |
newIndex | The new index of the displayed text. |
enumValue | The index of the settings in the enumeration (EnumsAndStruct.h). |
Referenced by addComboBox(), and WrapperProperties::setUpConnection().
void SfxSettingsWidget::deactivateAll | ( | ) |
deactivateAll Deactivates all widgets except the checkbox.
References _comboBox, _presetBox, and _sliders.
Referenced by WrapperProperties::setUpConnection().
std::map< int, int > SfxSettingsWidget::getSFXAsMap | ( | ) | const |
getSFXAsStructure Returns the SFX structure associated with the widget
getSFXAsMap.
References _specialMap.
Referenced by PresetWizardIntroPage::finished().
int SfxSettingsWidget::getValueOfEnumParam | ( | int | enumValue | ) | const |
getValueOfEnumParam Get the value of a widget item settings.
enumValue | The int representing the enum value (EnumsAndStructs.h) |
References _specialMap.
void SfxSettingsWidget::setCheckboxState | ( | bool | state | ) |
setCheckboxState Set this widget checkbox checked state.
state | The new state of the check box (checked is true, unchecked is false). |
References _checkbox.
Referenced by WrapperProperties::setUpConnection().
void SfxSettingsWidget::setComboBoxIndex | ( | int | comboIndex, |
int | newItemIndex | ||
) |
setComboBoxIndex Set a combobox's displayed item.
comboIndex | Which combobox to update. |
newItemIndex | The index of the new item to be displayed. |
References _comboBox.
void SfxSettingsWidget::setSliderValue | ( | int | sliderIndex, |
int | newValue | ||
) |
setSliderValue Set a slider's value.
sliderIndex | Which slider to update. |
newValue | The slider new value. |
References _sliders.
void SfxSettingsWidget::setValueOfEnumParam | ( | int | enumValue, |
int | newValue | ||
) |
setValueOfEnumParam Will set the value of a widget item settings.
Will look through the std::map associating the int corresponding to the enum parameter, and a pointer to the widget that deals with it.
enumValue | The int representing the enum value (EnumsAndStructs.h). |
newValue | The new value. |
References _specialMap.
Referenced by PresetWizardIntroPage::presetBoxIndexChanged(), and WrapperProperties::setUpConnection().
QSize SfxSettingsWidget::sizeHint | ( | ) | const |
sizeHint Reimplemented to account for the QScrollArea so that the spoiler doesn't make a mess.
|
signal |
sliderValueChanged Emitted when a slider's value changed.
sliderIndex | The index of the slider in the _sliders array. |
newValue | The new value. |
specialValue | The index of the settings in the enumeration (EnumsAndStruct.h). |
Referenced by addSlider(), and WrapperProperties::setUpConnection().
|
private |
Enable/disable Checkbox
Referenced by setCheckboxState(), and SfxSettingsWidget().
|
private |
Array of comboBox
Referenced by addComboBox(), deactivateAll(), setComboBoxIndex(), and SfxSettingsWidget().
|
private |
The container widget.
Referenced by SfxSettingsWidget().
|
private |
The layout.
Referenced by addComboBox(), addSlider(), addSpacer(), and SfxSettingsWidget().
|
private |
Combox box displaying the differents presets available
Referenced by deactivateAll(), and SfxSettingsWidget().
|
private |
Array of Sliders + Spinboxes
Referenced by addSlider(), deactivateAll(), setSliderValue(), and SfxSettingsWidget().
|
private |
Map linking which widgets deals with witch settings (enum)
Referenced by addComboBox(), addSlider(), getSFXAsMap(), getValueOfEnumParam(), and setValueOfEnumParam().
|
private |
The lidl sfx type this widget is displaying.
Referenced by SfxSettingsWidget().