atrooney-online-2/aomusicplayer.cpp
Cerapter fe955d6923 Removed the dependency on bass.dll.
This is merely a reimplementation of Gameboyprinter's changes on the
main thing.
The only thing that's different from that one is that the options menu
has had its audio device removed, too.
2018-09-04 17:32:20 +02:00

28 lines
536 B
C++

#include "aomusicplayer.h"
AOMusicPlayer::AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app)
{
m_parent = parent;
ao_app = p_ao_app;
m_player = new QMediaPlayer();
}
AOMusicPlayer::~AOMusicPlayer()
{
m_player->stop();
m_player->deleteLater();
}
void AOMusicPlayer::play(QString p_song)
{
m_player->setMedia(QUrl::fromLocalFile(ao_app->get_music_path(p_song)));
this->set_volume(m_volume);
m_player->play();
}
void AOMusicPlayer::set_volume(int p_value)
{
m_volume = p_value;
m_player->setVolume(p_value);
}