![]() |
LIDL Soundboard
1.9.0
A simple soundboard, yet better than EXP Soundboard forsenE
|
#include <SettingsController.h>


Public Slots | |
| void | SetDefaultMainVolume (int) |
| SetDefaultMainVolume Sets the default main volume inside the controller, to be used when creating wrappers, and saved in the lidlsettings. More... | |
| void | SetDefaultVacVolume (int) |
| SetDefaultVacVolume Sets the default VAC volume inside the controller, to be used when creating wrappers, and saved in the lidlsettings. More... | |
| void | SetRecentFileCount (int) |
| void | ShowSettingsWindow () |
| void | buttonBrowseLidl () |
| buttonBrowseLidl Slot connected to a file browser button TODO: refactor as a lambda More... | |
| void | buttonBrowseSound () |
| buttonBrowseSound Slot connected to a file browser button TODO: refactor as a lambda More... | |
| void | addFileToRecent (QFileInfo fileInfo) |
| addFileToRecent More... | |
Signals | |
| void | RecentFilesChanged () |
| RecentFilesChanged Signal is caught by the main UI to changes the Open Recent Menu. More... | |
| void | SettingsChanged () |
| void | ProfileConfigurationChanged () |
Public Member Functions | |
| int | GetDefaultMainVolume () const |
| GetDefaultMainVolume. More... | |
| int | GetDefaultVacVolume () const |
| GetDefaultVacVolume. More... | |
| QString | GetDefaultSoundboardFolder () const |
| GetDefaultSoundboardFolder. More... | |
| QString | GetDefaultSoundFolder () const |
| GetDefaultSoundFolder. More... | |
| bool | OpenSettings () |
| OpenSettings. More... | |
| void | SaveSettings () |
| SaveSettings. More... | |
| QString | GetLastOpenedSoundboard () |
| GetLastOpenedSoundboard. More... | |
| std::deque< QFileInfo > | GetRecentFiles () |
| GetRecentFiles. More... | |
| int | GetRecentFilesCount () const |
| GetRecentFilesCount. More... | |
| bool | IsThisFirstTimeUser () |
| IsThisFirstTimeUser. More... | |
| void | unHoldPTT () |
| unHoldPTT More... | |
| void | holdPTT (int duration) |
| holdPTT More... | |
| void | addShowFlag (LIDL::SHOW_SETTINGS addedFlag) |
| addShowFlag Will add a flag to the list of things to be displayed (stored as flags) More... | |
| void | removeShowFlag (LIDL::SHOW_SETTINGS removedFlag) |
| removeShowFlag Will remove a flag to the list of things to be displayed (stored as flags) More... | |
| bool | checkShowFlags (LIDL::SHOW_SETTINGS checkedFlag) const |
| checkShowFlags More... | |
| LIDL::SHOW_SETTINGS | getShowFlags () const |
| getShowFlags Get the flags More... | |
| QStringList | GetSupportedMimeTypes () const |
| GetSupportedMimeTypes. More... | |
| bool | GetDragAndDropSeveralWrappers () const |
| GetDragAndDropSeveralWrappers. More... | |
| bool | getEventProcessing () const |
| bool | isEditing () const |
| isEditing Is editing basically serves to know whether we should process shortcuts being pressed and play the sound, or not because the user is editing a sound (or in another menu for instance) The boolean will be set in the constructor of the soundwrapper (wrapperproperties) edition window, and unset in the destructor More... | |
| void | setEditing (bool) |
| setEditing Allows shortcut to be dismissed if they are pressed while a user is editing a wrapper (see isEditing()) More... | |
Static Public Member Functions | |
| static SettingsController * | GetInstance () |
Private Member Functions | |
| SettingsController () | |
Private Attributes | |
| QString | fileName |
| bool | _isEditing |
| QString | defaultSoundboardFolder |
| QString | defaultSoundsFolder |
| int | recentFileCount |
| int | defaultMainVolume |
| int | defaultVacVolume |
| std::deque< QFileInfo > | recentFiles |
| Ui::Settings * | ui |
| QMenu * | _recentMenu |
| QJsonObject | oldObject |
| bool | fileAlreadyExisted |
| QTimer | _activePttTimer |
| int | _activePttScanCode |
| int | _activePttVitualKey |
| bool | _eventProcessing |
| LIDL::SHOW_SETTINGS | _showFlags |
| bool | dragAndDropSeveralWrappers |
Static Private Attributes | |
| static SettingsController * | self = nullptr |
|
private |
References _activePttScanCode, _activePttTimer, _activePttVitualKey, _eventProcessing, _isEditing, _showFlags, defaultMainVolume, defaultSoundboardFolder, defaultSoundsFolder, defaultVacVolume, dragAndDropSeveralWrappers, fileName, LIDL::NO_SETTINGS, recentFileCount, and unHoldPTT().
Referenced by GetInstance().


|
slot |
addFileToRecent
| fileInfo |
References recentFiles, and RecentFilesChanged().
Referenced by LIDL::Controller::SaveController::SaveController().

| void LIDL::Controller::SettingsController::addShowFlag | ( | LIDL::SHOW_SETTINGS | addedFlag | ) |
addShowFlag Will add a flag to the list of things to be displayed (stored as flags)
| addedFlag |
References _showFlags.
Referenced by LIDL::Controller::SaveController::OpenSaveFile(), and SoundboardMainUI::setUpMenu().

|
slot |
buttonBrowseLidl Slot connected to a file browser button TODO: refactor as a lambda
References ui.
Referenced by ShowSettingsWindow().

|
slot |
buttonBrowseSound Slot connected to a file browser button TODO: refactor as a lambda
References ui.
Referenced by ShowSettingsWindow().

| bool LIDL::Controller::SettingsController::checkShowFlags | ( | LIDL::SHOW_SETTINGS | checkedFlag | ) | const |
checkShowFlags
| checkedFlag$ | Will check if a flag is activated (using &) |
References _showFlags.
Referenced by SoundboardMainUI::refreshView().

| int LIDL::Controller::SettingsController::GetDefaultMainVolume | ( | ) | const |
GetDefaultMainVolume.
References defaultMainVolume.
Referenced by LIDL::Controller::SaveController::OpenSaveFile(), and LIDL::Controller::SaveController::ParseOldSave().

| QString LIDL::Controller::SettingsController::GetDefaultSoundboardFolder | ( | ) | const |
GetDefaultSoundboardFolder.
References defaultSoundboardFolder.
| QString LIDL::Controller::SettingsController::GetDefaultSoundFolder | ( | ) | const |
GetDefaultSoundFolder.
References defaultSoundsFolder.
| int LIDL::Controller::SettingsController::GetDefaultVacVolume | ( | ) | const |
GetDefaultVacVolume.
References defaultVacVolume.
Referenced by LIDL::Controller::SaveController::OpenSaveFile(), and LIDL::Controller::SaveController::ParseOldSave().

| bool LIDL::Controller::SettingsController::GetDragAndDropSeveralWrappers | ( | ) | const |
GetDragAndDropSeveralWrappers.
References dragAndDropSeveralWrappers.
Referenced by SoundboardMainUI::dropEvent().

| bool LIDL::Controller::SettingsController::getEventProcessing | ( | ) | const |
References _eventProcessing.
|
static |
References SettingsController().
Referenced by WrapperProperties::AddSound(), SoundboardMainUI::addSound(), WrapperProperties::AddSoundFromDrop(), WrapperProperties::AddSoundFromUrl(), WrapperProperties::closeEvent(), SoundboardMainUI::closeEvent(), CustomListWidget::dragEnterEvent(), SoundboardMainUI::dragEnterEvent(), SoundboardMainUI::dropEvent(), LIDL::Controller::SaveController::GenerateSaveFile(), SoundboardMainUI::GenerateSaveFile(), SoundboardMainUI::OpenEXPSounboard(), LIDL::Controller::SaveController::OpenSaveFile(), LIDL::Controller::SaveController::ParseOldSave(), SoundboardMainUI::PostConstruction(), SoundboardMainUI::refreshView(), LIDL::Controller::SaveController::SaveAs(), LIDL::Controller::SaveController::SaveController(), SoundboardMainUI::setUpMenu(), SoundboardMainUI::SetUpRecentMenu(), SoundboardMainUI::SoundboardMainUI(), SoundboardMainUI::winHotKeyPressed(), and WrapperProperties::WrapperProperties().


| QString LIDL::Controller::SettingsController::GetLastOpenedSoundboard | ( | ) |
GetLastOpenedSoundboard.
TODO: probably add an option to toggle this off
References recentFiles.
| std::deque< QFileInfo > LIDL::Controller::SettingsController::GetRecentFiles | ( | ) |
| int LIDL::Controller::SettingsController::GetRecentFilesCount | ( | ) | const |
GetRecentFilesCount.
References recentFileCount.
Referenced by SoundboardMainUI::SetUpRecentMenu().

| LIDL::SHOW_SETTINGS LIDL::Controller::SettingsController::getShowFlags | ( | ) | const |
| QStringList LIDL::Controller::SettingsController::GetSupportedMimeTypes | ( | ) | const |
GetSupportedMimeTypes.
Referenced by WrapperProperties::AddSoundFromUrl(), and SoundboardMainUI::dropEvent().

| void LIDL::Controller::SettingsController::holdPTT | ( | int | duration | ) |
holdPTT
Will hold push to talk key for given duration. If several sounds are played, it will hold it for the longest duration. Interally this uses a timer that will be reset if (new duration > old duration)
| duration | The duration to hold the PTT for |
References _activePttTimer, _eventProcessing, LIDL::Controller::ProfileController::GetActiveProfile(), LIDL::Controller::ProfileController::GetInstance(), Profile::GetPttScanCode(), and Profile::GetPttVirtualKey().
Referenced by SoundboardMainUI::addSound().


| bool LIDL::Controller::SettingsController::isEditing | ( | ) | const |
isEditing Is editing basically serves to know whether we should process shortcuts being pressed and play the sound, or not because the user is editing a sound (or in another menu for instance) The boolean will be set in the constructor of the soundwrapper (wrapperproperties) edition window, and unset in the destructor
References _isEditing.
Referenced by SoundboardMainUI::winHotKeyPressed().

| bool LIDL::Controller::SettingsController::IsThisFirstTimeUser | ( | ) |
IsThisFirstTimeUser.
References fileAlreadyExisted.
| bool LIDL::Controller::SettingsController::OpenSettings | ( | ) |
OpenSettings.
Used to open the lidlsettings.json file, that contain several stuff such as default locations, default volumes, and recent files. Will probably contain profiles later on :)
References defaultMainVolume, defaultSoundboardFolder, defaultSoundsFolder, defaultVacVolume, dragAndDropSeveralWrappers, fileAlreadyExisted, fileName, recentFileCount, recentFiles, RecentFilesChanged(), and SaveSettings().

|
signal |
|
signal |
RecentFilesChanged Signal is caught by the main UI to changes the Open Recent Menu.
Referenced by addFileToRecent(), OpenSettings(), and SoundboardMainUI::SoundboardMainUI().

| void LIDL::Controller::SettingsController::removeShowFlag | ( | LIDL::SHOW_SETTINGS | removedFlag | ) |
removeShowFlag Will remove a flag to the list of things to be displayed (stored as flags)
| removedFlag |
References _showFlags.
Referenced by SoundboardMainUI::setUpMenu().

| void LIDL::Controller::SettingsController::SaveSettings | ( | ) |
SaveSettings.
Will save settings to lidlsettings.json
References defaultMainVolume, defaultSoundboardFolder, defaultSoundsFolder, defaultVacVolume, dragAndDropSeveralWrappers, fileName, recentFileCount, and recentFiles.
Referenced by SoundboardMainUI::closeEvent(), and OpenSettings().

|
slot |
SetDefaultMainVolume Sets the default main volume inside the controller, to be used when creating wrappers, and saved in the lidlsettings.
References defaultMainVolume.
Referenced by ShowSettingsWindow().

|
slot |
SetDefaultVacVolume Sets the default VAC volume inside the controller, to be used when creating wrappers, and saved in the lidlsettings.
References defaultVacVolume.
Referenced by ShowSettingsWindow().

| void LIDL::Controller::SettingsController::setEditing | ( | bool | newState | ) |
setEditing Allows shortcut to be dismissed if they are pressed while a user is editing a wrapper (see isEditing())
References _isEditing.
Referenced by WrapperProperties::closeEvent(), and WrapperProperties::WrapperProperties().

|
slot |
References recentFileCount.
Referenced by ShowSettingsWindow().

|
signal |
|
slot |
References buttonBrowseLidl(), buttonBrowseSound(), defaultMainVolume, defaultSoundboardFolder, defaultSoundsFolder, defaultVacVolume, dragAndDropSeveralWrappers, recentFileCount, SetDefaultMainVolume(), SetDefaultVacVolume(), SetRecentFileCount(), ui, and void().

| void LIDL::Controller::SettingsController::unHoldPTT | ( | ) |
unHoldPTT
Will unhold the push to talk (when using auto hold ptt)
References _activePttTimer, and LIDL::Controller::ProfileController::GetInstance().
Referenced by SettingsController(), SoundboardMainUI::SoundboardMainUI(), and SoundboardMainUI::winHotKeyPressed().


|
private |
Referenced by SettingsController().
|
private |
Referenced by holdPTT(), SettingsController(), and unHoldPTT().
|
private |
Referenced by SettingsController().
|
private |
boolean to be tested in MainUI to know if events (key sequences) should be processed
Referenced by getEventProcessing(), holdPTT(), and SettingsController().
|
private |
Referenced by isEditing(), setEditing(), and SettingsController().
|
private |
|
private |
Referenced by addShowFlag(), checkShowFlags(), getShowFlags(), removeShowFlag(), and SettingsController().
|
private |
Referenced by GetDefaultMainVolume(), OpenSettings(), SaveSettings(), SetDefaultMainVolume(), SettingsController(), and ShowSettingsWindow().
|
private |
Referenced by GetDefaultSoundboardFolder(), OpenSettings(), SaveSettings(), SettingsController(), and ShowSettingsWindow().
|
private |
Referenced by GetDefaultSoundFolder(), OpenSettings(), SaveSettings(), SettingsController(), and ShowSettingsWindow().
|
private |
Referenced by GetDefaultVacVolume(), OpenSettings(), SaveSettings(), SetDefaultVacVolume(), SettingsController(), and ShowSettingsWindow().
|
private |
Boolean holding how drag and drop several files will be handled (several wrapper or one)
Referenced by GetDragAndDropSeveralWrappers(), OpenSettings(), SaveSettings(), SettingsController(), and ShowSettingsWindow().
|
private |
Referenced by IsThisFirstTimeUser(), and OpenSettings().
|
private |
Referenced by OpenSettings(), SaveSettings(), and SettingsController().
|
private |
|
private |
Referenced by GetRecentFilesCount(), OpenSettings(), SaveSettings(), SetRecentFileCount(), SettingsController(), and ShowSettingsWindow().
|
private |
Referenced by addFileToRecent(), GetLastOpenedSoundboard(), GetRecentFiles(), OpenSettings(), and SaveSettings().
|
staticprivate |
|
private |
Referenced by buttonBrowseLidl(), buttonBrowseSound(), and ShowSettingsWindow().