tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_WaveAudioNode.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11#pragma once
12
13#include "tracktion_AudioNode.h"
14
15
16namespace tracktion { inline namespace engine
17{
18
19//==============================================================================
22{
23public:
32 WaveAudioNode (const AudioFile& file,
33 legacy::EditTimeRange editTime,
34 double offset,
35 legacy::EditTimeRange loopSection,
36 LiveClipLevel level,
37 double speedRatio,
38 const juce::AudioChannelSet& channelsToUse);
39
40 ~WaveAudioNode() override;
41
42 //==============================================================================
43 void getAudioNodeProperties (AudioNodeProperties&) override;
44 void visitNodes (const VisitorFn&) override;
45
46 bool purgeSubNodes (bool keepAudio, bool keepMidi) override;
47
49 bool isReadyToRender() override;
50 void releaseAudioNodeResources() override;
51 void renderOver (const AudioRenderContext&) override;
52 void renderAdding (const AudioRenderContext&) override;
53 void prepareForNextBlock (const AudioRenderContext&) override;
54
55 void renderSection (const AudioRenderContext&, legacy::EditTimeRange editTime);
56
57private:
58 //==============================================================================
59 legacy::EditTimeRange editPosition, loopSection;
60 double offset = 0;
61 double originalSpeedRatio = 0, outputSampleRate = 44100.0;
62
63 AudioFile audioFile;
64 LiveClipLevel clipLevel;
65 double audioFileSampleRate = 0;
66 const juce::AudioChannelSet channelsToUse;
68
69 struct PerChannelState;
71
72 SampleCount editTimeToFileSample (double) const noexcept;
73 bool updateFileSampleRate();
74
76};
77
78}} // namespace tracktion { inline namespace engine
Base class for nodes in an audio playback graph.
An AudioNode that plays back a wave file.
bool purgeSubNodes(bool keepAudio, bool keepMidi) override
Tells the node to delete any sub-nodes that don't produce the required type of output.
void releaseAudioNodeResources() override
tells the node that play has stopped, and it can free up anything it no longer needs.
void prepareAudioNodeToPlay(const PlaybackInitialisationInfo &) override
tells the node to initialise itself ready for playing from the given time.
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Holds some really basic properties of a node.
Passed into AudioNodes when they are being initialised, to give them useful contextual information th...
Provides a thread-safe way to share a clip's levels with an audio engine without worrying about the C...