![]() |
LIDL Soundboard
1.9.0
A simple soundboard, yet better than EXP Soundboard forsenE
|
The ProfileController class Basically when a profile is loaded, the array of sounds QVector<shared_ptr<SoundWrapper>>, contained by the Profile Will be copied to a temporary array temp. Then, the profile sounds will be cleared. Then, mainUI's QVector<shared_ptr<SoundWrapper>> which contains pointer to the currently load profile will be cleared. Finally, the mainUI ProfileSwitched method will be invoked, passing the temporary array as an argument. More...
#include <ProfileController.h>
Signals | |
void | AddSoundsToMainUI (QVector< std::shared_ptr< SoundWrapper >>) |
AddSoundsToMainUI Triggers the main UI logic that will add the sound to both the active profile and the UI. So that ref count isn't fucked up. More... | |
void | RefreshComboBox () |
RefreshComboBox Signal sent by AutomaticConfigurationChange to notify the combobox it needs to update itself. More... | |
Public Member Functions | |
std::vector< Profile * > | GetProfiles () const |
GetProfiles. More... | |
void | AddProfile (Profile *profile, LIDL::PROFILE_COPY_MODE copyMode=LIDL::PROFILE_COPY_MODE::NO_COPY) |
AddProfile Add a profile to the profiles array. Copy mode is either nothing, copy sounds from another profile, or mirror sounds from another profile. More... | |
void | ReplaceProfiles (std::vector< Profile * > profiles) |
ReplaceProfiles Empty this. More... | |
void | DeleteActiveProfile () |
DeleteProfile. More... | |
Profile * | GetProfileForExe (QString exe) |
GetForExe. More... | |
void | ManualGameConfigurationChanged (const QString &name) |
AutoGameConfigurationChange. More... | |
Profile * | GetActiveProfile () const |
GetActiveProfile. More... | |
void | RemoveAllProfiles () |
RemoveAllProfiles Remove all profiles (included default constructed "default" one) More... | |
void | AutomaticConfigurationChange (const QString &name, bool forceChange=false) |
AutomaticConfigurationChange. More... | |
Profile * | GetProfileForName (QString name) |
GetProfileForName. More... | |
Static Public Member Functions | |
static ProfileController * | GetInstance () |
Private Member Functions | |
ProfileController () | |
Private Attributes | |
std::vector< Profile * > | _profiles |
Profile * | _activeProfile |
Static Private Attributes | |
static ProfileController * | self = nullptr |
The ProfileController class Basically when a profile is loaded, the array of sounds QVector<shared_ptr<SoundWrapper>>, contained by the Profile Will be copied to a temporary array temp. Then, the profile sounds will be cleared. Then, mainUI's QVector<shared_ptr<SoundWrapper>> which contains pointer to the currently load profile will be cleared. Finally, the mainUI ProfileSwitched method will be invoked, passing the temporary array as an argument.
It will re-add the sounds to the profile, and to the UI. Temporary array goes out of scope, ref count decreases. Reference count should be like this: 1 for the UI (IF profile is currently active) 1 for the profile
|
private |
void LIDL::Controller::ProfileController::AddProfile | ( | Profile * | profile, |
LIDL::PROFILE_COPY_MODE | copyMode = LIDL::PROFILE_COPY_MODE::NO_COPY |
||
) |
AddProfile Add a profile to the profiles array. Copy mode is either nothing, copy sounds from another profile, or mirror sounds from another profile.
profile |
References _profiles, Profile::AddSound(), AutomaticConfigurationChange(), LIDL::COPY, Profile::GetConfigAsString(), Profile::GetName(), Profile::GetPttKeySequence(), Profile::GetPttScanCode(), Profile::GetPttVirtualKey(), Profile::GetSounds(), LIDL::MIRROR, LIDL::NO_COPY, Profile::SetPttKeySequence(), Profile::SetPttScanCode(), and Profile::SetPttVirtualKey().
Referenced by SoundboardMainUI::ClearAll(), LIDL::Controller::SaveController::OpenSaveFile(), and LIDL::Controller::SaveController::ParseOldSave().
|
signal |
AddSoundsToMainUI Triggers the main UI logic that will add the sound to both the active profile and the UI. So that ref count isn't fucked up.
Referenced by AutomaticConfigurationChange(), ManualGameConfigurationChanged(), and SoundboardMainUI::SoundboardMainUI().
void LIDL::Controller::ProfileController::AutomaticConfigurationChange | ( | const QString & | name, |
bool | forceChange = false |
||
) |
AutomaticConfigurationChange.
name | |
forceChange | (Default false) Will force the profile to change even if it's already loaded Call this when you need to change profile and then update the combo box :) |
References _activeProfile, _profiles, AddSoundsToMainUI(), Profile::ClearSounds(), Profile::GetName(), Profile::GetParent(), Profile::GetSounds(), and RefreshComboBox().
Referenced by AddProfile(), DeleteActiveProfile(), LIDL::Controller::SaveController::OpenSaveFile(), and LIDL::Callback::ShowOverlay().
void LIDL::Controller::ProfileController::DeleteActiveProfile | ( | ) |
DeleteProfile.
profile* | Will delete the profile identified by the pointer. |
References _activeProfile, _profiles, AutomaticConfigurationChange(), and Profile::GetName().
Profile * LIDL::Controller::ProfileController::GetActiveProfile | ( | ) | const |
GetActiveProfile.
References _activeProfile.
Referenced by SoundboardMainUI::addSound(), LIDL::Controller::SettingsController::holdPTT(), GameSelector::RefreshProfiles(), and SoundboardMainUI::SoundboardMainUI().
|
static |
References ProfileController().
Referenced by SoundboardMainUI::addSound(), SoundboardMainUI::ClearAll(), SoundboardMainUI::closeEvent(), GameSelector::GameSelector(), LIDL::Controller::SaveController::GenerateSaveFile(), LIDL::Controller::HookController::GetProfileForExe(), LIDL::Controller::SettingsController::holdPTT(), SoundboardMainUI::OpenEXPSounboard(), LIDL::Controller::SaveController::OpenSaveFile(), LIDL::Controller::SaveController::ParseOldSave(), SoundboardMainUI::ProfileSwitched(), GameSelector::RefreshProfiles(), LIDL::Callback::ShowOverlay(), SoundboardMainUI::SoundboardMainUI(), and LIDL::Controller::SettingsController::unHoldPTT().
Profile * LIDL::Controller::ProfileController::GetProfileForExe | ( | QString | exe | ) |
GetForExe.
exe |
References _profiles.
Referenced by LIDL::Controller::HookController::GetProfileForExe().
Profile * LIDL::Controller::ProfileController::GetProfileForName | ( | QString | name | ) |
std::vector< Profile * > LIDL::Controller::ProfileController::GetProfiles | ( | ) | const |
GetProfiles.
References _profiles.
Referenced by GameSelector::RefreshProfiles().
void LIDL::Controller::ProfileController::ManualGameConfigurationChanged | ( | const QString & | name | ) |
AutoGameConfigurationChange.
executable | Changes the PTT and loaded sound based on the autodetected game |
ManualGameConfigurationChanged
name | Changes the same stuff but based on the selected thing by the user in the combobox |
References _activeProfile, _profiles, AddSoundsToMainUI(), Profile::ClearSounds(), Profile::GetParent(), and Profile::GetSounds().
Referenced by GameSelector::GameSelector(), and SoundboardMainUI::OpenEXPSounboard().
|
signal |
RefreshComboBox Signal sent by AutomaticConfigurationChange to notify the combobox it needs to update itself.
Referenced by AutomaticConfigurationChange(), and GameSelector::GameSelector().
void LIDL::Controller::ProfileController::RemoveAllProfiles | ( | ) |
RemoveAllProfiles Remove all profiles (included default constructed "default" one)
References _activeProfile, and _profiles.
Referenced by SoundboardMainUI::ClearAll(), and SoundboardMainUI::closeEvent().
|
private |
|
private |
Array of available profile, not a QVector because it doesnt work kek
Referenced by AddProfile(), AutomaticConfigurationChange(), DeleteActiveProfile(), GetProfileForExe(), GetProfileForName(), GetProfiles(), ManualGameConfigurationChanged(), RemoveAllProfiles(), and ReplaceProfiles().
|
staticprivate |