mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
29 lines
555 B
C++
29 lines
555 B
C++
#pragma once
|
|
|
|
#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( const std::string & dictId, const QString & audioLink );
|
|
void finishDictionary( std::string dictId );
|
|
signals:
|
|
void emitAudio( QString audioLink );
|
|
};
|