vvave.h 1015 Bytes
Newer Older
Camilo higuita's avatar
Camilo higuita committed
1 2 3 4
#ifndef VVAVE_H
#define VVAVE_H

#include <QObject>
5 6
#include "utils/bae.h"
#include <functional>
Camilo higuita's avatar
Camilo higuita committed
7

8
class CollectionDB;
Camilo higuita's avatar
Camilo higuita committed
9 10 11
class vvave : public QObject
{
    Q_OBJECT
12 13 14 15
private:
    CollectionDB *db;
    void checkCollection(const QStringList &paths = BAE::defaultSources, std::function<void (uint)> cb = nullptr);

16
    void emitSignal();
Camilo higuita's avatar
Camilo higuita committed
17 18
public:
    explicit vvave(QObject *parent = nullptr);
19
    ~vvave();
Camilo higuita's avatar
Camilo higuita committed
20 21

signals:
22 23 24 25
    void refreshTables(uint size);
    void refreshTracks();
    void refreshAlbums();
    void refreshArtists();
Camilo higuita's avatar
Camilo higuita committed
26
    void openFiles(QVariantList tracks);
Camilo higuita's avatar
Camilo higuita committed
27 28

public slots:
29 30
    ///DB Interfaces
    /// useful functions for non modeled views and actions with not direct access to a tracksmodel or its own model
Camilo higuita's avatar
Camilo higuita committed
31
    QVariantList sourceFolders();
32
    bool removeSource(const QString &source);
33
    static QString moodColor(const int &index);
Camilo higuita's avatar
Camilo higuita committed
34
    void scanDir(const QStringList &paths = BAE::defaultSources);
35 36

    QStringList getSourceFolders();
Camilo higuita's avatar
Camilo higuita committed
37
    void openUrls(const QStringList &urls);
Camilo higuita's avatar
Camilo higuita committed
38 39 40
};

#endif // VVAVE_H