当前位置:网站首页>QT audio playback upgrade (7)
QT audio playback upgrade (7)
2022-06-27 15:54:00 【Burn slowly】
1. install multimedia rely on
# sudo apt install libqt5multimedia5-plugins
2. Create project code
# mkdir qt
# cd qt
<1>.main.cpp
# emacs main.cpp
#include <QtCore/QCoreApplication>
#include <QtMultimedia/QMediaPlayer>
#include <QEventLoop>
#include "player.h"
int main(int argc, char *argv[]){
QCoreApplication a(argc, argv);
Player player;
return a.exec();
}
<2>.player.h
# emacs player.h
#ifndef PLAYER_H
#define PLAYER_H
#include <QObject>
#include <QMediaPlayer>
class QMediaPlayer;
class Player : public QObject{
Q_OBJECT
public:
explicit Player(QObject *parent = nullptr);
signals:
public slots:
void slotStatusChnaged(QMediaPlayer::State newState);
void errorStatuschanged(QMediaPlayer::Error error );
private:
QMediaPlayer * player ;
};
#endif // PLAYER_H
<3>.player.cpp
# emacs player.cpp
#include "player.h"
#include <QMediaPlayer>
#include <QCoreApplication>
#边栏推荐
- 事务的四大特性
- [170] the PostgreSQL 10 field type is changed from string to integer, and the error column cannot be cast automatically to type integer is reported
- Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
- 【Pygame小游戏】这款“吃掉一切”游戏简直奇葩了?通通都吃掉嘛?(附源码免费领)
- #27ES6的数值扩展
- 域名绑定动态IP最佳实践
- Design principles and ideas: design principles
- 【170】PostgreSQL 10字段类型从字符串修改成整型,报错column cannot be cast automatically to type integer
- NFT双币质押流动性挖矿dapp合约定制
- Centos8 PostgreSQL initialization error: initdb: error: invalid locale settings; check LANG and LC_* environment
猜你喜欢

Admixture usage document Cookbook

【Pygame小游戏】这款“吃掉一切”游戏简直奇葩了?通通都吃掉嘛?(附源码免费领)

Today, Teng Xu came out with 37k during the interview. It's really a miracle. He showed me his skill
The role of the symbol @ in MySQL

A distribution fission activity is more than just a circle of friends!

Weekly snapshot of substrate technology 20220411

List转Table

VS编译遇到的问题

开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事

带你认识图数据库性能和场景测试利器LDBC SNB
随机推荐
SQL injection principle
洛谷入门2【分支结构】题单题解
Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
If you want to use DMS to handle database permissions, can you only use Alibaba cloud ram accounts (Alibaba cloud RDS)
我想买固收+产品,但是不了解它主要投资哪些方面,有人知道吗?
[issue 17] golang's one-year experience in developing Meitu
Design of spread spectrum communication system based on FPGA (with main code)
Google tool splits by specified length
About tensorflow using GPU acceleration
关于快速幂
避孕套巨头过去两年销量下降40% ,下降原因是什么?
Indexeddb learning materials
专用发票和普通发票的区别
Can polardb-x be accessed through the client of related tools as long as the client supporting JDBC / ODBC protocol is afraid?
Sigkdd22 | graph generalization framework of graph neural network under the paradigm of "pre training, prompting and fine tuning"
带你认识图数据库性能和场景测试利器LDBC SNB
老师能给我说一下固收+产品主要投资于哪些方面?
泰山OFFICE技术讲座:第一难点是竖向定位
洛谷_P1008 [NOIP1998 普及组] 三连击_枚举
Keep valid digits; Keep n digits after the decimal point;