1 Star 0 Fork 0

tredy6t/Cloud-Music

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
localmusicmodel.h 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
lch. 提交于 2018-05-14 01:07 . 增加歌曲导入功能
#ifndef LOCALMUSICMODEL_H
#define LOCALMUSICMODEL_H
#include <QObject>
#include <QSqlTableModel>
#include <QMediaPlayer>
#include "libzplay.h"
using namespace libZPlay;
struct songInfo
{
QString Artist;
QString title;
QString album;
qint32 duration = 0;
QString path;
};
class LocalMusicModel : public QSqlTableModel
{
Q_OBJECT
Q_PROPERTY(int m_musicNum READ musicNum WRITE setMusicNum NOTIFY musicNumChanged)
public:
explicit LocalMusicModel(QObject *parent = nullptr);
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
Q_INVOKABLE void reloadMusicRecord(const QString &path);
int musicNum(){return m_musicNum;}
void setMusicNum(int val){
m_musicNum = val;
emit musicNumChanged();
}
signals:
void musicNumChanged();
private:
void parseMusicInfo(QString path);
void clearDb();
private:
ZPlay *player;
int m_musicNum = 0;
};
#endif // LOCALMUSICMODEL_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tredy6t/Cloud-Music.git
[email protected]:tredy6t/Cloud-Music.git
tredy6t
Cloud-Music
Cloud-Music
master

搜索帮助