61 lines
1.5 KiB
C++
Executable File
61 lines
1.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* SoundState class derivation for custom purposes.
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Filip Biedziak, NLE, 2020-08-26
|
|
*/
|
|
|
|
#include "efm_sound_state.h"
|
|
|
|
|
|
namespace EffectManagement
|
|
{
|
|
|
|
//=============================================================================================================================
|
|
// SOUNDSTATE
|
|
//=============================================================================================================================
|
|
|
|
SoundState::SoundState(const SoundManagement::SoundState &soundState)
|
|
: SoundManagement::SoundState(soundState)
|
|
{
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------------------------------------------------------
|
|
// PUBLIC MEMBER FUNCTIONS
|
|
//-----------------------------------------------------------------------------------------------------------------------------
|
|
|
|
void SoundState::status(Status stat)
|
|
{
|
|
m_status = stat;
|
|
}
|
|
|
|
void SoundState::duration(int secs)
|
|
{
|
|
if (secs > 0)
|
|
m_duration = std::max(0, secs);
|
|
}
|
|
|
|
void SoundState::timeLeft(int secs)
|
|
{
|
|
if (secs >= 0)
|
|
m_timeLeft = secs;
|
|
}
|
|
|
|
void SoundState::volume(int vol)
|
|
{
|
|
if (vol >= 0)
|
|
m_volume = vol;
|
|
}
|
|
|
|
|
|
QString SoundState::statusToString() const
|
|
{
|
|
if (m_status == Status::Active)
|
|
return QStringLiteral("Active");
|
|
return m_status == Status::Stop ? QStringLiteral("Stop") : QStringLiteral("Scheduled");
|
|
}
|
|
|
|
} // namespace EffectManagement
|