#ifndef SCSTWSTARTSOUNDPLAYER_H #define SCSTWSTARTSOUNDPLAYER_H #include #include #include #include #include #include #include class ScStwSoundPlayer : public QObject { Q_OBJECT public: explicit ScStwSoundPlayer(QObject *parent = nullptr); private: QMap soundFiles; QFile *falseStartSoundFile; QAudioOutput *audioOutput; QEventLoop *waitLoop; QTimer *waitTimer; int currentlyPlayingAction; public slots: bool play(int action, double volume, double *timeOfStop = nullptr); bool cancel(double volume); bool waitForSoundFinish(double *timeOfStop = nullptr); //int interrupt(); private slots: void handleStateChanged(QAudio::State newState); signals: void playbackStarted(); }; #endif // SCSTWSTARTSOUNDPLAYER_H