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

Inherits QWidget. More...

#include <wrapperproperties.h>

Inheritance diagram for WrapperProperties:
Inheritance graph
Collaboration diagram for WrapperProperties:
Collaboration graph

Public Slots

void AddSound ()
 AddSound method. More...
 
void AddSoundFromUrl ()
 AddSoundFromUrl method. More...
 
void AddSoundFromDrop (QString)
 AddSoundFromDrop. More...
 
void ItemWasClicked (QListWidgetItem *item)
 ItemWasClicked deals with connecting every slider and spinbox to the selected sound. More...
 
void RadioPressed (int id)
 RadioPressed sets the wrapper playback mode whenever radio is pressed. More...
 
void SetKeySequence (QKeySequence)
 SetKeySequence Sets the key sequence of the line edit. More...
 
void SetItemMainVolume (int newValue)
 SetItemMainVolume Sets a sound item main volume. More...
 
void SetItemVACVolume (int newValue)
 SetItemVACVolume Sets a sound item VAC volume. More...
 

Signals

void signalAddDone (std::shared_ptr< SoundWrapper > sound)
 The signal that is sent when adding a new wrapper. More...
 
void signalEditDone (std::shared_ptr< SoundWrapper > sound)
 The signal that is sent after editing an existing wrapper. More...
 
void closed ()
 This signal is emitted whenever the Sound Entry Editor window is closed. More...
 

Public Member Functions

 WrapperProperties (int mainOutput, int VACOutput, SoundWrapper *sound=nullptr, QWidget *parent=nullptr)
 Constructor of the "Sound Entry Editor" UI. More...
 

Private Member Functions

 WrapperProperties (QWidget *parent=nullptr)
 Default constructor, private because we only need the populated one. More...
 
void closeEvent (QCloseEvent *event)
 Reimplemented to send a closed signal to the mainUI, so we can re-enable the widgets. More...
 
template<LIDL::SFX_TYPE Type, class Param >
void setUpConnection (SfxSettingsWidget *widget)
 Set the connection of all the widgets (sliders,combo boxes etc), contained in the widget. More...
 

Private Attributes

CustomListWidget_soundListDisplay
 
QLabel * _soundListHint
 
QPushButton * _btnAdd
 
QPushButton * _btnAddFromURL
 
QPushButton * _btnDelete
 
CustomListWidgetItem_selectedItem
 
QVBoxLayout * _vLayout
 
QGridLayout * _gLayout
 
QGroupBox * _radioGroupBox
 
QButtonGroup * _radioGroup
 
QHBoxLayout * _radioLayout
 
QRadioButton * _radioSequential
 
QRadioButton * _radioAuto
 
QRadioButton * _radioCancer
 
QRadioButton * _radioAutoLoop
 
QGroupBox * _shortcutGroup
 
QGridLayout * _shortcutLayout
 
CustomShortcutEdit_shortcutEdit
 
QKeySequence * _shortcutSequence
 
QPushButton * _shortcutResetBtn
 
QLabel * _shortcutHint
 
QLabel * _shortcutWarning
 
QPushButton * _btnDone
 
QPushButton * _btnAbort
 
LIDL::Playback _playBackMode
 
int _mainOutput
 
int _VACOutput
 
Spoiler_sliderSpoiler
 
QGroupBox * _sliderGroup
 
QGridLayout * _sliderLayout
 
QSlider * _sliderMain
 
QSpinBox * _sliderMainSpin
 
QLabel * _sliderLabelMain
 
QSlider * _sliderVAC
 
QSpinBox * _sliderVACSpin
 
QLabel * _sliderLabelVAC
 
QButtonGroup * _sfxBtnGroup
 
Spoiler_sfxSpoiler
 
QGridLayout * _sfxLayout
 
QTabWidget * _sfxTabWidget
 
SfxSettingsWidget_distortionWidget
 
SfxSettingsWidget_chorusWidget
 
SfxSettingsWidget_echoWidget
 
SfxSettingsWidget_compressorWidget
 
SfxSettingsWidget_flangerWidget
 
SfxSettingsWidget_gargleWidget
 

Detailed Description

Inherits QWidget.

WrapperProperties class deals with displaying a soundwrapper's data in order to edit them. It displays a UI that allows to add local and remote files to a wrapper as well as delete them. Each sound can be assigned several sound effects, main output volume, and VAC output volume.

Removed pointers to main UI and replaced several functions and connections by lambdas in both this file and soundboardmainUI.

Author
Devolution
Version
1.7.0

Constructor & Destructor Documentation

◆ WrapperProperties() [1/2]

WrapperProperties::WrapperProperties ( int  mainOutput,
int  VACOutput,
SoundWrapper sound = nullptr,
QWidget *  parent = nullptr 
)

Constructor of the "Sound Entry Editor" UI.

Will construct a blank window, to be populated, or not, by a wrapper, by calling the private default constructor

The UI will either be blank or populated by the SoundWrapper to be edited. The function will check for SoundWrapper being nullptr. If it is, nothing is to be done, the Entry Editor will created a new wrapper. If it isn't, then we opened a wrapper. Several steps are then done: Iterating through the wrapper to display the files inside it, with their SFX and volume. Disconnect the "Done!" button from its connection, and connect it to the relevant function. (SendEditedWrapper)

Parameters
mainOutputThe index of the main output device.
VACOutputThe index of the VAC output device.
soundA pointer to the sound being edited.

References _btnDone, _mainOutput, _playBackMode, _radioAuto, _radioAutoLoop, _radioCancer, _radioSequential, _shortcutEdit, _shortcutSequence, _soundListDisplay, _VACOutput, LIDL::Auto, LIDL::AutoLoop, LIDL::Cancer, SoundWrapper::getKeySequence(), CustomListWidgetItem::getMainVolume(), SoundWrapper::getPlayMode(), CustomListWidgetItem::getSFX(), SoundWrapper::getShortcutVirtualKey(), CustomListWidgetItem::getSize(), SoundWrapper::getSoundList(), CustomListWidgetItem::getVacVolume(), CustomShortcutEdit::getVirtualKey(), LIDL::Sequential, CustomShortcutEdit::setVirtualKey(), signalAddDone(), signalEditDone(), and LIDL::Singleton.

Here is the call graph for this function:

◆ WrapperProperties() [2/2]

WrapperProperties::WrapperProperties ( QWidget *  parent = nullptr)
explicitprivate

Default constructor, private because we only need the populated one.

Will construct a blank window, to be populated, or not, by a wrapper. This constructor is only called by the initialization list of the public constructor.

Parameters
parentA pointer to the parent (default is nullptr);

References _btnAbort, _btnAdd, _btnAddFromURL, _btnDelete, _btnDone, _chorusWidget, _compressorWidget, _distortionWidget, _echoWidget, _flangerWidget, _gargleWidget, _gLayout, _playBackMode, _radioAuto, _radioAutoLoop, _radioCancer, _radioGroup, _radioGroupBox, _radioLayout, _radioSequential, _selectedItem, _sfxLayout, _sfxSpoiler, _sfxTabWidget, _shortcutEdit, _shortcutGroup, _shortcutHint, _shortcutLayout, _shortcutResetBtn, _shortcutSequence, _shortcutWarning, _sliderLabelMain, _sliderLabelVAC, _sliderLayout, _sliderMain, _sliderMainSpin, _sliderSpoiler, _sliderVAC, _sliderVACSpin, _soundListDisplay, _soundListHint, _vLayout, SfxSettingsWidget::addComboBox(), SfxSettingsWidget::addSlider(), AddSound(), AddSoundFromDrop(), AddSoundFromUrl(), LIDL::CHORUS, Spoiler::Close(), LIDL::COMPRESSOR, LIDL::DISTORTION, LIDL::dwRateHz, LIDL::dwWaveShape, LIDL::ECHO, LIDL::fAttack, LIDL::fDelay, LIDL::fDepth, LIDL::fEdge, LIDL::fFeedback, LIDL::fFrequency, LIDL::fGain, CustomListWidget::fileDragged(), LIDL::FLANGER, LIDL::fLeftDelay, LIDL::fPostEQBandwidth, LIDL::fPostEQCenterFrequency, LIDL::fPredelay, LIDL::fPreLowpassCutoff, LIDL::fRatio, LIDL::fRelease, LIDL::fRightDelay, LIDL::fThreshold, LIDL::fWetDryMix, LIDL::GARGLE, LIDL::Controller::SettingsController::GetInstance(), CustomShortcutEdit::getText(), ItemWasClicked(), CustomShortcutEdit::keyPressed(), LIDL::lPanDelay, LIDL::lPhase, LIDL::lWaveform, Spoiler::Opened(), RadioPressed(), LIDL::Sequential, Spoiler::setContentLayout(), LIDL::Controller::SettingsController::setEditing(), and SetKeySequence().

Here is the call graph for this function:

Member Function Documentation

◆ AddSound

void WrapperProperties::AddSound ( )
slot

AddSound method.

Connected to the add button, it will open a prompt to select a file to add to the wrapper.

References _playBackMode, _radioCancer, _radioGroup, _radioSequential, _soundListDisplay, LIDL::Controller::SettingsController::GetInstance(), and LIDL::Sequential.

Referenced by WrapperProperties().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddSoundFromDrop

void WrapperProperties::AddSoundFromDrop ( QString  file)
slot

AddSoundFromDrop.

This method will deal with drag and dropped files. If they have the correct MIME type, it will add them.

References _playBackMode, _radioCancer, _radioGroup, _radioSequential, _soundListDisplay, LIDL::Controller::SettingsController::GetInstance(), and LIDL::Sequential.

Referenced by WrapperProperties().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddSoundFromUrl

void WrapperProperties::AddSoundFromUrl ( )
slot

AddSoundFromUrl method.

Connected to the Add from URL button, it will open a prompt to input a url pointing to a remote file. If the file has a valid MIME type, we add it to the soundboard.

References _soundListDisplay, LIDL::Controller::SettingsController::GetInstance(), and LIDL::Controller::SettingsController::GetSupportedMimeTypes().

Referenced by WrapperProperties().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closed

void WrapperProperties::closed ( )
signal

This signal is emitted whenever the Sound Entry Editor window is closed.

Referenced by closeEvent(), SoundboardMainUI::editSoundDialog(), and SoundboardMainUI::SoundboardMainUI().

Here is the caller graph for this function:

◆ closeEvent()

void WrapperProperties::closeEvent ( QCloseEvent *  event)
private

Reimplemented to send a closed signal to the mainUI, so we can re-enable the widgets.

Parameters
eventThe QCloseEvent (used internally).

References _soundListDisplay, closed(), LIDL::Controller::SettingsController::GetInstance(), and LIDL::Controller::SettingsController::setEditing().

Here is the call graph for this function:

◆ ItemWasClicked

void WrapperProperties::ItemWasClicked ( QListWidgetItem *  item)
slot

ItemWasClicked deals with connecting every slider and spinbox to the selected sound.

Parameters
itemThe QListWidgetItem that was clicked (dynamic_cast from CustomListWidgetItem).

References _btnDelete, _chorusWidget, _compressorWidget, _distortionWidget, _echoWidget, _flangerWidget, _gargleWidget, _selectedItem, _sfxSpoiler, _sliderMain, _sliderSpoiler, _sliderVAC, CustomListWidgetItem::getMainVolume(), CustomListWidgetItem::getVacVolume(), SetItemMainVolume(), and SetItemVACVolume().

Referenced by WrapperProperties().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RadioPressed

void WrapperProperties::RadioPressed ( int  id)
slot

RadioPressed sets the wrapper playback mode whenever radio is pressed.

Parameters
idThe ID of the pressed button.

References _btnAdd, _playBackMode, and _soundListDisplay.

Referenced by WrapperProperties().

Here is the caller graph for this function:

◆ SetItemMainVolume

void WrapperProperties::SetItemMainVolume ( int  newValue)
slot

SetItemMainVolume Sets a sound item main volume.

Parameters
newValueThe new main volume. (CustomListWidgetItem isn't a Q_OBJECT and can't have slots of its own).

References _selectedItem, and CustomListWidgetItem::setMainVolume().

Referenced by ItemWasClicked().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetItemVACVolume

void WrapperProperties::SetItemVACVolume ( int  newValue)
slot

SetItemVACVolume Sets a sound item VAC volume.

Parameters
newValueThe new VAC volume. (CustomListWidgetItem isn't a Q_OBJECT and can't have slots of its own).

References _selectedItem, and CustomListWidgetItem::setVacVolume().

Referenced by ItemWasClicked().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetKeySequence

void WrapperProperties::SetKeySequence ( QKeySequence  shortcut)
slot

SetKeySequence Sets the key sequence of the line edit.

References _shortcutSequence.

Referenced by WrapperProperties().

Here is the caller graph for this function:

◆ setUpConnection()

template<LIDL::SFX_TYPE Type, class Param >
void WrapperProperties::setUpConnection ( SfxSettingsWidget widget)
private

Set the connection of all the widgets (sliders,combo boxes etc), contained in the widget.

Template Parameters
TypeThe type of the SFX.
ParamThe enum class containing the SFX settings, used to iterate.
Parameters
widgetThe widget being connected.

References _selectedItem, SfxSettingsWidget::checkBoxStateChanged(), SfxSettingsWidget::comboBoxValueChanged(), SfxSettingsWidget::deactivateAll(), LIDL::SFX::flags, CustomListWidgetItem::getSFX(), CustomListWidgetItem::getSFXValue(), SfxSettingsWidget::setCheckboxState(), CustomListWidgetItem::setSFX(), CustomListWidgetItem::SetSFXEnabled(), SfxSettingsWidget::setValueOfEnumParam(), and SfxSettingsWidget::sliderValueChanged().

Here is the call graph for this function:

◆ signalAddDone

void WrapperProperties::signalAddDone ( std::shared_ptr< SoundWrapper sound)
signal

The signal that is sent when adding a new wrapper.

This signal is connected to a lambda function in the mainUI when the New Wrapper button is clicked.

Parameters
soundThe new soundwrapper to add.

Referenced by SoundboardMainUI::SoundboardMainUI(), and WrapperProperties().

Here is the caller graph for this function:

◆ signalEditDone

void WrapperProperties::signalEditDone ( std::shared_ptr< SoundWrapper sound)
signal

The signal that is sent after editing an existing wrapper.

This signal is connected to a lambda function in the mainUI when the Edit Wrapper button is clicked.

Parameters
soundThe edited wrapper that will replace the old one.

Referenced by SoundboardMainUI::editSoundDialog(), and WrapperProperties().

Here is the caller graph for this function:

Member Data Documentation

◆ _btnAbort

QPushButton* WrapperProperties::_btnAbort
private

The abort button.

Referenced by WrapperProperties().

◆ _btnAdd

QPushButton* WrapperProperties::_btnAdd
private

The add sound button.

Referenced by RadioPressed(), and WrapperProperties().

◆ _btnAddFromURL

QPushButton* WrapperProperties::_btnAddFromURL
private

The add sound from URL button.

Referenced by WrapperProperties().

◆ _btnDelete

QPushButton* WrapperProperties::_btnDelete
private

The delete sound button.

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _btnDone

QPushButton* WrapperProperties::_btnDone
private

The done button.

Referenced by WrapperProperties().

◆ _chorusWidget

SfxSettingsWidget* WrapperProperties::_chorusWidget
private

The widget responsible of the Chorus tab construction

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _compressorWidget

SfxSettingsWidget* WrapperProperties::_compressorWidget
private

The widget responsible of the Compressor tab construction

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _distortionWidget

SfxSettingsWidget* WrapperProperties::_distortionWidget
private

The widget responsible of the Distortion tab construction

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _echoWidget

SfxSettingsWidget* WrapperProperties::_echoWidget
private

The widget responsible of the Echo tab construction

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _flangerWidget

SfxSettingsWidget* WrapperProperties::_flangerWidget
private

The widget responsible of the Flanger tab construction

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _gargleWidget

SfxSettingsWidget* WrapperProperties::_gargleWidget
private

The widget responsible of the Gargle tab construction

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _gLayout

QGridLayout* WrapperProperties::_gLayout
private

Layout.

Referenced by WrapperProperties().

◆ _mainOutput

int WrapperProperties::_mainOutput
private

The index of the main output device.

Referenced by WrapperProperties().

◆ _playBackMode

LIDL::Playback WrapperProperties::_playBackMode
private

The variable that holds the playbackmode.

Referenced by AddSound(), AddSoundFromDrop(), RadioPressed(), and WrapperProperties().

◆ _radioAuto

QRadioButton* WrapperProperties::_radioAuto
private

The Sequential (auto) radio button.

Referenced by WrapperProperties().

◆ _radioAutoLoop

QRadioButton* WrapperProperties::_radioAutoLoop
private

The Singleton Autoplay radio button.

Referenced by WrapperProperties().

◆ _radioCancer

QRadioButton* WrapperProperties::_radioCancer
private

The Singleton (cancer) radio button.

Referenced by AddSound(), AddSoundFromDrop(), and WrapperProperties().

◆ _radioGroup

QButtonGroup* WrapperProperties::_radioGroup
private

The button holding together each radio button.

Referenced by AddSound(), AddSoundFromDrop(), and WrapperProperties().

◆ _radioGroupBox

QGroupBox* WrapperProperties::_radioGroupBox
private

The groupbox for playback mode.

Referenced by WrapperProperties().

◆ _radioLayout

QHBoxLayout* WrapperProperties::_radioLayout
private

The horizontal layout containing the radio buttons.

Referenced by WrapperProperties().

◆ _radioSequential

QRadioButton* WrapperProperties::_radioSequential
private

The Sequential radio button.

Referenced by AddSound(), AddSoundFromDrop(), and WrapperProperties().

◆ _selectedItem

CustomListWidgetItem* WrapperProperties::_selectedItem
private

A pointer to the selected item.

Referenced by ItemWasClicked(), SetItemMainVolume(), SetItemVACVolume(), setUpConnection(), and WrapperProperties().

◆ _sfxBtnGroup

QButtonGroup* WrapperProperties::_sfxBtnGroup
private

◆ _sfxLayout

QGridLayout* WrapperProperties::_sfxLayout
private

The layout of the SFX spoiler group.

Referenced by WrapperProperties().

◆ _sfxSpoiler

Spoiler* WrapperProperties::_sfxSpoiler
private

The spoiler group containing the SFX settings.

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _sfxTabWidget

QTabWidget* WrapperProperties::_sfxTabWidget
private

Tab widget to sort all the available SFX.

Referenced by WrapperProperties().

◆ _shortcutEdit

CustomShortcutEdit* WrapperProperties::_shortcutEdit
private

The specialized QKeySequenceEdit we use to get the shortcut.

Referenced by WrapperProperties().

◆ _shortcutGroup

QGroupBox* WrapperProperties::_shortcutGroup
private

The groupbox for the shortcut settings.

Referenced by WrapperProperties().

◆ _shortcutHint

QLabel* WrapperProperties::_shortcutHint
private

The instructions text.

Referenced by WrapperProperties().

◆ _shortcutLayout

QGridLayout* WrapperProperties::_shortcutLayout
private

The layout of the shortcut groupbox.

Referenced by WrapperProperties().

◆ _shortcutResetBtn

QPushButton* WrapperProperties::_shortcutResetBtn
private

The reset button.

Referenced by WrapperProperties().

◆ _shortcutSequence

QKeySequence* WrapperProperties::_shortcutSequence
private

The variable that will contain the sequence.

Referenced by SetKeySequence(), and WrapperProperties().

◆ _shortcutWarning

QLabel* WrapperProperties::_shortcutWarning
private

The warning about using the same key twice.

Referenced by WrapperProperties().

◆ _sliderGroup

QGroupBox* WrapperProperties::_sliderGroup
private

The groupbox containing the volume sliders.

◆ _sliderLabelMain

QLabel* WrapperProperties::_sliderLabelMain
private

Label for the main volume.

Referenced by WrapperProperties().

◆ _sliderLabelVAC

QLabel* WrapperProperties::_sliderLabelVAC
private

Label for the VAC volume.

Referenced by WrapperProperties().

◆ _sliderLayout

QGridLayout* WrapperProperties::_sliderLayout
private

The layout of the slider groupbox.

Referenced by WrapperProperties().

◆ _sliderMain

QSlider* WrapperProperties::_sliderMain
private

The main volume slider.

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _sliderMainSpin

QSpinBox* WrapperProperties::_sliderMainSpin
private

The main volume spinbox.

Referenced by WrapperProperties().

◆ _sliderSpoiler

Spoiler* WrapperProperties::_sliderSpoiler
private

The spoiler group containing the volume sliders

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _sliderVAC

QSlider* WrapperProperties::_sliderVAC
private

The VAC volume slider.

Referenced by ItemWasClicked(), and WrapperProperties().

◆ _sliderVACSpin

QSpinBox* WrapperProperties::_sliderVACSpin
private

The VAC volume spinbox.

Referenced by WrapperProperties().

◆ _soundListDisplay

CustomListWidget* WrapperProperties::_soundListDisplay
private

The widget that will display the sound list. (check CustomListWidget class).

Referenced by AddSound(), AddSoundFromDrop(), AddSoundFromUrl(), closeEvent(), RadioPressed(), and WrapperProperties().

◆ _soundListHint

QLabel* WrapperProperties::_soundListHint
private

The instructions/hints under the sound list.

Referenced by WrapperProperties().

◆ _VACOutput

int WrapperProperties::_VACOutput
private

The index of the VAC output device.

Referenced by WrapperProperties().

◆ _vLayout

QVBoxLayout* WrapperProperties::_vLayout
private

Layout.

Referenced by WrapperProperties().


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