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

The Profile class Describe a profile: Name List of linked executable that will make this profile switched to when the executable is detected List of sounds as a QVector<shared_ptr<SoundWrapper>> The owner ship of those element is shared between the profile and the main ui. So reference count should be like this: More...

#include <Profile.h>

Collaboration diagram for Profile:
Collaboration graph

Classes

class  Builder
 

Public Member Functions

QString GetName () const
 GetName. More...
 
void SetName (QString newName)
 SetName. More...
 
QSet< QString > GetGameList () const
 GetGameList. More...
 
void SwapGames (QSet< QString > newListHYPERBRUH)
 SwapGames. More...
 
QString GetConfigAsString () const
 GetConfig. More...
 
bool IsContainingExe (QString exe) const
 IsExeHere Search for an executable in _exeList. More...
 
QVector< std::shared_ptr< SoundWrapper > > GetSounds () const
 GetSounds. More...
 
void AddSound (std::shared_ptr< SoundWrapper > wrapper)
 AddSound. More...
 
void RemoveSoundFromSharedPtr (std::shared_ptr< SoundWrapper > wrapper)
 RemoveSoundFromSharedPtr. More...
 
void SwapSound (std::shared_ptr< SoundWrapper > oldWrapper, std::shared_ptr< SoundWrapper > newWrapper)
 SwapSound. More...
 
ProfileGetParent () const
 GetParent. More...
 
void ClearSounds ()
 ClearSounds Remove every sound from the array. More...
 
void SetPttScanCode (int sc)
 SetPttScanCode. More...
 
void SetPttVirtualKey (int vk)
 SetPttVirtualKey. More...
 
int GetPttScanCode () const
 GetPttScanCode. More...
 
int GetPttVirtualKey () const
 GetPttVirtualKey. More...
 
void SetPttKeySequence (QKeySequence sequence)
 SetPttKeySequence. More...
 
QKeySequence GetPttKeySequence () const
 SetPttKeySequence. More...
 
QJsonObject GetProfileAsObject () const
 GetProfileAsObject. More...
 
 ~Profile ()
 

Private Member Functions

 Profile (QString name, QSet< QString > exe, Profile *parent, QVector< std::shared_ptr< SoundWrapper >> wrappers, int PttVirtualKey, int PttScanCode, QKeySequence PttKeySequence)
 

Private Attributes

QString _name
 
QSet< QString > _exeList
 
Profile_parent
 
QVector< std::shared_ptr< SoundWrapper > > _sounds
 
int _PTTVirtualKey = -1
 
int _PTTScanCode = -1
 
QKeySequence _PTTKeySequence
 

Detailed Description

The Profile class Describe a profile: Name List of linked executable that will make this profile switched to when the executable is detected List of sounds as a QVector<shared_ptr<SoundWrapper>> The owner ship of those element is shared between the profile and the main ui. So 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

◆ ~Profile()

Profile::~Profile ( )

References _name, and _sounds.

◆ Profile()

Profile::Profile ( QString  name,
QSet< QString >  exe,
Profile parent,
QVector< std::shared_ptr< SoundWrapper >>  wrappers,
int  PttVirtualKey,
int  PttScanCode,
QKeySequence  PttKeySequence 
)
private

Referenced by Profile::Builder::Build().

Here is the caller graph for this function:

Member Function Documentation

◆ AddSound()

void Profile::AddSound ( std::shared_ptr< SoundWrapper wrapper)

AddSound.

Parameters
Thewrapper to append to _sounds

References _sounds.

Referenced by LIDL::Controller::ProfileController::AddProfile(), and SoundboardMainUI::addSound().

Here is the caller graph for this function:

◆ ClearSounds()

void Profile::ClearSounds ( )

ClearSounds Remove every sound from the array.

References _sounds.

Referenced by LIDL::Controller::ProfileController::AutomaticConfigurationChange(), and LIDL::Controller::ProfileController::ManualGameConfigurationChanged().

Here is the caller graph for this function:

◆ GetConfigAsString()

QString Profile::GetConfigAsString ( ) const

GetConfig.

Returns
The config as a string, mostly used for debug

References _exeList, and _name.

Referenced by LIDL::Controller::ProfileController::AddProfile().

Here is the caller graph for this function:

◆ GetGameList()

QSet< QString > Profile::GetGameList ( ) const

GetGameList.

Returns
The game list as a QSet<QString>

References _exeList.

Referenced by ProfileEdit::ProfileEdit().

Here is the caller graph for this function:

◆ GetName()

◆ GetParent()

Profile * Profile::GetParent ( ) const

GetParent.

Returns
The parent profile that sound should be mirrored from

References _parent.

Referenced by LIDL::Controller::ProfileController::AutomaticConfigurationChange(), and LIDL::Controller::ProfileController::ManualGameConfigurationChanged().

Here is the caller graph for this function:

◆ GetProfileAsObject()

QJsonObject Profile::GetProfileAsObject ( ) const

GetProfileAsObject.

Returns
A JSON Object representing this profile

References _exeList, _name, _parent, _PTTKeySequence, _PTTScanCode, _PTTVirtualKey, _sounds, and GetName().

Here is the call graph for this function:

◆ GetPttKeySequence()

QKeySequence Profile::GetPttKeySequence ( ) const

SetPttKeySequence.

Parameters
sequenceGets this profile Push To Talk QKeySequence

References _PTTKeySequence.

Referenced by LIDL::Controller::ProfileController::AddProfile().

Here is the caller graph for this function:

◆ GetPttScanCode()

int Profile::GetPttScanCode ( ) const

GetPttScanCode.

Returns
Gets this profile Push To Talk Scan Code

References _PTTScanCode.

Referenced by LIDL::Controller::ProfileController::AddProfile(), and LIDL::Controller::SettingsController::holdPTT().

Here is the caller graph for this function:

◆ GetPttVirtualKey()

int Profile::GetPttVirtualKey ( ) const

GetPttVirtualKey.

Returns
Gets this profile Push To Talk Virtual Key

References _PTTVirtualKey.

Referenced by LIDL::Controller::ProfileController::AddProfile(), and LIDL::Controller::SettingsController::holdPTT().

Here is the caller graph for this function:

◆ GetSounds()

QVector< std::shared_ptr< SoundWrapper > > Profile::GetSounds ( ) const

GetSounds.

Returns
The sounds associated with this profile

References _sounds.

Referenced by LIDL::Controller::ProfileController::AddProfile(), LIDL::Controller::ProfileController::AutomaticConfigurationChange(), and LIDL::Controller::ProfileController::ManualGameConfigurationChanged().

Here is the caller graph for this function:

◆ IsContainingExe()

bool Profile::IsContainingExe ( QString  exe) const

IsExeHere Search for an executable in _exeList.

Returns
true is found, false otherwise

References _exeList.

◆ RemoveSoundFromSharedPtr()

void Profile::RemoveSoundFromSharedPtr ( std::shared_ptr< SoundWrapper wrapper)

RemoveSoundFromSharedPtr.

Parameters
wrappera shared_ptr

Will remove a shared_ptr from the QVector (when the sound was deleted or replaced in the main UI)

References _sounds.

Referenced by SoundboardMainUI::SoundboardMainUI().

Here is the caller graph for this function:

◆ SetName()

void Profile::SetName ( QString  newName)

SetName.

Parameters
newNameSet the name, useful when editing profiles.

References _name.

◆ SetPttKeySequence()

void Profile::SetPttKeySequence ( QKeySequence  sequence)

SetPttKeySequence.

Parameters
sequenceSets this profile Push To Talk QKeySequence

References _PTTKeySequence.

Referenced by LIDL::Controller::ProfileController::AddProfile(), and SoundboardMainUI::SoundboardMainUI().

Here is the caller graph for this function:

◆ SetPttScanCode()

void Profile::SetPttScanCode ( int  sc)

SetPttScanCode.

Parameters
scSets this profile Push To Talk Scan Code

References _PTTScanCode.

Referenced by LIDL::Controller::ProfileController::AddProfile(), and SoundboardMainUI::SoundboardMainUI().

Here is the caller graph for this function:

◆ SetPttVirtualKey()

void Profile::SetPttVirtualKey ( int  vk)

SetPttVirtualKey.

Parameters
vkSet this profile Push To Talk Virtual Key

References _PTTVirtualKey.

Referenced by LIDL::Controller::ProfileController::AddProfile(), and SoundboardMainUI::SoundboardMainUI().

Here is the caller graph for this function:

◆ SwapGames()

void Profile::SwapGames ( QSet< QString >  newListHYPERBRUH)

SwapGames.

Parameters
newListHYPERBRUHSwap the executable list by the new list, useful when edition profiles.

References _exeList.

◆ SwapSound()

void Profile::SwapSound ( std::shared_ptr< SoundWrapper oldWrapper,
std::shared_ptr< SoundWrapper newWrapper 
)

SwapSound.

Parameters
oldWrapper
newWrapperWill swap oldWrapper by newWrapper using shared_ptr<>::reset() Decreasing ref count of oldWrapper in the proccess

References _sounds.

Referenced by SoundboardMainUI::addSound().

Here is the caller graph for this function:

Member Data Documentation

◆ _exeList

QSet<QString> Profile::_exeList
private

◆ _name

QString Profile::_name
private

◆ _parent

Profile* Profile::_parent
private

Referenced by GetParent(), and GetProfileAsObject().

◆ _PTTKeySequence

QKeySequence Profile::_PTTKeySequence
private

◆ _PTTScanCode

int Profile::_PTTScanCode = -1
private

◆ _PTTVirtualKey

int Profile::_PTTVirtualKey = -1
private

◆ _sounds

QVector<std::shared_ptr<SoundWrapper> > Profile::_sounds
private

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