XJ music engine  1.9.6
In-game runtime engine for XJ music.
ProgramSequencePatternEvent.h
Go to the documentation of this file.
1 // Copyright (c) XJ Music Inc. (https://xjmusic.com) All Rights Reserved.
2 
3 #ifndef XJMUSIC_PROGRAM_SEQUENCE_PATTERN_EVENT_H
4 #define XJMUSIC_PROGRAM_SEQUENCE_PATTERN_EVENT_H
5 
6 #include <string>
7 
9 #include "ContentEntity.h"
10 
11 namespace XJ {
12 
14  public:
15 
17 
20  std::string programVoiceTrackId;
21  float velocity{};
22  float position{};
23  float duration{};
24  std::string tones;
25  };
26 
32  inline void from_json(const json &json, ProgramSequencePatternEvent &entity) {
33  EntityUtils::setRequired(json, "id", entity.id);
34  EntityUtils::setRequired(json, "programId", entity.programId);
35  EntityUtils::setRequired(json, "programSequencePatternId", entity.programSequencePatternId);
36  EntityUtils::setRequired(json, "programVoiceTrackId", entity.programVoiceTrackId);
37  EntityUtils::setIfNotNull(json, "velocity", entity.velocity);
38  EntityUtils::setIfNotNull(json, "position", entity.position);
39  EntityUtils::setIfNotNull(json, "duration", entity.duration);
40  EntityUtils::setIfNotNull(json, "tones", entity.tones);
41  }
42 
43 }// namespace XJ
44 
45 #endif//XJMUSIC_PROGRAM_SEQUENCE_PATTERN_EVENT_H
nlohmann::json json
Definition: EntityUtils.h:14
Definition: ContentEntity.h:12
UUID id
Definition: ContentEntity.h:17
static void setIfNotNull(const json &json, const std::string &key, std::string &value)
Definition: EntityUtils.cpp:27
static void setRequired(const json &json, const std::string &key, UUID &value)
Definition: EntityUtils.cpp:16
Definition: ProgramSequencePatternEvent.h:13
UUID programId
Definition: ProgramSequencePatternEvent.h:18
std::string tones
Definition: ProgramSequencePatternEvent.h:24
std::string programVoiceTrackId
Definition: ProgramSequencePatternEvent.h:20
float velocity
Definition: ProgramSequencePatternEvent.h:21
std::string programSequencePatternId
Definition: ProgramSequencePatternEvent.h:19
float duration
Definition: ProgramSequencePatternEvent.h:23
float position
Definition: ProgramSequencePatternEvent.h:22
Definition: ActiveAudio.h:11
std::string UUID
Definition: EntityUtils.h:28
void from_json(const json &json, Instrument &entity)
Definition: Instrument.h:106