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

Inherits QObject. More...

#include <soundwrapper.h>

Inheritance diagram for SoundWrapper:
Inheritance graph
Collaboration diagram for SoundWrapper:
Collaboration graph

Public Slots

void Play ()
 Tell the player to play the sound according to the playback mode. More...
 
void Stop ()
 Tell the player to stop playing the sound. More...
 
void OutputDeviceChanged (int)
 Set the main output device of the player according to the combo box in the UI. More...
 
void VACDeviceChanged (int)
 Set the VAC output device of the player according to the combo box in the UI. More...
 
void clearShorcut ()
 Clears the shortcut of the wrapper. (Display purposes) More...
 

Signals

void UnexistantFile ()
 Used to send warning to main ui that a file doesn't exist. More...
 
void ErrorPlaying (QString)
 Used to send a warning to main ui that an error happened playing a file. More...
 
void NowPlaying (QString)
 Used to send a message to main ui that a file is playing. More...
 
void holdPTTProxy (int)
 This signal is sent whenever the "holdPTT" signal of the player is sent. More...
 

Public Member Functions

 SoundWrapper (QObject *parent=nullptr)
 
 SoundWrapper (QVector< LIDL::SoundFile * > fileList, LIDL::Playback playbackMode, QKeySequence shortcut, int shortcutVirtualKey=-1, int mainOutput=-1, int vacOutput=-1, QObject *parent=nullptr)
 Main constructor of sound wrappers. More...
 
 SoundWrapper (QVector< QString > fileList, LIDL::Playback playbackMode, int mainVolume, int vacVolume, int mainOutput, int vacOutput, QObject *parent=nullptr)
 ILL EAGLE ILL EAGLE ILL EAGLE ILL EAGLE ILL EAGLE ILL EAGLE ILL EAGLE. More...
 
 SoundWrapper (SoundWrapper *&other)
 SoundWrapper. More...
 
QVector< LIDL::SoundFile * > getSoundList ()
 
QKeySequence getKeySequence ()
 
LIDL::Playback getPlayMode ()
 
QString getSoundListAsQString ()
 
QList< QStandardItem * > getSoundAsItem ()
 
int addSound (QString filename, float mainVolume=1.0, float vacVolume=1.0)
 Used by OpenEXPJson to add the revelant sound files. More...
 
void setPlayerMainOutput (int index)
 Set the index of the main output device. More...
 
void setPlayerVACOutput (int index)
 Set the index of the VAC output device. More...
 
int getMainDevice ()
 
int getVacDevice ()
 
unsigned int getShortcutVirtualKey ()
 
QJsonObject GetWrapperAsObject () const
 GetWrapperAsObject. More...
 

Private Member Functions

bool checkFileExistence (QString fileName)
 

Private Attributes

QVector< LIDL::SoundFile * > _soundList
 
LIDL::Playback _playMode
 
QKeySequence _keySequence
 
unsigned int _virtualKey
 
CustomPlayer_player
 

Friends

bool operator== (const SoundWrapper &a, const SoundWrapper &b)
 Deprecated. More...
 
bool operator!= (const SoundWrapper &a, const SoundWrapper &b)
 Deprecated. More...
 

Detailed Description

Inherits QObject.

Soundwrapper class contains all the data necessary to play one or several sounds, as well as a player capable of playing them.

Author
Devolution
Version
1.7.0
Since
0.3

Constructor & Destructor Documentation

◆ SoundWrapper() [1/4]

SoundWrapper::SoundWrapper ( QObject *  parent = nullptr)
explicit

◆ SoundWrapper() [2/4]

SoundWrapper::SoundWrapper ( QVector< LIDL::SoundFile * >  fileList,
LIDL::Playback  playbackMode,
QKeySequence  shortcut,
int  shortcutVirtualKey = -1,
int  mainOutput = -1,
int  vacOutput = -1,
QObject *  parent = nullptr 
)

Main constructor of sound wrappers.

Used to construct a soundwrapper object, used 99% of the time, except when opening EXP SOUNDBOARD json files.

Parameters
fileListThe wrapper's sound list. Each sound file is associated with two volumes (Main and VAC).
playbackModeThe playback mode of this wrapper.
shortcutThe keysequence to be displayed in the UI.
shortcutVirtualKey=-1, The shortcut's virtual key to be registered in the windows api.
mainOutputThe index of the main output.
vacOutputThe index of the VAC ouput
*parentA pointer to the parent (not used).

References _keySequence, _player, _playMode, _soundList, _virtualKey, getPlayMode(), getSoundList(), CustomPlayer::SetPlaybackMode(), setPlayerMainOutput(), setPlayerVACOutput(), and CustomPlayer::SetPlaylist().

Here is the call graph for this function:

◆ SoundWrapper() [3/4]

SoundWrapper::SoundWrapper ( QVector< QString >  fileList,
LIDL::Playback  playbackMode,
int  mainVolume,
int  vacVolume,
int  mainOutput,
int  vacOutput,
QObject *  parent = nullptr 
)

ILL EAGLE ILL EAGLE ILL EAGLE ILL EAGLE ILL EAGLE ILL EAGLE ILL EAGLE.

Main constructor of sound wrappers.

Used to construct a soundwrapper object when opening an EXP SOUNDBOARD json files.

Parameters
fileListThe wrapper's sound list. Each sound file is associated with two volumes (Main and VAC).
playbackModeThe playback mode of this wrapper.
shortcutThe keysequence to be displayed in the UI.
shortcutVirtualKey=-1, The shortcut's virtual key to be registered in the windows api.
mainOutputThe index of the main output.
vacOutputThe index of the VAC ouput
*parentA pointer to the parent (not used).

References _player, _playMode, addSound(), getPlayMode(), getSoundList(), CustomPlayer::SetPlaybackMode(), setPlayerMainOutput(), setPlayerVACOutput(), and CustomPlayer::SetPlaylist().

Here is the call graph for this function:

◆ SoundWrapper() [4/4]

SoundWrapper::SoundWrapper ( SoundWrapper *&  other)

SoundWrapper.

Parameters
otherUsed by when copying sound from another profile :)

References _player, _playMode, _soundList, CustomPlayer::GetOutputDevice(), getPlayMode(), getSoundList(), CustomPlayer::GetVACDevice(), CustomPlayer::SetPlaybackMode(), setPlayerMainOutput(), setPlayerVACOutput(), and CustomPlayer::SetPlaylist().

Here is the call graph for this function:

Member Function Documentation

◆ addSound()

int SoundWrapper::addSound ( QString  filename,
float  mainVolume = 1.0,
float  vacVolume = 1.0 
)

Used by OpenEXPJson to add the revelant sound files.

Parameters
filenamethe file to be added.
mainVolumemain output volume.
vacVolumeVAC output volume.

References _soundList.

Referenced by SoundWrapper().

Here is the caller graph for this function:

◆ checkFileExistence()

bool SoundWrapper::checkFileExistence ( QString  fileName)
private

◆ clearShorcut

void SoundWrapper::clearShorcut ( )
slot

Clears the shortcut of the wrapper. (Display purposes)

Will get called whenever clearing the shortcut is needed. Swap the existing key sequence with a blank one.

References _keySequence.

◆ ErrorPlaying

void SoundWrapper::ErrorPlaying ( QString  )
signal

Used to send a warning to main ui that an error happened playing a file.

Referenced by SoundboardMainUI::addSound(), and SoundWrapper().

Here is the caller graph for this function:

◆ getKeySequence()

QKeySequence SoundWrapper::getKeySequence ( )
Returns
QKeySequence The Key Sequence of the shortcut associated with the wrapper, in a human readable format.

References _keySequence.

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

Here is the caller graph for this function:

◆ getMainDevice()

int SoundWrapper::getMainDevice ( )
Returns
int The index of the main output device.

References _player, and CustomPlayer::GetOutputDevice().

Referenced by SoundboardMainUI::SwapWrappers().

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

◆ getPlayMode()

LIDL::Playback SoundWrapper::getPlayMode ( )
Returns
LIDL::Playback One of the playbackmode defined in "EnumsAndStruct.h".

References _playMode.

Referenced by getSoundAsItem(), SoundWrapper(), SoundboardMainUI::SwapWrappers(), and WrapperProperties::WrapperProperties().

Here is the caller graph for this function:

◆ getShortcutVirtualKey()

unsigned int SoundWrapper::getShortcutVirtualKey ( )
Returns
int The shortcut virtual key.

References _virtualKey.

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

Here is the caller graph for this function:

◆ getSoundAsItem()

QList< QStandardItem * > SoundWrapper::getSoundAsItem ( )
Returns
QList<QStandardItem*> Sound list as QList of QStandarItems*. Each sound will take 5 slots in the list: ListItem << Sound names << number of remotes files << SFX << Shortcut << Playback mode;

References _soundList, _virtualKey, LIDL::Auto, LIDL::AutoLoop, LIDL::Cancer, LIDL::CHORUS, LIDL::COMPRESSOR, LIDL::DISTORTION, LIDL::ECHO, LIDL::FLANGER, LIDL::GARGLE, getKeySequence(), getPlayMode(), getSoundListAsQString(), LIDL::Sequential, and LIDL::Singleton.

Here is the call graph for this function:

◆ getSoundList()

QVector< LIDL::SoundFile * > SoundWrapper::getSoundList ( )
Returns
QVector<LIDL::SoundFile*> The sound list of the wrapper.

References _soundList.

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

Here is the caller graph for this function:

◆ getSoundListAsQString()

QString SoundWrapper::getSoundListAsQString ( )
Returns
QString Sound list as a QString. Sounds are separated by "\#n".

References _soundList, and UnexistantFile().

Referenced by getSoundAsItem().

Here is the caller graph for this function:

◆ getVacDevice()

int SoundWrapper::getVacDevice ( )
Returns
int The index of the VAC output device.

References _player, and CustomPlayer::GetVACDevice().

Referenced by SoundboardMainUI::SwapWrappers().

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

◆ GetWrapperAsObject()

QJsonObject SoundWrapper::GetWrapperAsObject ( ) const

GetWrapperAsObject.

Returns

References _keySequence, _playMode, _soundList, and _virtualKey.

◆ holdPTTProxy

void SoundWrapper::holdPTTProxy ( int  )
signal

This signal is sent whenever the "holdPTT" signal of the player is sent.

It is used to tell the settingscontroller to hold the PTT key for the duration of the sound played.

Referenced by SoundboardMainUI::addSound(), and SoundWrapper().

Here is the caller graph for this function:

◆ NowPlaying

void SoundWrapper::NowPlaying ( QString  )
signal

Used to send a message to main ui that a file is playing.

Referenced by SoundboardMainUI::addSound(), and SoundWrapper().

Here is the caller graph for this function:

◆ OutputDeviceChanged

void SoundWrapper::OutputDeviceChanged ( int  index)
slot

Set the main output device of the player according to the combo box in the UI.

References _player, and CustomPlayer::SetOutputDevice().

Here is the call graph for this function:

◆ Play

void SoundWrapper::Play ( )
slot

Tell the player to play the sound according to the playback mode.

References _player, and CustomPlayer::PlayNext().

Here is the call graph for this function:

◆ setPlayerMainOutput()

void SoundWrapper::setPlayerMainOutput ( int  index)

Set the index of the main output device.

Parameters
indexThe new index

References _player, and CustomPlayer::SetOutputDevice().

Referenced by SoundWrapper().

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

◆ setPlayerVACOutput()

void SoundWrapper::setPlayerVACOutput ( int  index)

Set the index of the VAC output device.

Parameters
indexThe new index

References _player, and CustomPlayer::SetVACDevice().

Referenced by SoundWrapper().

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

◆ Stop

void SoundWrapper::Stop ( )
slot

Tell the player to stop playing the sound.

References _player, and CustomPlayer::Stop().

Here is the call graph for this function:

◆ UnexistantFile

void SoundWrapper::UnexistantFile ( )
signal

Used to send warning to main ui that a file doesn't exist.

This function will check if the local file exists (when opening a soundboard). It will also check if a remote file exists using a tcp/tsl socket to check the MIME type.

Referenced by SoundboardMainUI::addSound(), and getSoundListAsQString().

Here is the caller graph for this function:

◆ VACDeviceChanged

void SoundWrapper::VACDeviceChanged ( int  index)
slot

Set the VAC output device of the player according to the combo box in the UI.

References _player, and CustomPlayer::SetVACDevice().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const SoundWrapper a,
const SoundWrapper b 
)
friend

Deprecated.

Deprecated:
Used to be used to detect modification to prompt the user to save. Now, we compare entry save file, and what would be the output save file.
Parameters
aThe soundwrapper to be compared against.
bThe second soundwrapper.

◆ operator==

bool operator== ( const SoundWrapper a,
const SoundWrapper b 
)
friend

Deprecated.

Deprecated:
Used to be used to detect modification to prompt the user to save. Now, we compare entry save file, and what would be the output save file.
Parameters
aThe soundwrapper to be compared against.
bThe second soundwrapper.

Member Data Documentation

◆ _keySequence

QKeySequence SoundWrapper::_keySequence
private

Key Sequence of the shortcut playing the sound. Can be empty. Used for displayed purposes.

Referenced by clearShorcut(), getKeySequence(), GetWrapperAsObject(), operator==(), and SoundWrapper().

◆ _player

CustomPlayer* SoundWrapper::_player
private

Player that will play the sound according to their volume, SFX, and playback settings.

Referenced by getMainDevice(), getVacDevice(), OutputDeviceChanged(), Play(), setPlayerMainOutput(), setPlayerVACOutput(), SoundWrapper(), Stop(), and VACDeviceChanged().

◆ _playMode

LIDL::Playback SoundWrapper::_playMode
private

Variable holding the playback mode (enumeration defined in EnumsAndStruct.h .

Referenced by getPlayMode(), GetWrapperAsObject(), and SoundWrapper().

◆ _soundList

QVector<LIDL::SoundFile*> SoundWrapper::_soundList
private

◆ _virtualKey

unsigned int SoundWrapper::_virtualKey
private

Virtual Key of the shortcut playing the sound. Needed to register it into windows API.

Referenced by getShortcutVirtualKey(), getSoundAsItem(), GetWrapperAsObject(), operator==(), and SoundWrapper().


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