36 jassert (newFormat !=
nullptr);
38 if (newFormat !=
nullptr)
41 for (
auto* af : knownFormats)
48 if (makeThisTheDefaultFormat)
51 knownFormats.add (newFormat);
64 #if JUCE_USE_OGGVORBIS
68 #if JUCE_MAC || JUCE_IOS
72 #if JUCE_USE_MP3AUDIOFORMAT
76 #if JUCE_USE_WINDOWS_MEDIA_FORMAT
84 defaultFormatIndex = 0;
96 for (
auto* af : knownFormats)
97 if (af->getFileExtensions().contains (fileExtension,
true))
107 for (
auto* af : knownFormats)
108 extensions.
addArray (af->getFileExtensions());
113 for (
auto& e : extensions)
114 e = (e.startsWithChar (
'.') ?
"*" :
"*.") + e;
127 for (
auto* af : knownFormats)
128 if (af->canHandleFile (file))
130 if (
auto* r = af->createReaderFor (in,
true))
142 if (audioFileStream !=
nullptr)
144 std::unique_ptr<InputStream> in (audioFileStream);
145 auto originalStreamPos = in->getPosition();
147 for (
auto* af : knownFormats)
149 if (
auto* r = af->createReaderFor (in.get(),
false))
155 in->setPosition (originalStreamPos);
159 jassert (in->getPosition() == originalStreamPos);
Represents a local file or directory.
FileInputStream * createInputStream() const
Creates a stream to read from this file.
A special array for holding a list of strings.
String joinIntoString(StringRef separatorString, int startIndex=0, int numberOfElements=-1) const
Joins the strings in the array together into one string.
void removeEmptyStrings(bool removeWhitespaceStrings=true)
Removes empty strings from the array.
void addArray(const StringArray &other, int startIndex=0, int numElementsToAdd=-1)
Appends some strings from another array to the end of this one.
void removeDuplicates(bool ignoreCase)
Removes any duplicated elements from the array.
void trim()
Deletes any whitespace characters from the starts and ends of all the strings.
bool startsWithChar(juce_wchar character) const noexcept
Tests whether the string begins with a particular character.