goldendict-ng/src/pronounceengine.hh
xiaoyifang b3d9d79816
fix: pronounce the first dictionary audio if availabe (#981)
* fix: pronounce the first dictionary audio if availabe

fix #978

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-07-18 07:57:02 +08:00

32 lines
610 B
C++

#ifndef PRONOUNCEENGINE_HH
#define PRONOUNCEENGINE_HH
#include <QObject>
#include <QMap>
#include <QMutex>
enum class PronounceState {
AVAILABLE,
OCCUPIED
};
class PronounceEngine: public QObject
{
Q_OBJECT
PronounceState state = PronounceState::AVAILABLE;
QMutex mutex;
QMap< std::string, QList< QString > > dictAudioMap;
public:
explicit PronounceEngine( QObject * parent = nullptr );
void reset();
void sendAudio( std::string dictId, QString audioLink );
void finishDictionary( std::string dictId );
signals:
void emitAudio( QString audioLink );
};
#endif // PRONOUNCEENGINE_HH