LIDL Soundboard  1.9.0
A simple soundboard, yet better than EXP Soundboard forsenE
SfxSettingsWidget Class Reference

#include <SfxSettingsWidget.h>

Inheritance diagram for SfxSettingsWidget:
Inheritance graph
Collaboration diagram for SfxSettingsWidget:
Collaboration graph

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
 

Constructor & Destructor Documentation

◆ SfxSettingsWidget() [1/2]

SfxSettingsWidget::SfxSettingsWidget ( QWidget *  parent = nullptr)
explicit

SfxSettingsWidget Default constructor.

Sets widget and QScrollArea properties to achieve A E S T H E T I C purposes.

Parameters
parent

References _container, and _layout.

◆ SfxSettingsWidget() [2/2]

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.

Parameters
sfxNameThe sfx name. Will add a label and a checkbox for enabling/disabling purposes. \pztzm type LIDL Sfx type, used for the presets.
parenteShrug.

References _checkbox, _comboBox, _layout, _presetBox, _sliders, _type, checkBoxStateChanged(), LIDL::PresetController::GetInstance(), and LIDL::NONE.

Here is the call graph for this function:

Member Function Documentation

◆ addComboBox()

void SfxSettingsWidget::addComboBox ( QString  label,
QStringList  values,
int  enumValue = -1 
)

addComboBox Add a combo box to the widget.

Parameters
labelThe label shown along the combobox.
valuesString List of possible values.

References _comboBox, _layout, _specialMap, and comboBoxValueChanged().

Referenced by PresetWizardIntroPage::addWidgets(), and WrapperProperties::WrapperProperties().

Here is the caller graph for this function:

◆ addSlider()

void SfxSettingsWidget::addSlider ( QString  label = "",
int  min = 0,
int  max = 100,
QString  suffix = "",
int  specialValue = -1,
QString  prefix = "" 
)

addSlider

Parameters
labelThe label to be shown alongside the slider+spinbox.
minThe minimum value.
maxThe maximum value.
suffixThe suffix of the spinbox.
prefixThe prefix of the spinbox.

References _layout, _sliders, _specialMap, sliderValueChanged(), and SliderSpin::valueChanged().

Referenced by PresetWizardIntroPage::addWidgets(), and WrapperProperties::WrapperProperties().

Here is the caller graph for this function:

◆ addSpacer()

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

Here is the caller graph for this function:

◆ checkBoxStateChanged

void SfxSettingsWidget::checkBoxStateChanged ( bool  newState)
signal

checkBoxStateChanged Emitted when checkbox is toggled.

Parameters
newStateThe new state of the checkbox.

Referenced by WrapperProperties::setUpConnection(), and SfxSettingsWidget().

Here is the caller graph for this function:

◆ comboBoxValueChanged

void SfxSettingsWidget::comboBoxValueChanged ( int  comboBoxIndex,
int  newIndex,
int  enumValue 
)
signal

comboBoxValueChanged Emitted when a combo box text has changed.

Parameters
comboBoxIndexThe index of the combobox in the _comboBox array.
newIndexThe new index of the displayed text.
enumValueThe index of the settings in the enumeration (EnumsAndStruct.h).

Referenced by addComboBox(), and WrapperProperties::setUpConnection().

Here is the caller graph for this function:

◆ deactivateAll()

void SfxSettingsWidget::deactivateAll ( )

deactivateAll Deactivates all widgets except the checkbox.

References _comboBox, _presetBox, and _sliders.

Referenced by WrapperProperties::setUpConnection().

Here is the caller graph for this function:

◆ getSFXAsMap()

std::map< int, int > SfxSettingsWidget::getSFXAsMap ( ) const

getSFXAsStructure Returns the SFX structure associated with the widget

getSFXAsMap.

Returns
The sfx enumeration along side the value of the parameter.

References _specialMap.

Referenced by PresetWizardIntroPage::finished().

Here is the caller graph for this function:

◆ getValueOfEnumParam()

int SfxSettingsWidget::getValueOfEnumParam ( int  enumValue) const

getValueOfEnumParam Get the value of a widget item settings.

Parameters
enumValueThe int representing the enum value (EnumsAndStructs.h)
Returns

References _specialMap.

◆ setCheckboxState()

void SfxSettingsWidget::setCheckboxState ( bool  state)

setCheckboxState Set this widget checkbox checked state.

Parameters
stateThe new state of the check box (checked is true, unchecked is false).

References _checkbox.

Referenced by WrapperProperties::setUpConnection().

Here is the caller graph for this function:

◆ setComboBoxIndex()

void SfxSettingsWidget::setComboBoxIndex ( int  comboIndex,
int  newItemIndex 
)

setComboBoxIndex Set a combobox's displayed item.

Parameters
comboIndexWhich combobox to update.
newItemIndexThe index of the new item to be displayed.

References _comboBox.

◆ setSliderValue()

void SfxSettingsWidget::setSliderValue ( int  sliderIndex,
int  newValue 
)

setSliderValue Set a slider's value.

Parameters
sliderIndexWhich slider to update.
newValueThe slider new value.

References _sliders.

◆ setValueOfEnumParam()

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.

Parameters
enumValueThe int representing the enum value (EnumsAndStructs.h).
newValueThe new value.

References _specialMap.

Referenced by PresetWizardIntroPage::presetBoxIndexChanged(), and WrapperProperties::setUpConnection().

Here is the caller graph for this function:

◆ sizeHint()

QSize SfxSettingsWidget::sizeHint ( ) const

sizeHint Reimplemented to account for the QScrollArea so that the spoiler doesn't make a mess.

Returns
The size hint.

◆ sliderValueChanged

void SfxSettingsWidget::sliderValueChanged ( int  sliderIndex,
int  newValue,
int  specialValue 
)
signal

sliderValueChanged Emitted when a slider's value changed.

Parameters
sliderIndexThe index of the slider in the _sliders array.
newValueThe new value.
specialValueThe index of the settings in the enumeration (EnumsAndStruct.h).

Referenced by addSlider(), and WrapperProperties::setUpConnection().

Here is the caller graph for this function:

Member Data Documentation

◆ _checkbox

QCheckBox* SfxSettingsWidget::_checkbox
private

Enable/disable Checkbox

Referenced by setCheckboxState(), and SfxSettingsWidget().

◆ _comboBox

QVector<QComboBox *> SfxSettingsWidget::_comboBox
private

Array of comboBox

Referenced by addComboBox(), deactivateAll(), setComboBoxIndex(), and SfxSettingsWidget().

◆ _container

QWidget* SfxSettingsWidget::_container
private

The container widget.

Referenced by SfxSettingsWidget().

◆ _layout

QGridLayout* SfxSettingsWidget::_layout
private

The layout.

Referenced by addComboBox(), addSlider(), addSpacer(), and SfxSettingsWidget().

◆ _presetBox

QComboBox* SfxSettingsWidget::_presetBox
private

Combox box displaying the differents presets available

Referenced by deactivateAll(), and SfxSettingsWidget().

◆ _sliders

QVector<SliderSpin *> SfxSettingsWidget::_sliders
private

Array of Sliders + Spinboxes

Referenced by addSlider(), deactivateAll(), setSliderValue(), and SfxSettingsWidget().

◆ _specialMap

std::map<int, QWidget* > SfxSettingsWidget::_specialMap
private

Map linking which widgets deals with witch settings (enum)

Referenced by addComboBox(), addSlider(), getSFXAsMap(), getValueOfEnumParam(), and setValueOfEnumParam().

◆ _type

LIDL::SFX_TYPE SfxSettingsWidget::_type
private

The lidl sfx type this widget is displaying.

Referenced by SfxSettingsWidget().


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