Audacity 3.2.0
TimeAndPitchInterface.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 TimeAndPitchInterface.h
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#pragma once
12
13#include <functional>
14#include <memory>
15#include <optional>
16#include <vector>
17
18class TIME_AND_PITCH_API TimeAndPitchSource
19{
20public:
22 virtual void Pull(float* const*, size_t samplesPerChannel) = 0;
23};
24
25class TIME_AND_PITCH_API TimeAndPitchInterface
26{
27public:
28 static bool IsPassThroughMode(double stretchRatio);
29
30 // Limit the pitch shift range to +/- one octave. When
31 // https://github.com/audacity/audacity/issues/5904 is addressed, we may
32 // alleviate this restriction.
33 static constexpr auto MaxCents = 1200;
34 static constexpr auto MinCents = -1200;
35
37 {
38 std::optional<double> timeRatio;
39 std::optional<double> pitchRatio;
40 };
41
42 virtual void GetSamples(float* const*, size_t) = 0;
43 virtual void OnCentShiftChange(int cents) = 0;
44
46};
virtual void OnCentShiftChange(int cents)=0
virtual ~TimeAndPitchInterface()
virtual void GetSamples(float *const *, size_t)=0
virtual void Pull(float *const *, size_t samplesPerChannel)=0
virtual ~TimeAndPitchSource()