1 Star 1 Fork 0

chenhaoyang2019/pcmPlayer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mainwindow.h 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
chenhaoyang2019 提交于 2020-06-03 22:40 . add ...
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QAudioFormat>
#include <QAudioOutput>
#include <QIODevice>
#include <QTimer>
#include <QThread>
namespace Ui {
class MainWindow;
}
class MainWindow;
class AudioPlayThread :public QThread
{
Q_OBJECT
public:
AudioPlayThread(MainWindow *parent);
void stopPlay();
~AudioPlayThread();
private:
void run();
MainWindow *m_parent;
signals:
void updatePregressValue(unsigned int value);
void playEnd();
private:
bool m_isExit;
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
int playFrame(const char *data, unsigned int len);
const char *getFileName();
unsigned int getFrameSize();
unsigned int getPorgressParTotal();
void setPorgressParValue(unsigned int value);
void setPorgressParMaxValue(unsigned int maxValue);
void stopPlay();
~MainWindow();
private slots:
void on_actionOpen_triggered();
void on_play_clicked();
void on_pushButton_2_clicked();
void resizeEvent(QResizeEvent *e);
signals:
void stop();
private:
Ui::MainWindow *ui;
std::string m_fileName;
QAudioOutput *m_audioOutput;
QIODevice *m_streamOut;
unsigned int m_perFrameSize;
AudioPlayThread *workThread;
bool worked;
};
#endif // MAINWINDOW_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/chenhaoyang2019/pcmPlayer.git
[email protected]:chenhaoyang2019/pcmPlayer.git
chenhaoyang2019
pcmPlayer
pcmPlayer
master

搜索帮助