#ifndef SOUNDPLAYER_H #define SOUNDPLAYER_H #include #include #include #include #include class SoundPlayWorker : public QObject { Q_OBJECT public: explicit SoundPlayWorker(); public slots: void play(const QString &filename); void playClick(); private: QMap map; QSound *current; QSoundEffect *click; }; class SoundPlayer : public QObject { Q_OBJECT explicit SoundPlayer(); void play(const QString &filename); void emitClick(); static SoundPlayer *instance; public: static void playClick(); static void playStart(); static void playStop(); static void playError1(); static void playError2(); signals: void operate(const QString &); void click(); }; #endif // SOUNDPLAYER_H