diff --git a/data/audio/info/1 dont kn0w.wav b/data/audio/info/1 dont kn0w.wav deleted file mode 100644 index dccca3c..0000000 Binary files a/data/audio/info/1 dont kn0w.wav and /dev/null differ diff --git a/src/audio.cpp b/src/audio.cpp index 54bef29..9f66234 100755 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -71,3 +71,23 @@ void ImpAudio::setVolume(int i) qDebug() << "Volume changed to " << QString::number(volume, 'g', 2); } +void ImpAudio::playLocalMedia(const QString& fileName) +{ + QString path = appFilesPath() + "/audio/" + fileName; + + qDebug() << "Playing " << path; + + player = new QMediaPlayer; + //connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64))); + player->setMedia(QUrl::fromLocalFile(path)); + player->setVolume(50); + player->play(); +} + +void ImpAudio::stopMusic() +{ + if(player != NULL && player->state() == player->PlayingState) + { + player->stop(); + } +} diff --git a/src/audio.h b/src/audio.h index 08616df..ea003b1 100755 --- a/src/audio.h +++ b/src/audio.h @@ -23,6 +23,7 @@ #include #include +#include #include class ImpAudio : public QObject @@ -32,6 +33,10 @@ class ImpAudio : public QObject explicit ImpAudio(QObject *parent = 0); QSoundEffect* playLocalFile(const QString& fileName); + + void playLocalMedia(const QString& fileName); + void stopMusic(); + void setVolume(int i); signals: @@ -41,6 +46,8 @@ public slots: private: qreal volume = 1.0f; + + QMediaPlayer* player; }; #endif // AUDIO_H diff --git a/src/imp.pro b/src/imp.pro index ea018c3..bcdd8c2 100644 --- a/src/imp.pro +++ b/src/imp.pro @@ -12,7 +12,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = imp TEMPLATE = app -VERSION = 0.6.0 +VERSION = 0.6.1 QMAKE_TARGET_COMPANY = EternalDusk QMAKE_TARGET_DESCRIPTION = Eve Online Intelligence Management Program QMAKE_TARGET_COPYRIGHT = (c) Copyright 2016-2017 Jesse Litton diff --git a/src/info.cpp b/src/info.cpp index 3359c5a..68b0412 100755 --- a/src/info.cpp +++ b/src/info.cpp @@ -39,17 +39,23 @@ Info::~Info() void Info::on_okayButton_accepted() { hide(); - music->stop(); + //music->stop(); + if(m_audio != NULL) + m_audio->stopMusic(); } void Info::reject() { hide(); - music->stop(); + //music->stop(); + if(m_audio != NULL) + m_audio->stopMusic(); } void Info::startMusic(ImpAudio *audio) { - music = audio->playLocalFile("info/1 dont kn0w.wav"); - music->setLoopCount(QSoundEffect::Infinite); + m_audio = audio; + //music = + audio->playLocalMedia("info/1 dont kn0w.m4a"); + //music->setLoopCount(QSoundEffect::Infinite); } diff --git a/src/info.h b/src/info.h index ccabcaa..513b943 100755 --- a/src/info.h +++ b/src/info.h @@ -48,6 +48,7 @@ private slots: Ui::Info *ui; QSoundEffect* music; + ImpAudio* m_audio = NULL; }; #endif // INFO_H diff --git a/src/meta.h b/src/meta.h index e63b3a0..6bb39ec 100644 --- a/src/meta.h +++ b/src/meta.h @@ -25,7 +25,7 @@ static const struct Version { - QString release = "v0.6.0"; + QString release = "v0.6.1"; QString name = "Vrykolokas Osmosis"; QString styleHeader1 = "";