Audacity 3.2.0
FloatVectorClip.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 FloatVectorClip.h
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#pragma once
12
13#include "ClipInterface.h"
14
16{
17public:
19 int sampleRate, const std::vector<std::vector<float>>& audio);
20
21 // Duplicates audio to numChannels
23 int sampleRate, const std::vector<float>& audio, size_t numChannels);
24
26 size_t iChannel, sampleCount start, size_t len,
27 bool mayThrow) const override;
28
29 sampleCount GetVisibleSampleCount() const override;
30
31 size_t NChannels() const override;
32
33 int GetRate() const override;
34
35 double GetPlayStartTime() const override
36 {
37 return playStartTime;
38 }
39
40 double GetPlayEndTime() const override
41 {
43 }
44
45 sampleCount TimeToSamples(double time) const override;
46
47 double GetStretchRatio() const override
48 {
49 return stretchRatio;
50 }
51
52 int GetCentShift() const override
53 {
54 return 0;
55 }
56
58 SubscribeToCentShiftChange(std::function<void(int)> cb) const override
59 {
60 return {};
61 }
62
64 {
66 }
67
69 std::function<void(PitchAndSpeedPreset)> cb) const override
70 {
71 return {};
72 }
73
74public:
75 double stretchRatio = 1.;
76 double playStartTime = 0.;
77
78private:
79 double GetPlayDuration() const;
80
81 const int mSampleRate;
82 const std::vector<std::vector<float>> mAudio;
83};
PitchAndSpeedPreset
Definition: ClipInterface.h:40
MockedAudio audio
double GetPlayEndTime() const override
int GetCentShift() const override
double GetPlayDuration() const
Observer::Subscription SubscribeToCentShiftChange(std::function< void(int)> cb) const override
const int mSampleRate
Observer::Subscription SubscribeToPitchAndSpeedPresetChange(std::function< void(PitchAndSpeedPreset)> cb) const override
int GetRate() const override
double GetPlayStartTime() const override
FloatVectorClip(int sampleRate, const std::vector< std::vector< float > > &audio)
const std::vector< std::vector< float > > mAudio
AudioSegmentSampleView GetSampleView(size_t iChannel, sampleCount start, size_t len, bool mayThrow) const override
sampleCount GetVisibleSampleCount() const override
size_t NChannels() const override
PitchAndSpeedPreset GetPitchAndSpeedPreset() const override
double GetStretchRatio() const override
sampleCount TimeToSamples(double time) const override
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19