mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 19:13:55 -07:00
Rework the sound engine to use QSound
plus misc fixes
This commit is contained in:
parent
6d56e0dfd6
commit
a06c7b2f9d
3 changed files with 40 additions and 115 deletions
|
|
@ -2,30 +2,12 @@
|
|||
#define SOUNDENGINE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QMap>
|
||||
#include <QDateTime>
|
||||
#include <QStringList>
|
||||
#if QT_VERSION > 0x050000
|
||||
#include <QMediaPlayer>
|
||||
#endif
|
||||
|
||||
class QAudioOutput;
|
||||
class QBuffer;
|
||||
|
||||
class SoundEngine : public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QMap<QString, QByteArray> audioCache;
|
||||
QBuffer *inputBuffer;
|
||||
QAudioOutput *audio;
|
||||
bool enabled;
|
||||
QStringList fileNames;
|
||||
|
||||
#if QT_VERSION > 0x050000
|
||||
QMap<QString, QMediaPlayer*> audioData;
|
||||
#endif
|
||||
private slots:
|
||||
void cacheData();
|
||||
void soundEnabledChanged();
|
||||
public:
|
||||
SoundEngine(QObject *parent = 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue