-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSample.h
More file actions
62 lines (44 loc) · 1.22 KB
/
Copy pathSample.h
File metadata and controls
62 lines (44 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef SAMPLE_H
#define SAMPLE_H
#include <QObject>
#include <QSound>
#include "Downloader.h"
#include "Config.h"
class Sample : public QObject
{
Q_OBJECT
public:
explicit Sample(const QString &uuid);
~Sample();
static QString mediaPath;
static QObject* qmlLibrary;
static Sample* create(const QString &name, const QString &uuid, const QString &cat);
static Sample* create(const QString &uuid);
void setName(const QString &name) { _name = name; }
QString name() { return _name; }
QString uuid() { return _uuid; }
void setCategory(const QString &category) { _category = category; }
QString category() { return _category; }
bool hasSound() { return _sound != nullptr; }
void setQmlObject(QObject* qmlObject);
bool addedToLibrary();
private:
QObject* _qmlObject;
QString _name;
QString _uuid;
QString _category;
QSound* _sound;
QString _soundPath;
void loadSound();
void downloadSound();
bool _mute;
void delFile();
private slots:
void soundDownloaded(QNetworkReply *reply);
void play();
void stop();
void addToLibrary();
void delFromLibrary();
void change(QString, QString, QString);
};
#endif // SAMPLE_H