mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
* Sort *every* file into a doxygen group. Took 7 hours 9 minutes Took 18 seconds Took 2 minutes * Lint some ingroup definitions. Took 10 minutes Took 2 seconds * Just include the groups in the Doxyfile in this commit. Took 3 minutes * Update some group comments so they link! Took 14 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
48 lines
944 B
C++
48 lines
944 B
C++
/**
|
|
* @file sound_engine.h
|
|
* @ingroup Core
|
|
* @brief TODO: Document this.
|
|
*/
|
|
|
|
#ifndef SOUNDENGINE_H
|
|
#define SOUNDENGINE_H
|
|
|
|
#include <QAudioOutput>
|
|
#include <QLoggingCategory>
|
|
#include <QMap>
|
|
#include <QMediaPlayer>
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
inline Q_LOGGING_CATEGORY(SoundEngineLog, "sound_engine");
|
|
|
|
class QBuffer;
|
|
|
|
typedef QMap<QString, QString> QStringMap;
|
|
|
|
class SoundEngine : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit SoundEngine(QObject *parent = nullptr);
|
|
~SoundEngine() override;
|
|
void playSound(const QString &fileName);
|
|
QStringMap &getAvailableThemes();
|
|
|
|
private:
|
|
QStringMap availableThemes;
|
|
QMap<QString, QString> audioData;
|
|
QAudioOutput *audioOutput;
|
|
QMediaPlayer *player;
|
|
|
|
protected:
|
|
void ensureThemeDirectoryExists();
|
|
private slots:
|
|
void soundEnabledChanged();
|
|
void themeChangedSlot();
|
|
public slots:
|
|
void testSound();
|
|
};
|
|
|
|
extern SoundEngine *soundEngine;
|
|
#endif
|