servatrice/cockatrice/src/soundengine.h
Matt Lowe c64eeb4ebe Added sound settings page
+ added sound setting page
+ added sound setting icon
+ moved sound settings from interface settings

Added master volume

+ added master volume slider.
+ volume can be changed by sliding bar or by using the spin box
+ Preview of  volume will be played when dragging and releasing bar.

Added checks for qt4

Qt4 does not have support for setting the volume without some lengthy
work around, I have disabled volume control for qt4 users and have
mentioned that "Master volume requires qt5".

Updated sfx

+ removed all old sfx
+ added new end step and tap sound
+ tap/endstep sound has a timer on it to prevent spamming
+ test sound engine will now use endstep sound

Made end step sfx softer

end step felt too harsh

Added player joined sound

+ added a sound for when a new player joins a room

Updated

Was missing a sound when a player joins

Made end step softer

Made end step even softer

updated sound again
2015-05-06 12:47:48 +02:00

33 lines
631 B
C++

#ifndef SOUNDENGINE_H
#define SOUNDENGINE_H
#include <QObject>
#include <QMap>
#include <QDateTime>
class QAudioOutput;
class QBuffer;
class SoundEngine : public QObject {
Q_OBJECT
private:
void playSound(const QString &fileName);
QMap<QString, QByteArray> audioData;
QBuffer *inputBuffer;
QAudioOutput *audio;
QDateTime lastTapPlayed;
QDateTime lastEndStepPlayed;
private slots:
void cacheData();
void soundEnabledChanged();
public:
SoundEngine(QObject *parent = 0);
public slots:
void endStep();
void tap();
void playerJoined();
};
extern SoundEngine *soundEngine;
#endif