XJ music engine  1.9.6
In-game runtime engine for XJ music.
ActiveAudio.h
Go to the documentation of this file.
1 // Copyright (c) XJ Music Inc. (https://xjmusic.com) All Rights Reserved.
2 
3 #ifndef XJMUSIC_WORK_ACTIVE_AUDIO_H
4 #define XJMUSIC_WORK_ACTIVE_AUDIO_H
5 
9 
10 namespace XJ
11 {
12 
14  {
15  UUID id;
16 
17  protected:
21  unsigned long long startAtChainMicros;
22  unsigned long long stopAtChainMicros;
23  float fromVolume;
24  float toVolume;
25  public:
28  const Instrument* instrument,
29  const InstrumentAudio* audio,
30  unsigned long long startAtChainMicros,
31  unsigned long long stopAtChainMicros,
32  float fromIntensity,
33  float toIntensity);
34 
35  [[nodiscard]] float getFromVolume() const;
36 
37  [[nodiscard]] float getToVolume() const;
38 
39  [[nodiscard]] UUID getId() const;
40 
41  [[nodiscard]] const SegmentChoiceArrangementPick* getPick() const;
42 
43  [[nodiscard]] const Instrument* getInstrument() const;
44 
45  [[nodiscard]] unsigned long long getStartAtChainMicros() const;
46 
47  [[nodiscard]] unsigned long long getStopAtChainMicros() const;
48 
49  [[nodiscard]] const InstrumentAudio* getAudio() const;
50 
51  [[nodiscard]] int getReleaseMillis() const;
52 
59  [[nodiscard]] float getAmplitude(float ap) const;
60 
67  friend bool operator<(const ActiveAudio& lhs, const ActiveAudio& rhs)
68  {
69  return lhs.getId() < rhs.getId();
70  }
71 
78  friend bool operator>(const ActiveAudio& lhs, const ActiveAudio& rhs)
79  {
80  return lhs.getId() > rhs.getId();
81  }
82 
89  friend bool operator==(const ActiveAudio& lhs, const ActiveAudio& rhs)
90  {
91  return lhs.getId() == rhs.getId()
94  && lhs.getFromVolume() == rhs.getFromVolume()
95  && lhs.getToVolume() == rhs.getToVolume();
96  }
97 
104  friend bool operator!=(const ActiveAudio& lhs, const ActiveAudio& rhs)
105  {
106  return !(lhs == rhs);
107  }
108  };
109 
110 } // namespace XJ
111 
112 #endif // XJMUSIC_WORK_ACTIVE_AUDIO_H
Definition: ActiveAudio.h:14
friend bool operator<(const ActiveAudio &lhs, const ActiveAudio &rhs)
Definition: ActiveAudio.h:67
float toVolume
Definition: ActiveAudio.h:24
unsigned long long getStopAtChainMicros() const
Definition: ActiveAudio.cpp:48
unsigned long long stopAtChainMicros
Definition: ActiveAudio.h:22
ActiveAudio(const SegmentChoiceArrangementPick *pick, const Instrument *instrument, const InstrumentAudio *audio, unsigned long long startAtChainMicros, unsigned long long stopAtChainMicros, float fromIntensity, float toIntensity)
Definition: ActiveAudio.cpp:7
UUID getId() const
Definition: ActiveAudio.cpp:28
const InstrumentAudio * getAudio() const
Definition: ActiveAudio.cpp:53
friend bool operator!=(const ActiveAudio &lhs, const ActiveAudio &rhs)
Definition: ActiveAudio.h:104
float getToVolume() const
Definition: ActiveAudio.cpp:75
int getReleaseMillis() const
Definition: ActiveAudio.cpp:58
const InstrumentAudio * audio
Definition: ActiveAudio.h:20
unsigned long long getStartAtChainMicros() const
Definition: ActiveAudio.cpp:43
unsigned long long startAtChainMicros
Definition: ActiveAudio.h:21
const Instrument * instrument
Definition: ActiveAudio.h:19
float getFromVolume() const
Definition: ActiveAudio.cpp:70
const SegmentChoiceArrangementPick * getPick() const
Definition: ActiveAudio.cpp:33
const SegmentChoiceArrangementPick * pick
Definition: ActiveAudio.h:18
const Instrument * getInstrument() const
Definition: ActiveAudio.cpp:38
friend bool operator==(const ActiveAudio &lhs, const ActiveAudio &rhs)
Definition: ActiveAudio.h:89
float getAmplitude(float ap) const
Definition: ActiveAudio.cpp:63
float fromVolume
Definition: ActiveAudio.h:23
friend bool operator>(const ActiveAudio &lhs, const ActiveAudio &rhs)
Definition: ActiveAudio.h:78
Definition: InstrumentAudio.h:13
Definition: Instrument.h:14
Definition: SegmentChoiceArrangementPick.h:14
Definition: ActiveAudio.h:11
std::string UUID
Definition: EntityUtils.h:28