mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-27 22:03:20 +00:00
* add volume slider * add translations * stop music when checkbox unchecked * remove GUI build command args * combine functions * add accidentaly removed copyright and licencing information (thanks QT Designer)
29 lines
651 B
C++
29 lines
651 B
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QAudioOutput>
|
|
#include <QMediaPlayer>
|
|
#include <QObject>
|
|
|
|
class BackgroundMusicPlayer : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static BackgroundMusicPlayer& getInstance() {
|
|
static BackgroundMusicPlayer instance;
|
|
return instance;
|
|
}
|
|
|
|
void setVolume(int volume);
|
|
void playMusic(const QString& snd0path);
|
|
void stopMusic();
|
|
|
|
private:
|
|
BackgroundMusicPlayer(QObject* parent = nullptr);
|
|
|
|
QMediaPlayer* m_mediaPlayer;
|
|
QAudioOutput* m_audioOutput;
|
|
QUrl m_currentMusic;
|
|
};
|