JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_AudioThumbnailBase.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29class AudioThumbnailCache;
30
31//==============================================================================
43class JUCE_API AudioThumbnailBase : public ChangeBroadcaster,
45{
46public:
47 //==============================================================================
48 AudioThumbnailBase() = default;
49 ~AudioThumbnailBase() override = default;
50
51 //==============================================================================
53 virtual void clear() = 0;
54
67 virtual bool setSource (InputSource* newSource) = 0;
68
79 virtual void setReader (AudioFormatReader* newReader, int64 hashCode) = 0;
80
81 //==============================================================================
88 virtual bool loadFrom (InputStream& input) = 0;
89
95 virtual void saveTo (OutputStream& output) const = 0;
96
97 //==============================================================================
99 virtual int getNumChannels() const noexcept = 0;
100
102 virtual double getTotalLength() const noexcept = 0;
103
114 virtual void drawChannel (Graphics& g,
115 const Rectangle<int>& area,
116 double startTimeSeconds,
117 double endTimeSeconds,
118 int channelNum,
119 float verticalZoomFactor) = 0;
120
128 virtual void drawChannels (Graphics& g,
129 const Rectangle<int>& area,
130 double startTimeSeconds,
131 double endTimeSeconds,
132 float verticalZoomFactor) = 0;
133
135 virtual bool isFullyLoaded() const noexcept = 0;
136
138 virtual int64 getNumSamplesFinished() const noexcept = 0;
139
144 virtual float getApproximatePeak() const = 0;
145
151 virtual void getApproximateMinMax (double startTime, double endTime, int channelIndex,
152 float& minValue, float& maxValue) const noexcept = 0;
153
155 virtual int64 getHashCode() const = 0;
156};
157
158} // namespace juce
Reads samples from an audio file stream.
Provides a base for classes that can store and draw scaled views of an audio waveform.
virtual void clear()=0
Clears and resets the thumbnail.
virtual bool setSource(InputSource *newSource)=0
Specifies the file or stream that contains the audio file.
virtual int getNumChannels() const noexcept=0
Returns the number of channels in the file.
virtual bool loadFrom(InputStream &input)=0
Reloads the low res thumbnail data from an input stream.
virtual void saveTo(OutputStream &output) const =0
Saves the low res thumbnail data to an output stream.
virtual void setReader(AudioFormatReader *newReader, int64 hashCode)=0
Gives the thumbnail an AudioFormatReader to use directly.
Holds a list of ChangeListeners, and sends messages to them when instructed.
A graphics context, used for drawing a component or image.
A lightweight object that can create a stream to read some kind of resource.
The base class for streams that read data.
The base class for streams that write data to some kind of destination.
Manages a rectangle and allows geometric operations to be performed on it.
JUCE Namespace.
long long int64
A platform-independent 64-bit integer type.