LIDL Soundboard  1.9.0
A simple soundboard, yet better than EXP Soundboard forsenE
LIDL::Controller::ProfileController Class Reference

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>

Inheritance diagram for LIDL::Controller::ProfileController:
Inheritance graph
Collaboration diagram for LIDL::Controller::ProfileController:
Collaboration graph

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...
 
ProfileGetProfileForExe (QString exe)
 GetForExe. More...
 
void ManualGameConfigurationChanged (const QString &name)
 AutoGameConfigurationChange. More...
 
ProfileGetActiveProfile () 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...
 
ProfileGetProfileForName (QString name)
 GetProfileForName. More...
 

Static Public Member Functions

static ProfileControllerGetInstance ()
 

Private Member Functions

 ProfileController ()
 

Private Attributes

std::vector< Profile * > _profiles
 
Profile_activeProfile
 

Static Private Attributes

static ProfileControllerself = nullptr
 

Detailed Description

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

  • 1 for which ever profile mirrors it
  • temporary ones for editing widgets (like editing profiles etc) To see the ref count while in a "still" mode, just play a sound. It will display ref count in qDebug() output.

Constructor & Destructor Documentation

◆ ProfileController()

LIDL::Controller::ProfileController::ProfileController ( )
private

References _activeProfile.

Referenced by GetInstance().

Here is the caller graph for this function:

Member Function Documentation

◆ AddProfile()

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.

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

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

◆ AddSoundsToMainUI

void LIDL::Controller::ProfileController::AddSoundsToMainUI ( )
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().

Here is the caller graph for this function:

◆ AutomaticConfigurationChange()

void LIDL::Controller::ProfileController::AutomaticConfigurationChange ( const QString &  name,
bool  forceChange = false 
)

AutomaticConfigurationChange.

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

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

◆ DeleteActiveProfile()

void LIDL::Controller::ProfileController::DeleteActiveProfile ( )

DeleteProfile.

Parameters
profile*Will delete the profile identified by the pointer.

References _activeProfile, _profiles, AutomaticConfigurationChange(), and Profile::GetName().

Here is the call graph for this function:

◆ GetActiveProfile()

Profile * LIDL::Controller::ProfileController::GetActiveProfile ( ) const

GetActiveProfile.

Returns
The active profile

References _activeProfile.

Referenced by SoundboardMainUI::addSound(), LIDL::Controller::SettingsController::holdPTT(), GameSelector::RefreshProfiles(), and SoundboardMainUI::SoundboardMainUI().

Here is the caller graph for this function:

◆ GetInstance()

◆ GetProfileForExe()

Profile * LIDL::Controller::ProfileController::GetProfileForExe ( QString  exe)

GetForExe.

Parameters
exe
Returns
A pointer to the profile if it was found, nullptr otherwise.

References _profiles.

Referenced by LIDL::Controller::HookController::GetProfileForExe().

Here is the caller graph for this function:

◆ GetProfileForName()

Profile * LIDL::Controller::ProfileController::GetProfileForName ( QString  name)

GetProfileForName.

Parameters
name
Returns

References _profiles.

◆ GetProfiles()

std::vector< Profile * > LIDL::Controller::ProfileController::GetProfiles ( ) const

GetProfiles.

Returns
An array of profile (see Profile.h)

References _profiles.

Referenced by GameSelector::RefreshProfiles().

Here is the caller graph for this function:

◆ ManualGameConfigurationChanged()

void LIDL::Controller::ProfileController::ManualGameConfigurationChanged ( const QString &  name)

AutoGameConfigurationChange.

Parameters
executableChanges the PTT and loaded sound based on the autodetected game

ManualGameConfigurationChanged

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

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

◆ RefreshComboBox

void LIDL::Controller::ProfileController::RefreshComboBox ( )
signal

RefreshComboBox Signal sent by AutomaticConfigurationChange to notify the combobox it needs to update itself.

Referenced by AutomaticConfigurationChange(), and GameSelector::GameSelector().

Here is the caller graph for this function:

◆ RemoveAllProfiles()

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

Here is the caller graph for this function:

◆ ReplaceProfiles()

void LIDL::Controller::ProfileController::ReplaceProfiles ( std::vector< Profile * >  profiles)

ReplaceProfiles Empty this.

Parameters
profiles

References _profiles.

Member Data Documentation

◆ _activeProfile

◆ _profiles

std::vector<Profile*> LIDL::Controller::ProfileController::_profiles
private

◆ self

ProfileController * LIDL::Controller::ProfileController::self = nullptr
staticprivate

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