clean structure
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
#include <QThread>
|
||||
#include <QMutex>
|
||||
#include "Track.h"
|
||||
|
||||
namespace engine {
|
||||
|
||||
class MusicLibrary : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static const inline QStringList SUPPORTED_EXTS =
|
||||
{ "mp3", "flac", "wav", "ogg", "aac", "m4a", "opus", "wma" };
|
||||
|
||||
explicit MusicLibrary(QObject *parent = nullptr);
|
||||
const QList<engine::Track> &tracks() const;
|
||||
const QString &rootPath() const;
|
||||
void setRootPath(const QString &path);
|
||||
void scan();
|
||||
void sortByArtistTitle();
|
||||
void shutdown();
|
||||
|
||||
signals:
|
||||
void scanStarted();
|
||||
void trackFound(const engine::Track &track);
|
||||
void scanComplete(int count);
|
||||
|
||||
private:
|
||||
QString m_root;
|
||||
QList<engine::Track> m_tracks;
|
||||
QThread *m_scanThread { nullptr };
|
||||
QMutex m_mtx;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user