Audaspace 1.8.0
A high level audio library.
Loading...
Searching...
No Matches
AnimateableTimeStretchPitchScale.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright 2009-2025 Jörg Müller
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
16
17#pragma once
18
24
25#include "fx/Effect.h"
28
30
35class AUD_API AnimateableTimeStretchPitchScale : public Effect
36{
37private:
41 float m_fps;
42
46 std::shared_ptr<AnimateableProperty> m_timeStretch;
47
51 std::shared_ptr<AnimateableProperty> m_pitchScale;
52
56 StretcherQuality m_quality;
57
61 bool m_preserveFormant;
62
63 // delete copy constructor and operator=
64 AnimateableTimeStretchPitchScale(const AnimateableTimeStretchPitchScale&) = delete;
65 AnimateableTimeStretchPitchScale& operator=(const AnimateableTimeStretchPitchScale&) = delete;
66
67public:
77 AnimateableTimeStretchPitchScale(std::shared_ptr<ISound> sound, float fps, float timeStretch, float pitchScale, StretcherQuality quality, bool preserveFormant);
78
88 AnimateableTimeStretchPitchScale(std::shared_ptr<ISound> sound, float fps, std::shared_ptr<AnimateableProperty> timeStretch, std::shared_ptr<AnimateableProperty> pitchScale,
89 StretcherQuality quality, bool preserveFormant);
90
94 bool getPreserveFormant() const;
95
99 StretcherQuality getStretcherQuality() const;
100
106 std::shared_ptr<AnimateableProperty> getAnimProperty(AnimateablePropertyType type);
107
112 float getFPS() const;
113
118 void setFPS(float fps);
119
120 virtual std::shared_ptr<IReader> createReader();
121};
122
Defines the AnimateableProperty class as well as existing property types.
AnimateablePropertyType
Possible animatable properties for Sequencer Factories and Entries.
Definition AnimateableProperty.h:35
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
The Effect class.
The TimeStretchPitchScale class.
virtual std::shared_ptr< IReader > createReader()
Creates a reader for playback of the sound source.
std::shared_ptr< AnimateableProperty > getAnimProperty(AnimateablePropertyType type)
Retrieves one of the animated properties of the sound.
StretcherQuality getStretcherQuality() const
Returns the quality of the stretcher.
bool getPreserveFormant() const
Returns whether formant preservation is enabled.
AnimateableTimeStretchPitchScale(std::shared_ptr< ISound > sound, float fps, std::shared_ptr< AnimateableProperty > timeStretch, std::shared_ptr< AnimateableProperty > pitchScale, StretcherQuality quality, bool preserveFormant)
Creates a new time-stretch, pitch-scaled sound that can be animated.
void setFPS(float fps)
Sets the animation system's FPS.
float getFPS() const
Retrieves the animation system's FPS.
AnimateableTimeStretchPitchScale(std::shared_ptr< ISound > sound, float fps, float timeStretch, float pitchScale, StretcherQuality quality, bool preserveFormant)
Creates a new time-stretch, pitch-scaled sound that can be animated.