#ifndef AUDIOPLAY_H
#define AUDIOPLAY_H

#include <QWidget>
#include <QTimer>
#include "json/json.h"
#include "CBaseWidget.h"
#include "CHttpBll.h"

namespace Ui {
class audioPlay;
}

class audioPlay : public CBaseWidget
{
    Q_OBJECT

public:
    explicit audioPlay(QString sAudioName,  QString sAudioUrl, int nlimitedPlayTimes, QWidget *parent = nullptr);
    ~audioPlay();

    int setUI(const int nWidth);
    int widgetType();

	void getPalyedCount(QString &name, int &nCount);
signals:
    void playedCountChange();
private slots:
    void on_btn_ap_play_clicked();
    void timeOut();      

    void onDownLoadFile(CDownLoadFileInfo downLoadFileInfo);
private:
    bool eventFilter(QObject *obj, QEvent *ev);

    Ui::audioPlay *ui;


    QTimer *m_pTimer;
    int m_nTestSecord = 0;
    int m_nMaxTestSecord = 0;
    int m_nPlayVol = 0;
    std::string m_sRecordDevice = "";
    QString m_sAudioName = "";
    QString m_sAudioUrl = "";
    int m_nLeftPalyCount = 0;
    int m_nPlayedCont = 0;
};

#endif // audioPlay_H
