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 <stddef.h>
14
15#include "utils/types.h"
16
17typedef struct AudioEngine AudioEngine;
18
25#define METRONOME (AUDIO_ENGINE->metronome)
26
30typedef enum MetronomeType
31{
32 METRONOME_TYPE_NONE,
33 METRONOME_TYPE_EMPHASIS,
34 METRONOME_TYPE_NORMAL,
36
40typedef struct Metronome
41{
44
47
49 float * emphasis;
50
53
54 channels_t emphasis_channels;
55
57 float * normal;
58
61
62 channels_t normal_channels;
63
64 float volume;
65} Metronome;
66
73
74NONNULL void
75metronome_set_volume (Metronome * self, float volume);
76
83NONNULL void
85 AudioEngine * self,
86 const nframes_t loffset,
87 const nframes_t nframes);
88
89NONNULL void
90metronome_free (Metronome * self);
91
96#endif
MetronomeType
The type of the metronome sound.
Definition metronome.h:31
Metronome * metronome_new(void)
Initializes the Metronome by loading the samples into memory.
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.
uint32_t nframes_t
Frame count.
Definition types.h:35
unsigned int channels_t
Number of channels.
Definition types.h:44
The audio engine.
Definition engine.h:358
Metronome settings.
Definition metronome.h:41
float * normal
The normal sample.
Definition metronome.h:57
float * emphasis
The emphasis sample.
Definition metronome.h:49
char * emphasis_path
Absolute path of the "emphasis" sample.
Definition metronome.h:43
size_t normal_size
Size per channel.
Definition metronome.h:60
size_t emphasis_size
Size per channel.
Definition metronome.h:52
char * normal_path
Absolute path of the "normal" sample.
Definition metronome.h:46
Custom types.