XJ music engine
1.9.6
In-game runtime engine for XJ music.
include
xjmusic
content
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
8
#include "
xjmusic/util/EntityUtils.h
"
9
#include "
ContentEntity.h
"
10
11
namespace
XJ
{
12
13
class
ProgramSequencePatternEvent
:
public
ContentEntity
{
14
public
:
15
16
ProgramSequencePatternEvent
() =
default
;
17
18
UUID
programId
;
19
std::string
programSequencePatternId
;
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
ContentEntity.h
EntityUtils.h
json
nlohmann::json json
Definition:
EntityUtils.h:14
XJ::ContentEntity
Definition:
ContentEntity.h:12
XJ::ContentEntity::id
UUID id
Definition:
ContentEntity.h:17
XJ::EntityUtils::setIfNotNull
static void setIfNotNull(const json &json, const std::string &key, std::string &value)
Definition:
EntityUtils.cpp:27
XJ::EntityUtils::setRequired
static void setRequired(const json &json, const std::string &key, UUID &value)
Definition:
EntityUtils.cpp:16
XJ::ProgramSequencePatternEvent
Definition:
ProgramSequencePatternEvent.h:13
XJ::ProgramSequencePatternEvent::programId
UUID programId
Definition:
ProgramSequencePatternEvent.h:18
XJ::ProgramSequencePatternEvent::tones
std::string tones
Definition:
ProgramSequencePatternEvent.h:24
XJ::ProgramSequencePatternEvent::programVoiceTrackId
std::string programVoiceTrackId
Definition:
ProgramSequencePatternEvent.h:20
XJ::ProgramSequencePatternEvent::velocity
float velocity
Definition:
ProgramSequencePatternEvent.h:21
XJ::ProgramSequencePatternEvent::programSequencePatternId
std::string programSequencePatternId
Definition:
ProgramSequencePatternEvent.h:19
XJ::ProgramSequencePatternEvent::duration
float duration
Definition:
ProgramSequencePatternEvent.h:23
XJ::ProgramSequencePatternEvent::position
float position
Definition:
ProgramSequencePatternEvent.h:22
XJ::ProgramSequencePatternEvent::ProgramSequencePatternEvent
ProgramSequencePatternEvent()=default
XJ
Definition:
ActiveAudio.h:11
XJ::UUID
std::string UUID
Definition:
EntityUtils.h:28
XJ::from_json
void from_json(const json &json, Instrument &entity)
Definition:
Instrument.h:106
Generated by
1.9.1