-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsoundstorage.h
40 lines (31 loc) · 955 Bytes
/
soundstorage.h
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
#ifndef SOUNDSTORAGE_H
#define SOUNDSTORAGE_H
# include <QObject>
# include <QPair>
# include <QList>
# include <QHash>
# include "sound.h"
# include "playlist.h"
class SoundStorage : public QObject
{
Q_OBJECT
public:
explicit SoundStorage(QObject *parent = 0);
Sound getSoundById(int id) const;
Playlist getPlaylistById(int id) const;
signals:
void playlistsUpdated(QList<int> newPlaylistIds);
void likesUpdated(QList<int> newLikeIds);
void activitiesUpdated(QList< QPair<int, QString> > newActivities);
public slots:
void fill();
private slots:
void updateLikes(QList<Sound> newLikes);
void updatePlaylists(QList<Sound> containedSongs, QList<Playlist> newPlaylists);
void updateActivities(QList< QPair<int,QString> > idsAndTypes, QList<Sound> sounds, QList<Playlist> playlists);
// --- attributes
private:
QHash<int, Sound> sounds;
QHash<int, Playlist> playlists;
};
#endif // SOUNDSTORAGE_H