-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patheventlist.h
41 lines (33 loc) · 1.08 KB
/
eventlist.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
41
#ifndef EVENTLIST_H
#define EVENTLIST_H
#include <QObject>
#include <QVector>
#include <QJsonArray>
#include <memory>
class TimelineEvent;
class EventList : public QObject
{
Q_OBJECT
public:
void addEvent(const std::shared_ptr<TimelineEvent>& event);
void removeEvent(const std::shared_ptr<TimelineEvent>& event);
void removeEventsInRange(double start, double end);
QVector< std::shared_ptr<TimelineEvent> > eventsInRange(double start, double end) const;
inline QVector< std::shared_ptr<TimelineEvent> >::const_iterator begin() const {
return mEvents.cbegin();
}
inline QVector< std::shared_ptr<TimelineEvent> >::const_iterator end() const {
return mEvents.cend();
}
inline int size() const {
return mEvents.size();
}
QJsonArray toJSON() const;
void fromJSON(const QJsonArray& events);
signals:
void eventAdded(const std::shared_ptr<TimelineEvent>& event);
void eventRemoved(const std::shared_ptr<TimelineEvent>& event);
private:
QVector< std::shared_ptr<TimelineEvent> > mEvents;
};
#endif // EVENTLIST_H