mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
* 1/3 Add .clang-format file and travis compilation check * 2/3 Run clang-format * 3/3 Fix compilation problems due to include reordering * 3bis/3 AfterControlStatement: false
39 lines
730 B
C++
39 lines
730 B
C++
#ifndef SOUNDENGINE_H
|
|
#define SOUNDENGINE_H
|
|
|
|
#include <QDir>
|
|
#include <QMap>
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
class QAudioOutput;
|
|
class QBuffer;
|
|
|
|
typedef QMap<QString, QString> QStringMap;
|
|
|
|
class SoundEngine : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
SoundEngine(QObject *parent = 0);
|
|
~SoundEngine();
|
|
void playSound(QString fileName);
|
|
QStringMap &getAvailableThemes();
|
|
|
|
private:
|
|
QMap<QString, QByteArray> audioData;
|
|
QBuffer *inputBuffer;
|
|
QAudioOutput *player;
|
|
QStringMap availableThemes;
|
|
|
|
protected:
|
|
void ensureThemeDirectoryExists();
|
|
private slots:
|
|
void soundEnabledChanged();
|
|
void themeChangedSlot();
|
|
public slots:
|
|
void testSound();
|
|
};
|
|
|
|
extern SoundEngine *soundEngine;
|
|
#endif
|