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_AudioCDReader.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
29#if JUCE_USE_CDREADER || DOXYGEN
30
31//==============================================================================
43class JUCE_API AudioCDReader : public AudioFormatReader
44{
45public:
46 //==============================================================================
56
64 static AudioCDReader* createReaderForCD (int index);
65
66 //==============================================================================
68 ~AudioCDReader() override;
69
71 bool readSamples (int* const* destSamples, int numDestChannels, int startOffsetInDestBuffer,
72 int64 startSampleInFile, int numSamples) override;
73
75 bool isCDStillPresent() const;
76
78 int getNumTracks() const;
79
84 int getPositionOfTrackStart (int trackNum) const;
85
89 bool isTrackAudio (int trackNum) const;
90
95
103
107 void enableIndexScanning (bool enabled);
108
122 int getLastIndex() const;
123
130
135
139 void ejectDisk();
140
141 //==============================================================================
142 enum
143 {
144 framesPerSecond = 75,
145 samplesPerFrame = 44100 / framesPerSecond
146 };
147
148private:
149 //==============================================================================
150 Array<int> trackStartSamples;
151
152 #if JUCE_MAC
153 File volumeDir;
154 Array<File> tracks;
155 int currentReaderTrack;
157 AudioCDReader (const File& volume);
158
159 #elif JUCE_WINDOWS
160 bool audioTracks [100];
161 void* handle;
162 MemoryBlock buffer;
163 bool indexingEnabled;
164 int lastIndex, firstFrameInBuffer, samplesInBuffer;
165 AudioCDReader (void* handle);
166 int getIndexAt (int samplePos);
167
168 #elif JUCE_LINUX || JUCE_BSD
170 #endif
171
173};
174
175#endif
176
177} // namespace juce
Holds a resizable array of primitive or copy-by-value objects.
Definition juce_Array.h:56
A type of AudioFormatReader that reads from an audio CD.
bool isCDStillPresent() const
Checks whether the CD has been removed from the drive.
int getLastIndex() const
Returns the index number found during the last read() call.
int getCDDBId()
Returns the CDDB id number for the CD.
void ejectDisk()
Tries to eject the disk.
bool readSamples(int *const *destSamples, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int numSamples) override
Implementation of the AudioFormatReader method.
static StringArray getAvailableCDNames()
Returns a list of names of Audio CDs currently available for reading.
static AudioCDReader * createReaderForCD(int index)
Tries to create an AudioFormatReader that can read from an Audio CD.
int getPositionOfTrackStart(int trackNum) const
Finds the sample offset of the start of a track.
int getNumTracks() const
Returns the total number of tracks (audio + data).
void enableIndexScanning(bool enabled)
Enables scanning for indexes within tracks.
~AudioCDReader() override
Destructor.
const Array< int > & getTrackOffsets() const
Returns an array of sample offsets for the start of each track, followed by the sample position of th...
bool isTrackAudio(int trackNum) const
Returns true if a given track is an audio track.
Array< int > findIndexesInTrack(int trackNumber)
Scans a track to find the position of any indexes within it.
void refreshTrackLengths()
Refreshes the object's table of contents.
Reads samples from an audio file stream.
Represents a local file or directory.
Definition juce_File.h:45
A class to hold a resizable block of raw data.
A special array for holding a list of strings.
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
JUCE Namespace.
long long int64
A platform-independent 64-bit integer type.