Add destructors to sound objects
This commit is contained in:
parent
5bd40225bd
commit
4c5bafdcad
@ -7,6 +7,12 @@ AOBlipPlayer::AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app)
|
||||
ao_app = p_ao_app;
|
||||
}
|
||||
|
||||
AOBlipPlayer::~AOBlipPlayer()
|
||||
{
|
||||
m_sfxplayer->stop();
|
||||
m_sfxplayer->deleteLater();
|
||||
}
|
||||
|
||||
void AOBlipPlayer::set_blips(QString p_sfx)
|
||||
{
|
||||
m_sfxplayer->stop();
|
||||
@ -23,6 +29,5 @@ void AOBlipPlayer::blip_tick()
|
||||
void AOBlipPlayer::set_volume(int p_value)
|
||||
{
|
||||
m_volume = p_value;
|
||||
float volume = p_value / 100.0f;
|
||||
m_sfxplayer->setVolume(qreal(volume));
|
||||
m_sfxplayer->setVolume(p_value / 100.0);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ class AOBlipPlayer
|
||||
{
|
||||
public:
|
||||
AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app);
|
||||
~AOBlipPlayer();
|
||||
|
||||
void set_blips(QString p_sfx);
|
||||
void blip_tick();
|
||||
|
@ -10,6 +10,7 @@ AOMusicPlayer::AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app)
|
||||
AOMusicPlayer::~AOMusicPlayer()
|
||||
{
|
||||
m_player->stop();
|
||||
m_player->deleteLater();
|
||||
}
|
||||
|
||||
void AOMusicPlayer::play(QString p_song)
|
||||
|
@ -7,6 +7,12 @@ AOSfxPlayer::AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app)
|
||||
ao_app = p_ao_app;
|
||||
}
|
||||
|
||||
AOSfxPlayer::~AOSfxPlayer()
|
||||
{
|
||||
m_sfxplayer->stop();
|
||||
m_sfxplayer->deleteLater();
|
||||
}
|
||||
|
||||
void AOSfxPlayer::play(QString p_sfx, QString p_char)
|
||||
{
|
||||
m_sfxplayer->stop();
|
||||
@ -31,6 +37,5 @@ void AOSfxPlayer::stop()
|
||||
void AOSfxPlayer::set_volume(int p_value)
|
||||
{
|
||||
m_volume = p_value;
|
||||
float volume = p_value / 100.0f;
|
||||
m_sfxplayer->setVolume(qreal(volume));
|
||||
m_sfxplayer->setVolume(p_value / 100.0);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ class AOSfxPlayer
|
||||
{
|
||||
public:
|
||||
AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app);
|
||||
~AOSfxPlayer();
|
||||
|
||||
void play(QString p_sfx, QString p_char = "");
|
||||
void stop();
|
||||
|
Loading…
Reference in New Issue
Block a user