goldendict-ng/src/pronounceengine.hh
shenleban tongying 1fa0771716
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
fix: local audio files without extension are not added to dictAudioMap
2024-11-19 02:35:15 +00:00

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 );
};