mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-05 00:24:06 +00:00
b3d9d79816
* 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>
32 lines
610 B
C++
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
|