Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
clip.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
9
10#ifndef __SCHEMAS_AUDIO_CLIP_H__
11#define __SCHEMAS_AUDIO_CLIP_H__
12
13#include "utils/types.h"
14#include "utils/yaml.h"
15
16typedef enum BitDepth_v1
17{
18 BIT_DEPTH_16_v1,
19 BIT_DEPTH_24_v1,
20 BIT_DEPTH_32_v1
21} BitDepth_v1;
22
23typedef struct AudioClip_v1
24{
25 int schema_version;
26 char * name;
27 bpm_t bpm;
28 int samplerate;
29 BitDepth_v1 bit_depth;
30 bool use_flac;
31 int pool_id;
32 char * file_hash;
34
35static const cyaml_strval_t bit_depth_strings_v1[] = {
36 { "16", BIT_DEPTH_16_v1 },
37 { "24", BIT_DEPTH_24_v1 },
38 { "32", BIT_DEPTH_32_v1 },
39};
40
41static const cyaml_schema_field_t audio_clip_fields_schema_v1[] = {
42 YAML_FIELD_INT (AudioClip_v1, schema_version),
43 YAML_FIELD_STRING_PTR (AudioClip_v1, name),
44 YAML_FIELD_STRING_PTR_OPTIONAL (AudioClip_v1, file_hash),
45 YAML_FIELD_FLOAT (AudioClip_v1, bpm),
46 YAML_FIELD_ENUM (AudioClip_v1, bit_depth, bit_depth_strings_v1),
47 YAML_FIELD_INT (AudioClip_v1, use_flac),
48 YAML_FIELD_INT (AudioClip_v1, samplerate),
49 YAML_FIELD_INT (AudioClip_v1, pool_id),
50
51 CYAML_FIELD_END
52};
53
54static const cyaml_schema_value_t audio_clip_schema_v1 = {
55 YAML_VALUE_PTR_NULLABLE (AudioClip_v1, audio_clip_fields_schema_v1),
56};
57
58#endif
float bpm_t
The BPM type.
Definition types.h:77
Custom types.
YAML utils.