#ifndef WXANSWER_H
#define WXANSWER_H


#include "CWebsocketProc.h"
#include "wPictureList.h"
#include "CHttpBll.h"
#include "CBaseWidget.h"

#include <QTimer>

namespace Ui {
class wxAnswer;
}

class wxAnswer : public CBaseWidget
{
    Q_OBJECT
signals:
    void picConfirm(QString sFileUrls);
    void audioAnswered(QString sFileUrl);
	void exit();
public:
    explicit wxAnswer(QString sAnswerType, int nOrder, QWidget *parent = nullptr);
    ~wxAnswer();
    int setUI(const int nWidth);
    int widgetType();
    QString getFileUrl();
    void setAnswer(QString sAnswer);
    void setPics(QString sFileUrls);
private slots:
    void onGetWXQrCode(CGetWXQrCode getWXQrCode);

    void onMobileStatus(__int64 nExamRecordDataId, int nOrder, QString sScanStatus);
    void onFileAnswer(__int64 nExamRecordDataId, int nOrder, QString sFileType, QString sFileUrl);
    void onSaveUploadedFileAcknowledgeStatus(CSaveUploadedFileAcknowledgeStatus saveUploadedFileAcknowledgeStatus);
    void onDownLoadFile(CDownLoadFileInfo downLoadFileInfo);


    void on_btn_wxa_close_clicked();

    void on_btn_wxa_comfirm_clicked();



    void on_btn_etvt_play_clicked();

    void on_hslider_etvt_volume_valueChanged(int value);

    void on_btn_etvt_volume_clicked();

private:
    Ui::wxAnswer *ui;
    int m_nOrder;
    QString m_sAnswerType;
    QString m_sFileUrl;
    std::shared_ptr<wPictureList> m_picList;

    int m_nPlayVol;

    std::shared_ptr<QTimer> m_pTimer;
    int m_nAudioSecord;
    std::string m_sRecordDevice;

    bool m_bMute = false;
    int m_nLastVol = 0;
};

#endif // WXANSWER_H
