Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
panning.h
1// SPDX-FileCopyrightText: © 2018-2020, 2024, 2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "utils/enum_utils.h"
7
8#include <QtTranslation>
9
10namespace zrythm::dsp
11{
12
20enum class PanLaw
21{
22 ZerodB,
23 Minus3dB,
24 Minus6dB
25};
26
30enum class PanAlgorithm
31{
32 Linear,
33 SquareRoot,
34 SineLaw
35};
36
42enum class BalanceControlAlgorithm
43{
54 Linear,
55};
56
67[[nodiscard]] std::pair<float, float>
68calculate_panning (PanLaw law, PanAlgorithm algo, float pan);
69
84[[nodiscard]] std::pair<float, float>
85calculate_balance_control (
86 BalanceControlAlgorithm algorithm,
87 float balance_control_position);
88
89}; // namespace zrythm::dsp
90
91DEFINE_ENUM_FORMATTER (
92 zrythm::dsp::PanAlgorithm,
93 PanAlgorithm,
94 QT_TR_NOOP_UTF8 ("Linear"),
95 QT_TR_NOOP_UTF8 ("Square Root"),
96 QT_TR_NOOP_UTF8 ("Sine"));
97
98DEFINE_ENUM_FORMATTER (
99 zrythm::dsp::PanLaw,
100 PanLaw,
101 /* TRANSLATORS: decibels */
102 QT_TR_NOOP_UTF8 ("0dB"),
103 QT_TR_NOOP_UTF8 ("-3dB"),
104 QT_TR_NOOP_UTF8 ("-6dB"));
105
106DEFINE_ENUM_FORMATTER (
107 zrythm::dsp::BalanceControlAlgorithm,
108 BalanceControlAlgorithm,
109 QT_TR_NOOP_UTF8 ("Linear"));