XJ music engine  1.9.6
In-game runtime engine for XJ music.
SegmentRetrospective.h
Go to the documentation of this file.
1 // Copyright (c) XJ Music Inc. (https://xjmusic.com) All Rights Reserved.
2 
3 #ifndef XJMUSIC_FABRICATOR_SEGMENT_RETROSPECTIVE_H
4 #define XJMUSIC_FABRICATOR_SEGMENT_RETROSPECTIVE_H
5 
6 #include <optional>
7 #include <set>
8 #include <vector>
9 
18 
19 namespace XJ {
20 
31  int segmentId;
32  SegmentEntityStore *entityStore{};
33  std::vector<const Segment *> retroSegments{};
34  std::set<int> previousSegmentIds{};
35  std::optional<const Segment *> previousSegment;
36  std::map<int, std::vector<const SegmentChord *>> segmentChords{};// indexed by id, vector of chords ordered by position
37 
38  public:
39  virtual ~SegmentRetrospective() = default;
40 
57  explicit SegmentRetrospective(SegmentEntityStore *entityStore, int segmentId, bool autoload = true);
58 
67 
71  virtual std::set<const SegmentChoice *> getChoices() const;
72 
80  virtual const SegmentChoice *getChoice(const SegmentChoiceArrangement *arrangement) const;
81 
89 
98  virtual std::optional<const SegmentMeta *> getPreviousMeta(const std::string &key) const;
99 
107  virtual std::set<const SegmentChoice *> getPreviousChoicesForInstrument(const UUID &instrumentId) const;
108 
115  virtual std::set<const SegmentChoiceArrangement *> getPreviousArrangementsForInstrument(const UUID &instrumentId) const;
116 
124  virtual std::set<const SegmentChoiceArrangementPick *> getPicks() const;
125 
133  virtual std::optional<const SegmentChoice *> getPreviousChoiceOfType(const Segment *segment, Program::Type programType) const;
134 
141  virtual std::optional<const SegmentChoice *> getPreviousChoiceOfType(Program::Type programType) const;
142 
149  virtual std::set<const SegmentChoice *> getPreviousChoicesOfMode(Instrument::Mode instrumentMode) const;
150 
158  virtual std::set<const SegmentChoice *>
159  getPreviousChoicesOfTypeMode(Instrument::Type instrumentType, Instrument::Mode instrumentMode) const;
160 
167  virtual std::optional<const SegmentChoice *> getPreviousChoiceOfType(Instrument::Type instrumentType) const;
168 
175  virtual std::set<const SegmentChoiceArrangementPick *> getPreviousPicksForInstrument(const UUID &instrumentId) const;
176 
182  virtual std::optional<const Segment *> getPreviousSegment() const;
183 
192  virtual std::vector<const Segment *> getSegments() const;
193 
200  virtual std::vector<const SegmentChord *> getSegmentChords(int segmentId) const;
201  };
202 
203 }// namespace XJ
204 
205 #endif//XJMUSIC_FABRICATOR_SEGMENT_RETROSPECTIVE_H
Mode
Definition: Instrument.h:29
Type
Definition: Instrument.h:16
Type
Definition: Program.h:16
Definition: SegmentChoiceArrangementPick.h:14
Definition: SegmentChoiceArrangement.h:14
Definition: SegmentChoice.h:15
Definition: SegmentEntityStore.h:43
Definition: SegmentRetrospective.h:30
virtual std::optional< const SegmentMeta * > getPreviousMeta(const std::string &key) const
Definition: SegmentRetrospective.cpp:164
virtual std::set< const SegmentChoice * > getPreviousChoicesOfTypeMode(Instrument::Type instrumentType, Instrument::Mode instrumentMode) const
Definition: SegmentRetrospective.cpp:87
virtual std::set< const SegmentChoice * > getChoices() const
Definition: SegmentRetrospective.cpp:114
virtual const SegmentChoiceArrangement * getArrangement(const SegmentChoiceArrangementPick *pick) const
Definition: SegmentRetrospective.cpp:174
virtual std::set< const SegmentChoiceArrangement * > getPreviousArrangementsForInstrument(const UUID &instrumentId) const
Definition: SegmentRetrospective.cpp:130
virtual std::vector< const SegmentChord * > getSegmentChords(int segmentId) const
Definition: SegmentRetrospective.cpp:194
virtual ~SegmentRetrospective()=default
virtual std::set< const SegmentChoice * > getPreviousChoicesOfMode(Instrument::Mode instrumentMode) const
Definition: SegmentRetrospective.cpp:74
virtual const SegmentChoice * getChoice(const SegmentChoiceArrangement *arrangement) const
Definition: SegmentRetrospective.cpp:184
virtual std::set< const SegmentChoiceArrangementPick * > getPicks() const
Definition: SegmentRetrospective.cpp:60
virtual Instrument::Type getInstrumentType(const SegmentChoiceArrangementPick *pick) const
Definition: SegmentRetrospective.cpp:160
virtual std::optional< const SegmentChoice * > getPreviousChoiceOfType(const Segment *segment, Program::Type programType) const
Definition: SegmentRetrospective.cpp:55
virtual std::optional< const Segment * > getPreviousSegment() const
Definition: SegmentRetrospective.cpp:65
virtual std::set< const SegmentChoice * > getPreviousChoicesForInstrument(const UUID &instrumentId) const
Definition: SegmentRetrospective.cpp:118
virtual std::vector< const Segment * > getSegments() const
Definition: SegmentRetrospective.cpp:110
virtual std::set< const SegmentChoiceArrangementPick * > getPreviousPicksForInstrument(const UUID &instrumentId) const
Definition: SegmentRetrospective.cpp:144
SegmentRetrospective(SegmentEntityStore *entityStore, int segmentId, bool autoload=true)
Definition: SegmentRetrospective.cpp:11
Definition: Segment.h:13
Definition: ActiveAudio.h:11
std::string UUID
Definition: EntityUtils.h:28