Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
metronome.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: © 2019-2021 Alexandros Theodotou <alex@zrythm.org>
2
// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10
#ifndef __AUDIO_METRONOME_H__
11
#define __AUDIO_METRONOME_H__
12
13
#include <cstddef>
14
15
#include "
utils/types.h
"
16
17
typedef
struct
AudioEngine
AudioEngine
;
18
25
#define METRONOME (AUDIO_ENGINE->metronome)
26
30
enum class
MetronomeType
31
{
32
METRONOME_TYPE_NONE,
33
METRONOME_TYPE_EMPHASIS,
34
METRONOME_TYPE_NORMAL,
35
};
36
40
typedef
struct
Metronome
41
{
43
char
*
emphasis_path
;
44
46
char
*
normal_path
;
47
49
float
*
emphasis
;
50
52
size_t
emphasis_size
;
53
54
channels_t
emphasis_channels;
55
57
float
*
normal
;
58
60
size_t
normal_size
;
61
62
channels_t
normal_channels;
63
64
float
volume;
65
}
Metronome
;
66
71
Metronome
*
72
metronome_new
(
void
);
73
74
NONNULL
void
75
metronome_set_volume (
Metronome
* self,
float
volume);
76
83
NONNULL
void
84
metronome_queue_events
(
85
AudioEngine
* self,
86
const
nframes_t
loffset,
87
const
nframes_t
nframes);
88
89
NONNULL
void
90
metronome_free (
Metronome
* self);
91
96
#endif
MetronomeType
MetronomeType
The type of the metronome sound.
Definition
metronome.h:31
metronome_new
Metronome * metronome_new(void)
Initializes the Metronome by loading the samples into memory.
metronome_queue_events
NONNULL void metronome_queue_events(AudioEngine *self, const nframes_t loffset, const nframes_t nframes)
Queues metronome events (if any) within the current processing cycle.
nframes_t
uint32_t nframes_t
Frame count.
Definition
types.h:39
channels_t
unsigned int channels_t
Number of channels.
Definition
types.h:48
AudioEngine
The audio engine.
Definition
engine.h:353
Metronome
Metronome settings.
Definition
metronome.h:41
Metronome::normal
float * normal
The normal sample.
Definition
metronome.h:57
Metronome::emphasis
float * emphasis
The emphasis sample.
Definition
metronome.h:49
Metronome::emphasis_path
char * emphasis_path
Absolute path of the "emphasis" sample.
Definition
metronome.h:43
Metronome::normal_size
size_t normal_size
Size per channel.
Definition
metronome.h:60
Metronome::emphasis_size
size_t emphasis_size
Size per channel.
Definition
metronome.h:52
Metronome::normal_path
char * normal_path
Absolute path of the "normal" sample.
Definition
metronome.h:46
types.h
Custom types.
dsp
metronome.h
Generated by
1.11.0