XJ music engine  1.9.6
In-game runtime engine for XJ music.
ProgramSequence.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_H
4 #define XJMUSIC_PROGRAM_SEQUENCE_H
5 
6 #include <string>
7 
9 #include "ContentEntity.h"
10 
11 namespace XJ {
12 
13  class ProgramSequence : public ContentEntity {
14  public:
15 
16  ProgramSequence() = default;
17 
19  std::string name;
20  std::string key;
21  float intensity{};
22  int total{};
23  };
24 
30  inline void from_json(const json &json, ProgramSequence &entity) {
31  EntityUtils::setRequired(json, "id", entity.id);
32  EntityUtils::setRequired(json, "programId", entity.programId);
33  EntityUtils::setIfNotNull(json, "name", entity.name);
34  EntityUtils::setIfNotNull(json, "key", entity.key);
35  EntityUtils::setIfNotNull(json, "intensity", entity.intensity);
36  EntityUtils::setIfNotNull(json, "total", entity.total);
37  }
38 
39 }// namespace XJ
40 
41 #endif//XJMUSIC_PROGRAM_SEQUENCE_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: ProgramSequence.h:13
int total
Definition: ProgramSequence.h:22
float intensity
Definition: ProgramSequence.h:21
UUID programId
Definition: ProgramSequence.h:18
ProgramSequence()=default
std::string key
Definition: ProgramSequence.h:20
std::string name
Definition: ProgramSequence.h:19
Definition: ActiveAudio.h:11
std::string UUID
Definition: EntityUtils.h:28
void from_json(const json &json, Instrument &entity)
Definition: Instrument.h:106