XJ music engine  1.9.6
In-game runtime engine for XJ music.
AudioScheduleEvent.h
Go to the documentation of this file.
1 // Copyright (c) XJ Music Inc. (https://xjmusic.com) All Rights Reserved.
2 
3 #ifndef XJMUSIC_AUDIO_SCHEDULE_EVENT_H
4 #define XJMUSIC_AUDIO_SCHEDULE_EVENT_H
5 
6 #include "ActiveAudio.h"
7 
8 namespace XJ {
9 
11  public:
12 
13  enum class EType {
14  Create,
15  Update,
16  Delete
17  };
18 
21 
27  explicit AudioScheduleEvent(
28  EType type,
29  ActiveAudio audio
30  );
31 
36  [[nodiscard]] unsigned long long getStartAtChainMicros() const {
37  return this->schedule.getStartAtChainMicros();
38  }
39 
45  bool operator<(const AudioScheduleEvent &rhs) const {
46  return this->getStartAtChainMicros() < rhs.getStartAtChainMicros();
47  }
48 
54  static std::string toString(const EType &type);
55 
61  static EType parseType(const std::string &value);
62  };
63 
64 } // XJ
65 
66 #endif //XJMUSIC_AUDIO_SCHEDULE_EVENT_H
Definition: ActiveAudio.h:14
unsigned long long getStartAtChainMicros() const
Definition: ActiveAudio.cpp:43
Definition: AudioScheduleEvent.h:10
static EType parseType(const std::string &value)
Definition: AudioScheduleEvent.cpp:27
ActiveAudio schedule
Definition: AudioScheduleEvent.h:20
AudioScheduleEvent(EType type, ActiveAudio audio)
Definition: AudioScheduleEvent.cpp:17
EType type
Definition: AudioScheduleEvent.h:19
bool operator<(const AudioScheduleEvent &rhs) const
Definition: AudioScheduleEvent.h:45
static std::string toString(const EType &type)
Definition: AudioScheduleEvent.cpp:23
EType
Definition: AudioScheduleEvent.h:13
unsigned long long getStartAtChainMicros() const
Definition: AudioScheduleEvent.h:36
Definition: ActiveAudio.h:11