1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Merge develop into midi2

This commit is contained in:
reuk 2025-07-24 11:22:19 +01:00
commit 10b1cfaa31
No known key found for this signature in database
181 changed files with 3005 additions and 2154 deletions

View file

@ -2,6 +2,70 @@
# develop
## Change
The signatures of OpenGLFrameBuffer::readPixels() and
OpenGLFrameBuffer::writePixels() have changed, adding a new RowOrder parameter.
**Possible Issues**
Code that does not specify this parameter will not compile.
**Workaround**
Pass the extra parameter to specify whether the pixel data should be ordered
with the top-most or bottom-most row first.
**Rationale**
The previous function calls did not allow the pixel order to be configured.
readPixels() would return pixel data with the bottom-most row first (this is
convention for the OpenGL API), but writePixels() would expect the top-most row
first. This meant that reading and then immediately writing the same data would
have the unexpected effect of flipping the image. Changing readPixels() to
order pixels from top to bottom would be slightly dangerous, as it would
introduce a change of behaviour with no accompanying compiler warning.
Additionally, flipping the pixel storage introduces additional work that can be
safely skipped when the pixel data is going to be written back to the
framebuffer later.
## Change
The behaviour of the default constructed FocusTraverser objects has changed, and
they will now navigate onto disabled components. This only affects navigation by
screen readers and not general keyboard navigation, as the latter depends on the
KeyboardFocusTraverser class.
**Possible Issues**
Disabled child components of focus containers that used the JUCE default
FocusTraverser will now be discoverable by screen readers. They will accept
accessibility focus, their title will be reported as well as their disabled
state.
Children of components that returned a custom ComponentTraverser object are not
affected.
**Workaround**
If you wish to hide disabled components from screen readers, you can restore the
old behaviour by overriding `Component::createFocusTraverser()` for your focus
containers, and returning a FocusTraverser object created using the
`FocusTraverser::SkipDisabledComponents::yes` argument.
**Rationale**
Disabled components are typically rendered in a dimmed or inactive state, but
are still prominently visible for sighted users. The old behaviour made these
components entirely missing from the accessibility tree, making them
non-discoverable with screen readers.
This was in contrast to the behaviour of native OS components, that are still
accessible using screen readers, but their disabled/dimmed state is also
reported.
## Change
The default Visual Studio project settings for "Debug Information Format" have

View file

@ -73,6 +73,7 @@ target_link_libraries(DemoRunner PRIVATE
juce::juce_animation
juce::juce_audio_utils
juce::juce_box2d
juce::juce_build_tools
juce::juce_dsp
juce::juce_javascript
juce::juce_midi_ci

View file

@ -154,7 +154,8 @@ private:
#if JUCE_IOS || JUCE_ANDROID
void parentSizeChanged() override
{
getMainComponent().resized();
if (auto* comp = getContentComponent())
comp->resized();
}
#endif

View file

@ -338,7 +338,9 @@ public:
const FontStringPair example[] =
{
FontStringPair { baseLineFont.withPointHeight (16),
feature.exampleText + " " + String::fromUTF8 ("\xe2\x86\x92") },
feature.exampleText },
FontStringPair { baseLineFont.withPointHeight (16),
" " + String::fromUTF8 ("\xe2\x86\x92") },
FontStringPair { exampleFont.withPointHeight (16),
feature.exampleText }
};

View file

@ -492,7 +492,16 @@ function(juce_add_binary_data target)
endforeach()
set(input_file_list "${juce_binary_data_folder}/input_file_list")
file(WRITE "${input_file_list}" "${newline_delimited_input}")
set(old_input_file_list "")
if(EXISTS "${input_file_list}")
file(READ "${input_file_list}" old_input_file_list)
endif()
if(NOT "${old_input_file_list}" STREQUAL "${newline_delimited_input}")
file(WRITE "${input_file_list}" "${newline_delimited_input}")
endif()
add_custom_command(OUTPUT ${binary_file_names}
COMMAND juce::juceaide binarydata "${JUCE_ARG_NAMESPACE}" "${JUCE_ARG_HEADER_NAME}"

View file

@ -35,22 +35,28 @@
namespace juce::build_tools
{
Array<Drawable*> asArray (const Icons& icons)
Icons Icons::fromFilesSmallAndBig (const File& small, const File& big)
{
Array<Drawable*> result;
Icons result;
result.small = Drawable::createFromImageFile (small);
result.big = Drawable::createFromImageFile (big);
return result;
}
if (icons.small != nullptr)
result.add (icons.small.get());
Array<const Drawable*> asArray (const Icons& icons)
{
Array<const Drawable*> result;
if (icons.big != nullptr)
result.add (icons.big.get());
for (auto getter : { &Icons::getSmall, &Icons::getBig })
if (auto* got = (icons.*getter)())
result.add (got);
return result;
}
namespace mac
{
static Image fixIconImageSize (Drawable& image)
static Image fixIconImageSize (const Drawable& image)
{
const int validSizes[] = { 16, 32, 64, 128, 256, 512, 1024 };
@ -90,7 +96,7 @@ namespace juce::build_tools
{
MemoryOutputStream data;
auto smallest = std::numeric_limits<int>::max();
Drawable* smallestImage = nullptr;
const Drawable* smallestImage = nullptr;
const auto images = asArray (icons);
@ -134,25 +140,25 @@ namespace juce::build_tools
int size,
bool returnNullIfNothingBigEnough)
{
auto* const im = [&]() -> Drawable*
auto* const im = std::invoke ([&]() -> const Drawable*
{
if ((icons.small != nullptr) != (icons.big != nullptr))
return icons.small != nullptr ? icons.small.get() : icons.big.get();
if ((icons.getSmall() != nullptr) != (icons.getBig() != nullptr))
return icons.getSmall() != nullptr ? icons.getSmall() : icons.getBig();
if (icons.small != nullptr && icons.big != nullptr)
if (icons.getSmall() != nullptr && icons.getBig() != nullptr)
{
if (icons.small->getWidth() >= size && icons.big->getWidth() >= size)
return icons.small->getWidth() < icons.big->getWidth() ? icons.small.get() : icons.big.get();
if (icons.getSmall()->getWidth() >= size && icons.getBig()->getWidth() >= size)
return icons.getSmall()->getWidth() < icons.getBig()->getWidth() ? icons.getSmall() : icons.getBig();
if (icons.small->getWidth() >= size)
return icons.small.get();
if (icons.getSmall()->getWidth() >= size)
return icons.getSmall();
if (icons.big->getWidth() >= size)
return icons.big.get();
if (icons.getBig()->getWidth() >= size)
return icons.getBig();
}
return nullptr;
}();
});
if (im == nullptr)
return {};
@ -304,9 +310,9 @@ namespace juce::build_tools
writeStreamToFile (file, [&] (MemoryOutputStream& mo) { writeWinIcon (icons, mo); });
}
Image rescaleImageForIcon (Drawable& d, const int size)
Image rescaleImageForIcon (const Drawable& d, const int size)
{
if (auto* drawableImage = dynamic_cast<DrawableImage*> (&d))
if (auto* drawableImage = dynamic_cast<const DrawableImage*> (&d))
{
auto im = SoftwareImageType().convert (drawableImage->getImage());
@ -365,8 +371,8 @@ namespace juce::build_tools
static void createiOSIconFiles (const Icons& icons, File appIconSet)
{
auto* imageToUse = icons.big != nullptr ? icons.big.get()
: icons.small.get();
auto* imageToUse = icons.getBig() != nullptr ? icons.getBig()
: icons.getSmall();
if (imageToUse != nullptr)
{
@ -504,4 +510,86 @@ namespace juce::build_tools
return { assets, targetFolder, RelativePath::buildTargetFolder };
}
//==============================================================================
//==============================================================================
#if JUCE_UNIT_TESTS
class IconsUnitTests : public UnitTest
{
public:
IconsUnitTests() : UnitTest ("Generate icon files", UnitTestCategories::graphics) {}
void runTest() override
{
const ScopedJuceInitialiser_GUI scope;
beginTest ("Load icons from vector file");
{
TemporaryFile tempFile ("vector");
{
auto stream = tempFile.getFile().createOutputStream();
expect (stream != nullptr);
stream->write (svg, std::size (svg));
}
const auto icons = Icons::fromFilesSmallAndBig (tempFile.getFile(), {});
expect (icons.getSmall() != nullptr);
expect (icons.getBig() == nullptr);
expect (dynamic_cast<const DrawableImage*> (icons.getSmall()) == nullptr,
"Vector data should not be rasterised on load");
}
beginTest ("Load icons from raster file");
{
TemporaryFile tempFile ("raster");
{
auto stream = tempFile.getFile().createOutputStream();
expect (stream != nullptr);
stream->write (png, std::size (png));
}
const auto icons = Icons::fromFilesSmallAndBig ({}, tempFile.getFile());
expect (icons.getSmall() == nullptr);
expect (icons.getBig() != nullptr);
expect (dynamic_cast<const DrawableImage*> (icons.getBig()) != nullptr,
"Raster data is loaded as a DrawableImage");
}
}
private:
static constexpr uint8_t svg[] = R"svg(
<svg xmlns="http://www.w3.org/2000/svg" width="284.4" height="284.4" viewBox="0 0 284.4 284.4">
<g>
<ellipse cx="142.2" cy="142.2" rx="132.82" ry="132.74" fill="#fff"/>
</g>
</svg>)svg";
static constexpr uint8_t png[]
{
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07,
0x08, 0x06, 0x00, 0x00, 0x00, 0xc4, 0x52, 0x57, 0xd3, 0x00, 0x00, 0x00,
0x5e, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0x55, 0x8d, 0x49, 0x0e, 0x00,
0x21, 0x08, 0x04, 0xfd, 0x89, 0xe2, 0x12, 0x13, 0xf5, 0xea, 0xff, 0x7f,
0x46, 0x4b, 0x9b, 0xe8, 0x38, 0x87, 0x0a, 0x84, 0x5e, 0x70, 0x21, 0x04,
0x25, 0xde, 0x7b, 0xcd, 0x39, 0x6b, 0x4a, 0x69, 0xef, 0xc4, 0x89, 0x08,
0x48, 0xef, 0x1d, 0x63, 0x0c, 0xcc, 0x39, 0xd1, 0x5a, 0xe3, 0xed, 0x13,
0x2d, 0x71, 0xa1, 0xd1, 0x0c, 0xea, 0xac, 0x12, 0x31, 0x46, 0x58, 0xe5,
0x86, 0x22, 0x67, 0xad, 0xf5, 0x9f, 0x3c, 0x86, 0x52, 0x0a, 0xee, 0x4f,
0xa6, 0xdf, 0x6a, 0xee, 0x5b, 0x64, 0xe5, 0x49, 0xbf, 0x50, 0x5c, 0x2f,
0xb3, 0x44, 0xdf, 0x94, 0x9e, 0x62, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x49,
0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
};
static IconsUnitTests iconsUnitTests;
#endif
} // namespace juce::build_tools

View file

@ -35,20 +35,29 @@
namespace juce::build_tools
{
struct Icons
class Icons
{
public:
Icons() = default;
static Icons fromFilesSmallAndBig (const File& small, const File& big);
const Drawable* getSmall() const { return small.get(); }
const Drawable* getBig() const { return big.get(); }
private:
std::unique_ptr<Drawable> small;
std::unique_ptr<Drawable> big;
};
Array<Drawable*> asArray (const Icons&);
Array<const Drawable*> asArray (const Icons&);
void writeMacIcon (const Icons&, const File&);
void writeWinIcon (const Icons&, const File&);
Image getBestIconForSize (const Icons& icons,
int size,
bool returnNullIfNothingBigEnough);
Image rescaleImageForIcon (Drawable& d, int size);
Image rescaleImageForIcon (const Drawable& d, int size);
RelativePath createXcassetsFolderFromIcons (const Icons& icons,
const File& targetFolder,

View file

@ -124,19 +124,18 @@ IconParseResults parseIconArguments (juce::ArgumentList&& args)
args.checkMinNumArguments (2);
const auto output = args.arguments.removeAndReturn (0);
const auto popDrawable = [&args]() -> std::unique_ptr<juce::Drawable>
const auto popFile = [&args]() -> juce::File
{
if (args.size() == 0)
return {};
const auto firstArgText = args.arguments.removeAndReturn (0).text;
return juce::Drawable::createFromImageFile (firstArgText);
return args.arguments.removeAndReturn (0).text;
};
auto smallIcon = popDrawable();
auto bigIcon = popDrawable();
const auto smallIcon = popFile();
const auto bigIcon = popFile();
return { { std::move (smallIcon), std::move (bigIcon) }, output.text };
return { juce::build_tools::Icons::fromFilesSmallAndBig (smallIcon, bigIcon), output.text };
}
int writeMacIcon (juce::ArgumentList&& argumentList)

View file

@ -1632,19 +1632,6 @@ Project::Item Project::Item::createCopy() { Item i (*this); i.state = i.
String Project::Item::getID() const { return state [Ids::ID]; }
void Project::Item::setID (const String& newID) { state.setProperty (Ids::ID, newID, nullptr); }
std::unique_ptr<Drawable> Project::Item::loadAsImageFile() const
{
const MessageManagerLock mml (ThreadPoolJob::getCurrentThreadPoolJob());
if (! mml.lockWasGained())
return nullptr;
if (isValid())
return Drawable::createFromImageFile (getFile());
return {};
}
Project::Item Project::Item::createGroup (Project& project, const String& name, const String& uid, bool isModuleCode)
{
Item group (project, ValueTree (Ids::GROUP), isModuleCode);

View file

@ -453,9 +453,6 @@ public:
void setID (const String& newID);
Item findItemWithID (const String& targetId) const; // (recursive search)
String getImageFileID() const;
std::unique_ptr<Drawable> loadAsImageFile() const;
//==============================================================================
Value getNameValue();
String getName() const;

View file

@ -1492,15 +1492,15 @@ private:
{
const auto icons = getIcons();
if (icons.big != nullptr && icons.small != nullptr)
if (icons.getBig() != nullptr && icons.getSmall() != nullptr)
{
auto step = jmax (icons.big->getWidth(), icons.big->getHeight()) / 8;
auto step = jmax (icons.getBig()->getWidth(), icons.getBig()->getHeight()) / 8;
writeIcon (folder.getChildFile ("drawable-xhdpi/icon.png"), build_tools::getBestIconForSize (icons, step * 8, false));
writeIcon (folder.getChildFile ("drawable-hdpi/icon.png"), build_tools::getBestIconForSize (icons, step * 6, false));
writeIcon (folder.getChildFile ("drawable-mdpi/icon.png"), build_tools::getBestIconForSize (icons, step * 4, false));
writeIcon (folder.getChildFile ("drawable-ldpi/icon.png"), build_tools::getBestIconForSize (icons, step * 3, false));
}
else if (auto* icon = (icons.big != nullptr ? icons.big.get() : icons.small.get()))
else if (auto* icon = (icons.getBig() != nullptr ? icons.getBig() : icons.getSmall()))
{
writeIcon (folder.getChildFile ("drawable-mdpi/icon.png"), build_tools::rescaleImageForIcon (*icon, icon->getWidth()));
}
@ -1895,9 +1895,9 @@ private:
if (! app->hasAttribute ("android:icon"))
{
std::unique_ptr<Drawable> bigIcon (getBigIcon()), smallIcon (getSmallIcon());
const auto icons = getIcons();
if (bigIcon != nullptr || smallIcon != nullptr)
if (icons.getBig() != nullptr || icons.getSmall() != nullptr)
app->setAttribute ("android:icon", "@drawable/icon");
}

View file

@ -478,6 +478,7 @@ public:
fastMathValue (config, Ids::fastMath, getUndoManager()),
debugInformationFormatValue (config, Ids::debugInformationFormat, getUndoManager(), "ProgramDatabase"),
pluginBinaryCopyStepValue (config, Ids::enablePluginBinaryCopyStep, getUndoManager(), false),
intrinsicFunctionsEnabledValue (config, Ids::intrinsicFunctions, getUndoManager(), false),
vstBinaryLocation (config, Ids::vstBinaryLocation, getUndoManager()),
vst3BinaryLocation (config, Ids::vst3BinaryLocation, getUndoManager()),
aaxBinaryLocation (config, Ids::aaxBinaryLocation, getUndoManager()),
@ -577,6 +578,7 @@ public:
bool shouldUseMultiProcessorCompilation() const { return multiProcessorCompilationValue.get(); }
bool isFastMathEnabled() const { return fastMathValue.get(); }
bool isPluginBinaryCopyStepEnabled() const { return pluginBinaryCopyStepValue.get(); }
bool isIntrinsicFunctionsEnabled() const { return intrinsicFunctionsEnabledValue.get(); }
static bool shouldBuildTarget (build_tools::ProjectType::Target::Type targetType, Architecture arch)
{
@ -649,6 +651,9 @@ public:
{ optimisationOff, optimiseMinSize, optimiseMaxSpeed, optimiseFull }),
"The optimisation level for this configuration");
props.add (new ChoicePropertyComponent (intrinsicFunctionsEnabledValue, "Intrinsic Functions"),
"Replaces some function calls with intrinsic or otherwise special forms of the function that help your application run faster.");
props.add (new TextPropertyComponent (intermediatesPathValue, "Intermediates Path", 2048, false),
"An optional path to a folder to use for the intermediate build files. Note that Visual Studio allows "
"you to use macros in this path, e.g. \"$(TEMP)\\MyAppBuildFiles\\$(Configuration)\", which is a handy way to "
@ -749,7 +754,7 @@ public:
ValueTreePropertyWithDefault warningLevelValue, warningsAreErrorsValue, prebuildCommandValue, postbuildCommandValue, generateDebugSymbolsValue,
enableIncrementalLinkingValue, useRuntimeLibDLLValue, multiProcessorCompilationValue,
intermediatesPathValue, characterSetValue, architectureTypeValue, fastMathValue, debugInformationFormatValue,
pluginBinaryCopyStepValue;
pluginBinaryCopyStepValue, intrinsicFunctionsEnabledValue;
struct LocationProperties
{
@ -1126,6 +1131,9 @@ public:
auto cppStandard = owner.project.getCppStandardString();
cl->createNewChildElement ("LanguageStandard")->addTextElement ("stdcpp" + cppStandard);
if (config.isIntrinsicFunctionsEnabled())
cl->createNewChildElement ("IntrinsicFunctions")->addTextElement ("true");
}
{

View file

@ -867,14 +867,20 @@ void ProjectExporter::createDefaultConfigs()
}
}
std::unique_ptr<Drawable> ProjectExporter::getBigIcon() const
build_tools::Icons ProjectExporter::getIcons() const
{
return project.getMainGroup().findItemWithID (settings [Ids::bigIcon]).loadAsImageFile();
}
const MessageManagerLock mml (ThreadPoolJob::getCurrentThreadPoolJob());
std::unique_ptr<Drawable> ProjectExporter::getSmallIcon() const
{
return project.getMainGroup().findItemWithID (settings [Ids::smallIcon]).loadAsImageFile();
if (! mml.lockWasGained())
return {};
const auto getFile = [this] (auto id)
{
return project.getMainGroup().findItemWithID (settings[id]).getFile();
};
return build_tools::Icons::fromFilesSmallAndBig (getFile (Ids::smallIcon),
getFile (Ids::bigIcon));
}
//==============================================================================

View file

@ -238,9 +238,7 @@ public:
void addProjectPathToBuildPathList (StringArray&, const build_tools::RelativePath&, int index = -1) const;
std::unique_ptr<Drawable> getBigIcon() const;
std::unique_ptr<Drawable> getSmallIcon() const;
build_tools::Icons getIcons() const { return { getSmallIcon(), getBigIcon() }; }
build_tools::Icons getIcons() const;
String getExporterIdentifierMacro() const
{

View file

@ -125,6 +125,7 @@ namespace Ids
DECLARE_ID (cppLibType);
DECLARE_ID (codeSigningIdentity);
DECLARE_ID (fastMath);
DECLARE_ID (intrinsicFunctions);
DECLARE_ID (linkTimeOptimisation);
DECLARE_ID (vstBinaryLocation);
DECLARE_ID (vst3BinaryLocation);

View file

@ -50,6 +50,7 @@ target_compile_definitions(UnitTestRunner PRIVATE
target_link_libraries(UnitTestRunner PRIVATE
juce::juce_analytics
juce::juce_audio_utils
juce::juce_build_tools
juce::juce_dsp
juce::juce_midi_ci
juce::juce_opengl

View file

@ -60,15 +60,27 @@ class ConsoleUnitTestRunner final : public UnitTestRunner
//==============================================================================
int main (int argc, char **argv)
{
constexpr auto helpOption = "--help|-h";
constexpr auto listOption = "--list-categories|-l";
constexpr auto categoryOption = "--category|-c";
constexpr auto seedOption = "--seed|-s";
constexpr auto nameOption = "--name|-n";
ArgumentList args (argc, argv);
if (args.containsOption ("--help|-h"))
if (args.containsOption (helpOption))
{
std::cout << argv[0] << " [--help|-h] [--list-categories] [--category=category] [--seed=seed]" << std::endl;
std::cout << argv[0]
<< " [" << helpOption << "]"
<< " [" << listOption << "]"
<< " [" << categoryOption << "=category]"
<< " [" << seedOption << "=seed]"
<< " [" << nameOption << "=name]"
<< std::endl;
return 0;
}
if (args.containsOption ("--list-categories"))
if (args.containsOption (listOption))
{
for (auto& category : UnitTest::getAllCategories())
std::cout << category << std::endl;
@ -79,13 +91,19 @@ int main (int argc, char **argv)
ConsoleLogger logger;
Logger::setCurrentLogger (&logger);
const ScopeGuard onExit { [&]
{
Logger::setCurrentLogger (nullptr);
DeletedAtShutdown::deleteAll();
}};
ConsoleUnitTestRunner runner;
auto seed = [&args]
const auto seed = std::invoke ([&]
{
if (args.containsOption ("--seed"))
if (args.containsOption (seedOption))
{
auto seedValueString = args.getValueForOption ("--seed");
auto seedValueString = args.getValueForOption (seedOption);
if (seedValueString.startsWith ("0x"))
return seedValueString.getHexValue64();
@ -94,10 +112,12 @@ int main (int argc, char **argv)
}
return Random::getSystemRandom().nextInt64();
}();
});
if (args.containsOption ("--category"))
runner.runTestsInCategory (args.getValueForOption ("--category"), seed);
if (args.containsOption (categoryOption))
runner.runTestsInCategory (args.getValueForOption (categoryOption), seed);
else if (args.containsOption (nameOption))
runner.runTestsWithName (args.getValueForOption (nameOption), seed);
else
runner.runAllTests (seed);
@ -108,24 +128,28 @@ int main (int argc, char **argv)
auto* result = runner.getResult (i);
if (result->failures > 0)
failures.push_back (result->unitTestName + " / " + result->subcategoryName + ": " + String (result->failures) + " test failure" + (result->failures > 1 ? "s" : ""));
{
const auto testName = result->unitTestName + " / " + result->subcategoryName;
const auto testSummary = String (result->failures) + " test failure" + (result->failures > 1 ? "s" : "");
const auto newLineAndTab = newLine + "\t";
failures.push_back (testName + ": " + testSummary + newLineAndTab
+ result->messages.joinIntoString (newLineAndTab));
}
}
logger.writeToLog (newLine + String::repeatedString ("-", 65));
if (! failures.empty())
{
logger.writeToLog (newLine + "Test failure summary:" + newLine);
logger.writeToLog ("Test failure summary:");
for (const auto& failure : failures)
logger.writeToLog (failure);
logger.writeToLog (newLine + failure);
Logger::setCurrentLogger (nullptr);
return 1;
}
logger.writeToLog (newLine + "All tests completed successfully");
Logger::setCurrentLogger (nullptr);
DeletedAtShutdown::deleteAll();
logger.writeToLog ("All tests completed successfully");
return 0;
}

View file

@ -103,9 +103,9 @@ public:
*/
void setSuspended (bool shouldBeSuspended);
#ifndef DOXYGEN
/** @cond */
JUCE_DECLARE_SINGLETON_INLINE (Analytics, false)
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -76,8 +76,9 @@ public:
class NonConst; /**< Used as a template parameter for AudioData::Pointer. Indicates that the pointer can be used for non-const data. */
class Const; /**< Used as a template parameter for AudioData::Pointer. Indicates that the samples can only be used for const data.. */
#ifndef DOXYGEN
//==============================================================================
/** @cond */
class BigEndian
{
public:
@ -332,7 +333,7 @@ public:
static void* toVoidPtr (VoidType* v) noexcept { return const_cast<void*> (v); }
enum { isConst = 1 };
};
#endif
/** @endcond */
//==============================================================================
/**
@ -799,7 +800,7 @@ public:
};
//==============================================================================
#ifndef DOXYGEN
/** @cond */
/**
A set of routines to convert buffers of 32-bit floating point data to and from
various integer formats.
@ -867,6 +868,6 @@ public:
private:
AudioDataConverters();
};
#endif
/** @endcond */
} // namespace juce

View file

@ -150,7 +150,7 @@ struct JUCE_API FloatVectorOperationsBase
static FloatType JUCE_CALLTYPE findMaximum (const FloatType* src, CountType numValues) noexcept;
};
#if ! DOXYGEN
/** @cond */
namespace detail
{
@ -177,7 +177,7 @@ struct NameForwarder : public Bases...
};
} // namespace detail
#endif
/** @endcond */
//==============================================================================
/**

View file

@ -292,7 +292,7 @@ public:
MidiBufferIterator findNextSamplePosition (int samplePosition) const noexcept;
//==============================================================================
#ifndef DOXYGEN
/** @cond */
/** This class is now deprecated in favour of MidiBufferIterator.
Used to iterate through the events in a MidiBuffer.
@ -349,7 +349,7 @@ public:
const MidiBuffer& buffer;
MidiBufferIterator iterator;
};
#endif
/** @endcond */
/** The raw data holding this buffer.
Obviously access to this data is provided at your own risk. Its internal format could

View file

@ -880,7 +880,7 @@ public:
static MidiMessage createSysExMessage (Span<const std::byte> data);
//==============================================================================
#ifndef DOXYGEN
/** @cond */
/** Reads a midi variable-length integer.
The `data` argument indicates the data to read the number from,
@ -889,7 +889,7 @@ public:
*/
[[deprecated ("This signature has been deprecated in favour of the safer readVariableLengthValue.")]]
static int readVariableLengthVal (const uint8* data, int& numBytesUsed) noexcept;
#endif
/** @endcond */
/** Holds information about a variable-length value which was parsed
from a stream of bytes.
@ -996,17 +996,17 @@ public:
private:
//==============================================================================
#ifndef DOXYGEN
/** @cond */
union PackedData
{
uint8* allocatedData;
uint8 asBytes[sizeof (uint8*)];
};
/** @endcond */
PackedData packedData;
double timeStamp = 0;
int size;
#endif
inline bool isHeapAllocated() const noexcept { return size > (int) sizeof (packedData); }
inline uint8* getData() const noexcept { return isHeapAllocated() ? packedData.allocatedData : (uint8*) packedData.asBytes; }

View file

@ -47,11 +47,9 @@
#include "juce_UMPDispatcher.h"
#include "juce_UMPStringUtils.h"
#ifndef DOXYGEN
/** @cond */
namespace juce
{
namespace ump = universal_midi_packets;
}
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -358,5 +357,4 @@ struct Conversion
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
/**
@ -212,5 +211,4 @@ namespace juce::universal_midi_packets
SingleGroupMidi1ToBytestreamTranslator translator;
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -205,5 +204,4 @@ private:
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -128,5 +127,4 @@ private:
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -300,5 +299,4 @@ private:
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -196,5 +195,4 @@ private:
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -63,5 +62,4 @@ enum class MidiProtocol : uint8_t
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -82,5 +81,4 @@ struct SysEx7
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -146,5 +145,4 @@ struct Utils
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -97,5 +96,4 @@ private:
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -209,5 +208,4 @@ using PacketX3 = Packet<3>;
using PacketX4 = Packet<4>;
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce::universal_midi_packets
{
@ -101,5 +100,4 @@ private:
};
} // namespace juce::universal_midi_packets
#endif
/** @endcond */

View file

@ -226,9 +226,9 @@ public:
/** Removes a listener. */
void removeListener (Listener* const listenerToRemove) noexcept;
#ifndef DOXYGEN
/** @cond */
using Zone = MPEZone;
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -32,10 +32,11 @@
==============================================================================
*/
/** @cond */
namespace juce
{
#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS)
#if JUCE_MAC || JUCE_IOS
struct CoreAudioLayouts
{
@ -361,3 +362,4 @@ private:
#endif
} // namespace juce
/** @endcond */

View file

@ -36,7 +36,7 @@
// This file will be included directly by macOS/iOS-specific .cpps
#pragma once
#if ! DOXYGEN
/** @cond */
#include <mach/mach_time.h>
@ -89,4 +89,4 @@ private:
} // namespace juce
#endif
/** @endcond */

View file

@ -342,7 +342,7 @@ public:
}
//==============================================================================
#ifndef DOXYGEN
/** @cond */
/** Using the new methods:
lsv.setValue (x, false); -> lsv.setTargetValue (x);
@ -362,7 +362,7 @@ public:
setTargetValue (newValue);
}
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -486,7 +486,7 @@ public:
int getXRunCount() const noexcept;
//==============================================================================
#ifndef DOXYGEN
/** @cond */
[[deprecated ("Use setMidiInputDeviceEnabled instead.")]]
void setMidiInputEnabled (const String&, bool);
[[deprecated ("Use isMidiInputDeviceEnabled instead.")]]
@ -499,7 +499,7 @@ public:
void setDefaultMidiOutput (const String&);
[[deprecated ("Use getDefaultMidiOutputIdentifier instead.")]]
const String& getDefaultMidiOutputName() const noexcept { return defaultMidiOutputDeviceInfo.name; }
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -177,10 +177,10 @@ public:
/** Creates an Oboe device type if it's available on this platform, or returns null. */
static AudioIODeviceType* createAudioIODeviceType_Oboe();
#ifndef DOXYGEN
/** @cond */
[[deprecated ("You should call the method which takes a WASAPIDeviceMode instead.")]]
static AudioIODeviceType* createAudioIODeviceType_WASAPI (bool exclusiveMode);
#endif
/** @endcond */
protected:
explicit AudioIODeviceType (const String& typeName);

View file

@ -97,7 +97,7 @@ FUNCTION_TEMPLATE = """/*
#pragma once
#ifndef DOXYGEN
/** @cond */
#include <vector>
@ -130,7 +130,7 @@ std::vector<juce::lv2::Bundle> juce::lv2::Bundle::getAllBundles()
}};
}}
#endif"""
/** @endcond */"""
def chunks(lst, n):

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
// This macro can be set if you need to override this internal name for some reason..
#ifndef JUCE_STATE_DICTIONARY_KEY
#define JUCE_STATE_DICTIONARY_KEY "jucePluginState"
@ -711,5 +710,4 @@ struct AudioUnitHelpers
};
} // namespace juce
#endif
/** @endcond */

View file

@ -34,7 +34,7 @@
#pragma once
#ifndef DOXYGEN
/** @cond */
#include "juce_lv2_config.h"
@ -672,5 +672,4 @@ static inline String sanitiseStringAsTtlName (const String& input)
}
} // namespace juce::lv2_shared
#endif
/** @endcond */

View file

@ -38,7 +38,7 @@
#pragma once
#ifndef DOXYGEN
/** @cond */
#include <vector>
@ -10238,4 +10238,4 @@ to an instance of LV2_Extension_Data_Feature.
};
}
#endif
/** @endcond */

View file

@ -34,8 +34,7 @@
#pragma once
#ifndef DOXYGEN
/** @cond */
namespace juce
{
@ -1663,5 +1662,4 @@ private:
JUCE_END_NO_SANITIZE
} // namespace juce
#endif
/** @endcond */

View file

@ -52,7 +52,7 @@ public:
~VST3PluginFormat() override;
//==============================================================================
#ifndef DOXYGEN
/** @cond */
/** Attempts to reload a VST3 plugin's state from some preset file data.
@see VSTPluginFormat::loadFromFXBFile
@ -62,7 +62,7 @@ public:
"Then, call ExtensionsVisitor::VST3::setPreset() to set the state using the "
"contents of a vstpreset file.")]]
static bool setStateFromVSTPresetFile (AudioPluginInstance*, const MemoryBlock&);
#endif
/** @endcond */
//==============================================================================
static String getFormatName() { return "VST3"; }

View file

@ -34,8 +34,7 @@
#pragma once
#ifndef DOXYGEN
/** @cond */
namespace juce
{
@ -239,5 +238,4 @@ auto becomeVSTComSmartPtrOwner (ObjectType* t)
JUCE_END_NO_SANITIZE
} // namespace juce
#endif // DOXYGEN
/** @endcond */

View file

@ -118,7 +118,7 @@ public:
*/
HostedParameter* getHostedParameter (int index) const;
#ifndef DOXYGEN
/** @cond */
/** Use the new typesafe visitor-based interface rather than this function.
Returns a pointer to some kind of platform-specific data about the plugin.
@ -150,7 +150,7 @@ public:
[[deprecated]] bool isParameterOrientationInverted (int parameterIndex) const override;
[[deprecated]] bool isMetaParameter (int parameterIndex) const override;
[[deprecated]] AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const override;
#endif
/** @endcond */
protected:
//==============================================================================

View file

@ -1487,7 +1487,7 @@ protected:
void sendParamChangeMessageToListeners (int parameterIndex, float newValue);
public:
#ifndef DOXYGEN
/** @cond */
// These methods are all deprecated in favour of using AudioProcessorParameter
// and AudioProcessorParameterGroup
[[deprecated]] virtual int getNumParameters();
@ -1520,7 +1520,7 @@ public:
[[deprecated]] virtual const String getOutputChannelName (int channelIndex) const;
[[deprecated]] virtual bool isInputChannelStereoPair (int index) const;
[[deprecated]] virtual bool isOutputChannelStereoPair (int index) const;
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -1193,18 +1193,25 @@ private:
jassert (bufIndex >= 0);
}
if (inputChan < numOuts && isBufferNeededLater (reversed, ourRenderingIndex, inputChan, src))
const auto nodeDelay = getNodeDelay (src.nodeID);
const auto needsDelay = nodeDelay < maxLatency;
if ((inputChan < numOuts || needsDelay)
&& isBufferNeededLater (reversed, ourRenderingIndex, inputChan, src))
{
// can't mess up this channel because it's needed later by another node,
// so we need to use a copy of it..
// We can't modify this channel because it's needed later by another node,
// so we need to use a copy of it.
// If the input channel index matches any output channel index, this implies that
// the output would overwrite the content of the input buffer.
// If the input needs to be delayed by some amount, this will modify the buffer
// in-place which will produce the wrong delay if a subsequent input needs a
// different delay value.
auto newFreeBuffer = getFreeBuffer (audioBuffers);
sequence.addCopyChannelOp (bufIndex, newFreeBuffer);
bufIndex = newFreeBuffer;
}
auto nodeDelay = getNodeDelay (src.nodeID);
if (nodeDelay < maxLatency)
if (needsDelay)
sequence.addDelayChannelOp (bufIndex, maxLatency - nodeDelay);
return bufIndex;
@ -2144,6 +2151,8 @@ public:
void runTest() override
{
const ScopedJuceInitialiser_GUI scope;
const auto midiChannel = AudioProcessorGraph::midiChannelIndex;
beginTest ("isConnected returns true when two nodes are connected");
@ -2330,6 +2339,66 @@ public:
// not a supported usage pattern.
}
beginTest ("When a delayed channel is used as an input to multiple nodes, the delay is applied appropriately for each node");
{
AudioProcessorGraph graph;
graph.setBusesLayout ({ { AudioChannelSet::stereo() }, { AudioChannelSet::mono() } });
const auto nodeA = graph.addNode (BasicProcessor::make (BasicProcessor::getStereoInMonoOut(), MidiIn::no, MidiOut::no));
const auto nodeB = graph.addNode (BasicProcessor::make (BasicProcessor::getStereoInMonoOut(), MidiIn::no, MidiOut::no));
const auto nodeC = graph.addNode (BasicProcessor::make (BasicProcessor::getStereoInMonoOut(), MidiIn::no, MidiOut::no));
const auto input = graph.addNode (std::make_unique<AudioProcessorGraph::AudioGraphIOProcessor> (AudioProcessorGraph::AudioGraphIOProcessor::IODeviceType::audioInputNode));
const auto output = graph.addNode (std::make_unique<AudioProcessorGraph::AudioGraphIOProcessor> (AudioProcessorGraph::AudioGraphIOProcessor::IODeviceType::audioOutputNode));
constexpr auto latencySamples = 2;
nodeA->getProcessor()->setLatencySamples (latencySamples);
// [input 0 1] 0 and 1 denote input/output channels
// | |
// | |
// [nodeA 0 1] | nodeA has latency applied
// | /|
// | / |
// [nodeB 0 1] | each node sums all input channels onto the first output channel
// | /
// | /
// [nodeC 0 1]
// |
// |
// [out 0]
expect (graph.addConnection ({ { input->nodeID, 0}, { nodeA->nodeID, 0} }));
expect (graph.addConnection ({ { input->nodeID, 1}, { nodeB->nodeID, 1} }));
expect (graph.addConnection ({ { input->nodeID, 1}, { nodeC->nodeID, 1} }));
expect (graph.addConnection ({ { nodeA->nodeID, 0}, { nodeB->nodeID, 0} }));
expect (graph.addConnection ({ { nodeB->nodeID, 0}, { nodeC->nodeID, 0} }));
expect (graph.addConnection ({ { nodeC->nodeID, 0}, { output->nodeID, 0} }));
graph.rebuild();
constexpr auto blockSize = 128;
graph.prepareToPlay (44100.0, blockSize);
expect (graph.getLatencySamples() == latencySamples);
AudioBuffer<float> audio (2, blockSize);
audio.clear();
audio.setSample (1, 0, 1.0f);
MidiBuffer midi;
graph.processBlock (audio, midi);
// The impulse should arrive at nodes B and C simultaneously, so the end result should
// be a double-amplitude impulse with the latency of node A applied
for (auto i = 0; i < blockSize; ++i)
{
const auto expected = i == latencySamples ? 2.0f : 0.0f;
expect (exactlyEqual (audio.getSample (0, i), expected));
}
}
beginTest ("large render sequence can be built");
{
AudioProcessorGraph graph;
@ -2368,7 +2437,7 @@ private:
class BasicProcessor final : public AudioProcessor
{
public:
explicit BasicProcessor (const AudioProcessor::BusesProperties& layout, MidiIn mIn, MidiOut mOut)
explicit BasicProcessor (const BusesProperties& layout, MidiIn mIn, MidiOut mOut)
: AudioProcessor (layout), midiIn (mIn), midiOut (mOut) {}
const String getName() const override { return "Basic Processor"; }
@ -2382,7 +2451,7 @@ private:
void setCurrentProgram (int) override {}
const String getProgramName (int) override { return {}; }
void changeProgramName (int, const String&) override {}
void getStateInformation (juce::MemoryBlock&) override {}
void getStateInformation (MemoryBlock&) override {}
void setStateInformation (const void*, int) override {}
void prepareToPlay (double, int) override {}
void releaseResources() override {}
@ -2391,14 +2460,20 @@ private:
void reset() override {}
void setNonRealtime (bool) noexcept override {}
void processBlock (AudioBuffer<float>&, MidiBuffer&) override
void processBlock (AudioBuffer<float>& audio, MidiBuffer&) override
{
blockPrecision = singlePrecision;
for (auto i = 1; i < audio.getNumChannels(); ++i)
audio.addFrom (0, 0, audio.getReadPointer (i), audio.getNumSamples());
}
void processBlock (AudioBuffer<double>&, MidiBuffer&) override
void processBlock (AudioBuffer<double>& audio, MidiBuffer&) override
{
blockPrecision = doublePrecision;
for (auto i = 1; i < audio.getNumChannels(); ++i)
audio.addFrom (0, 0, audio.getReadPointer (i), audio.getNumSamples());
}
static std::unique_ptr<BasicProcessor> make (const BusesProperties& layout,
@ -2419,6 +2494,12 @@ private:
.withOutput ("out", AudioChannelSet::stereo());
}
static BusesProperties getStereoInMonoOut()
{
return BusesProperties().withInput ("in", AudioChannelSet::stereo())
.withOutput ("out", AudioChannelSet::mono());
}
static BusesProperties getMultichannelProperties (int numChannels)
{
return BusesProperties().withInput ("in", AudioChannelSet::discreteChannels (numChannels))

View file

@ -235,13 +235,13 @@ public:
addChild (std::forward<Args> (remainingChildren)...);
}
#ifndef DOXYGEN
/** @cond */
[[deprecated ("This class now has a move operator, so if you're trying to move them around, you "
"should use that, or if you really need to swap two groups, just call std::swap. "
"However, remember that swapping a group that's already owned by an AudioProcessor "
"will most likely crash the host, so don't do that.")]]
void swapWith (AudioProcessorParameterGroup& other) { std::swap (*this, other); }
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -58,10 +58,10 @@ public:
void paint (Graphics&) override;
void resized() override;
#ifndef DOXYGEN
/** @cond */
[[deprecated ("This constructor has been changed to take a reference instead of a pointer.")]]
GenericAudioProcessorEditor (AudioProcessor* p) : GenericAudioProcessorEditor (*p) {}
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -218,7 +218,7 @@ public:
void setCustomScanner (std::unique_ptr<CustomScanner> newScanner);
//==============================================================================
#ifndef DOXYGEN
/** @cond */
// These methods have been deprecated! When getting the list of plugin types you should instead use
// the getTypes() method which returns a copy of the internal PluginDescription array and can be accessed
// in a thread-safe way.
@ -234,7 +234,7 @@ public:
[[deprecated]] void addToMenu (PopupMenu& menu, SortMethod sortMethod, const String& currentlyTickedPluginID = {}) const;
[[deprecated]] int getIndexChosenByMenu (int menuResultCode) const;
[[deprecated]] std::unique_ptr<PluginTree> createTree (SortMethod sortMethod) const;
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -36,9 +36,11 @@
#include <juce_core/system/juce_PlatformDefs.h>
#if ! (defined (JUCE_API) || defined (DOXYGEN))
#define JUCE_API
/** @cond */
#ifndef JUCE_API
#define JUCE_API
#endif
/** @endcond */
#if (JucePlugin_Enable_ARA || (JUCE_PLUGINHOST_ARA && (JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU))) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)

View file

@ -141,8 +141,7 @@ protected:
void doRequestProcessingAlgorithmForAudioSource (ARA::PlugIn::AudioSource* audioSource,
ARA::ARAInt32 algorithmIndex) noexcept override;
#ifndef DOXYGEN
/** @cond */
//==============================================================================
bool doRestoreObjectsFromArchive (ARA::PlugIn::HostArchiveReader* archiveReader, const ARA::PlugIn::RestoreObjectsFilter* filter) noexcept override;
bool doStoreObjectsToArchive (ARA::PlugIn::HostArchiveWriter* archiveWriter, const ARA::PlugIn::StoreObjectsFilter* filter) noexcept override;
@ -211,8 +210,10 @@ protected:
void willUpdatePlaybackRegionProperties (ARA::PlugIn::PlaybackRegion* playbackRegion, ARAPlaybackRegion::PropertiesPtr newProperties) noexcept override;
void didUpdatePlaybackRegionProperties (ARA::PlugIn::PlaybackRegion* playbackRegion) noexcept override;
void willDestroyPlaybackRegion (ARA::PlugIn::PlaybackRegion* playbackRegion) noexcept override;
/** @endcond */
public:
/** @cond */
//==============================================================================
/** @internal */
void internalNotifyAudioSourceAnalysisProgressStarted (ARAAudioSource* audioSource) override;
@ -244,7 +245,7 @@ public:
ARAContentUpdateScopes scopeFlags,
bool notifyARAHost) override;
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -279,7 +279,7 @@ public:
~AudioProcessorValueTreeState() override;
//==============================================================================
#ifndef DOXYGEN
/** @cond */
/** Previous calls to
@code
@ -326,7 +326,7 @@ public:
bool isDiscrete = false,
AudioProcessorParameter::Category parameterCategory = AudioProcessorParameter::genericParameter,
bool isBoolean = false);
#endif
/** @endcond */
/** This function adds a parameter to the attached AudioProcessor and that parameter will
be managed by this AudioProcessorValueTreeState object.

View file

@ -32,7 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
// Forward declarations to avoid leaking implementation details.
namespace Steinberg::Vst
@ -40,7 +40,7 @@ namespace Steinberg::Vst
class IComponent;
} // namespace Steinberg::Vst
#endif
/** @endcond */
//==============================================================================
#if TARGET_OS_IPHONE

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#if ! DOXYGEN
/** @cond */
namespace juce
{
@ -187,5 +186,4 @@ private:
};
} // namespace juce
#endif
/** @endcond */

View file

@ -251,12 +251,12 @@ public:
//==============================================================================
#ifndef DOXYGEN
/** @cond */
// @internal
static AudioProcessor::WrapperType jucePlugInClientCurrentWrapperType;
static std::function<bool (AudioProcessor&)> jucePlugInIsRunningInAudioSuiteFn;
static String hostIdReportedByWrapper;
#endif
/** @endcond */
private:
static HostType getHostType();

View file

@ -32,7 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
// Forward declaration to avoid leaking implementation details.
namespace Steinberg
@ -41,7 +41,7 @@ namespace Steinberg
using TUID = char[16];
} // namespace Steinberg
#endif // DOXYGEN
/** @endcond */
namespace juce
{

View file

@ -204,11 +204,11 @@ public:
*/
NoteAndVelocity getNoteAndVelocityAtPosition (Point<float> position, bool includeChildComponents = false);
#ifndef DOXYGEN
/** @cond */
/** Returns the key at a given coordinate, or -1 if the position does not intersect a key. */
[[deprecated ("This method has been deprecated in favour of getNoteAndVelocityAtPosition.")]]
int getNoteAtPosition (Point<float> p) { return getNoteAndVelocityAtPosition (p).note; }
#endif
/** @endcond */
/** Returns the rectangle for a given key. */
Rectangle<float> getRectangleForKey (int midiNoteNumber) const;

View file

@ -80,6 +80,7 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion",
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#ifndef DOXYGEN // for some reason, Doxygen sees this as a re-definition of Box2DRenderer
#include "utils/juce_Box2DRenderer.h"
#endif // DOXYGEN
// For some reason, Doxygen sees this as a re-definition of Box2DRenderer
/** @cond */
#include "utils/juce_Box2DRenderer.h"
/** @endcond */

View file

@ -1107,11 +1107,11 @@ public:
//==============================================================================
#ifndef DOXYGEN
/** @cond */
[[deprecated ("This method has been replaced by a more flexible templated version and renamed "
"to swapWith to be more consistent with the names used in other classes.")]]
void swapWithArray (Array& other) noexcept { swapWith (other); }
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -35,8 +35,7 @@
namespace juce
{
#ifndef DOXYGEN
/** @cond */
/** This is an internal helper class which converts a juce ElementComparator style
class (using a "compareElements" method) into a class that's compatible with
std::sort (i.e. using an operator() to compare the elements)
@ -57,8 +56,7 @@ private:
SortFunctionConverter& operator= (const SortFunctionConverter&) = delete;
};
#endif
/** @endcond */
//==============================================================================

View file

@ -35,8 +35,7 @@
namespace juce
{
#ifndef DOXYGEN
/** @cond */
namespace detail
{
template <typename Ret, typename... Args>
@ -91,8 +90,7 @@ namespace detail
template <size_t len, typename T>
class FixedSizeFunction;
#endif
/** @endcond */
/**
A type similar to `std::function` that holds a callable object.

View file

@ -42,9 +42,9 @@ constexpr auto nullopt = std::nullopt;
// link time code generation.
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4702)
#ifndef DOXYGEN
/** @cond */
#define JUCE_OPTIONAL_OPERATORS X(==) X(!=) X(<) X(<=) X(>) X(>=)
#endif
/** @endcond */
/**
A simple optional type.
@ -175,7 +175,7 @@ Optional<std::decay_t<Value>> makeOptional (Value&& v)
return std::forward<Value> (v);
}
#ifndef DOXYGEN
/** @cond */
#define X(op) \
template <typename T, typename U> bool operator op (const Optional<T>& lhs, const Optional<U>& rhs) { return lhs.opt op rhs.opt; } \
template <typename T> bool operator op (const Optional<T>& lhs, Nullopt rhs) { return lhs.opt op rhs; } \
@ -187,6 +187,6 @@ JUCE_OPTIONAL_OPERATORS
#undef X
#undef JUCE_OPTIONAL_OPERATORS
#endif
/** @endcond */
} // namespace juce

View file

@ -806,11 +806,11 @@ public:
using ScopedLockType = typename TypeOfCriticalSectionToUse::ScopedLockType;
//==============================================================================
#ifndef DOXYGEN
/** @cond */
[[deprecated ("This method has been replaced by a more flexible templated version and renamed "
"to swapWith to be more consistent with the names used in other classes.")]]
void swapWithArray (OwnedArray& other) noexcept { swapWith (other); }
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -854,11 +854,11 @@ public:
using ScopedLockType = typename TypeOfCriticalSectionToUse::ScopedLockType;
//==============================================================================
#ifndef DOXYGEN
/** @cond */
[[deprecated ("This method has been replaced by a more flexible templated version and renamed "
"to swapWith to be more consistent with the names used in other classes.")]]
void swapWithArray (ReferenceCountedArray& other) noexcept { swapWith (other); }
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -295,12 +295,14 @@ public:
static var readFromStream (InputStream& input);
//==============================================================================
#if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN)
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
/** @cond */
[[deprecated ("This was a static empty var object, but is now deprecated as it's too easy to accidentally "
"use it indirectly during a static constructor leading to hard-to-find order-of-initialisation "
"problems. Use var() or {} instead. For returning an empty var from a function by reference, "
"use a function-local static var and return that.")]]
static const var null;
/** @endcond */
#endif
private:

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce
{
@ -84,5 +83,4 @@ private:
};
} // namespace juce
#endif
/** @endcond */

View file

@ -35,8 +35,7 @@
namespace juce
{
#ifndef DOXYGEN
/** @cond */
//==============================================================================
/**
This class is now deprecated in favour of RangedDirectoryIterator.
@ -203,7 +202,6 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryIterator)
};
#endif
/** @endcond */
} // namespace juce

View file

@ -35,9 +35,11 @@
namespace juce
{
#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS)
/** @cond */
#if JUCE_MAC || JUCE_IOS
using OSType = unsigned int;
#endif
/** @endcond */
//==============================================================================
/**
@ -1153,7 +1155,8 @@ public:
bool foldersFirst;
};
#if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN)
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
/** @cond */
/* These static objects are deprecated because it's too easy to accidentally use them indirectly
during a static constructor, which leads to very obscure order-of-initialisation bugs.
Use File::getSeparatorChar() and File::getSeparatorString(), and instead of File::nonexistent,
@ -1162,6 +1165,7 @@ public:
[[deprecated]] static const juce_wchar separator;
[[deprecated]] static const StringRef separatorString;
[[deprecated]] static const File nonexistent;
/** @endcond */
#endif
private:

View file

@ -499,16 +499,14 @@ struct VariantConverter
}
};
#ifndef DOXYGEN
/** @cond */
template <>
struct VariantConverter<String>
{
static String fromVar (const var& v) { return v.toString(); }
static var toVar (const String& s) { return s; }
};
#endif
/** @endcond */
/**
A helper type that can be used to implement specialisations of VariantConverter that use

View file

@ -394,7 +394,7 @@ JUCE_END_IGNORE_WARNINGS_MSVC
#include "unit_tests/juce_UnitTestCategories.h"
#endif
#ifndef DOXYGEN
/** @cond */
namespace juce
{
/*
@ -415,7 +415,7 @@ namespace juce
static this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode compileUnitMismatchSentinel;
#endif
}
#endif
/** @endcond */
JUCE_END_IGNORE_WARNINGS_MSVC

View file

@ -68,14 +68,14 @@ using uint32 = unsigned int;
using uint64 = unsigned long long;
#endif
#ifndef DOXYGEN
/** A macro for creating 64-bit literals.
Historically, this was needed to support portability with MSVC6, and is kept here
so that old code will still compile, but nowadays every compiler will support the
LL and ULL suffixes, so you should use those in preference to this macro.
*/
#define literal64bit(longLiteral) (longLiteral##LL)
#endif
/** @cond */
/** A macro for creating 64-bit literals.
Historically, this was needed to support portability with MSVC6, and is kept here
so that old code will still compile, but nowadays every compiler will support the
LL and ULL suffixes, so you should use those in preference to this macro.
*/
#define literal64bit(longLiteral) (longLiteral##LL)
/** @endcond */
#if JUCE_64BIT
/** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */
@ -129,7 +129,7 @@ Type juce_hypot (Type a, Type b) noexcept
#endif
}
#ifndef DOXYGEN
/** @cond */
template <>
inline float juce_hypot (float a, float b) noexcept
{
@ -139,7 +139,7 @@ inline float juce_hypot (float a, float b) noexcept
return hypotf (a, b);
#endif
}
#endif
/** @endcond */
//==============================================================================
/** Commonly used mathematical constants
@ -165,7 +165,7 @@ struct MathConstants
static constexpr FloatType sqrt2 = static_cast<FloatType> (1.4142135623730950488L);
};
#ifndef DOXYGEN
/** @cond */
/** A double-precision constant for pi. */
[[deprecated ("This is deprecated in favour of MathConstants<double>::pi.")]]
const constexpr double double_Pi = MathConstants<double>::pi;
@ -173,7 +173,7 @@ const constexpr double double_Pi = MathConstants<double>::pi;
/** A single-precision constant for pi. */
[[deprecated ("This is deprecated in favour of MathConstants<float>::pi.")]]
const constexpr float float_Pi = MathConstants<float>::pi;
#endif
/** @endcond */
/** Converts an angle in degrees to radians. */
template <typename FloatType>
@ -763,7 +763,7 @@ namespace TypeHelpers
*/
template <typename Type> struct ParameterType { using type = const Type&; };
#ifndef DOXYGEN
/** @cond */
template <typename Type> struct ParameterType <Type&> { using type = Type&; };
template <typename Type> struct ParameterType <Type*> { using type = Type*; };
template <> struct ParameterType <char> { using type = char; };
@ -779,7 +779,7 @@ namespace TypeHelpers
template <> struct ParameterType <bool> { using type = bool; };
template <> struct ParameterType <float> { using type = float; };
template <> struct ParameterType <double> { using type = double; };
#endif
/** @endcond */
/** These templates are designed to take a type, and if it's a double, they return a double
type; for anything else, they return a float type.
@ -796,20 +796,20 @@ namespace TypeHelpers
*/
template <int bytes> struct UnsignedTypeWithSize {};
#ifndef DOXYGEN
/** @cond */
template <> struct UnsignedTypeWithSize<1> { using type = uint8; };
template <> struct UnsignedTypeWithSize<2> { using type = uint16; };
template <> struct UnsignedTypeWithSize<4> { using type = uint32; };
template <> struct UnsignedTypeWithSize<8> { using type = uint64; };
#endif
/** @endcond */
}
//==============================================================================
#ifndef DOXYGEN
[[deprecated ("Use roundToInt instead.")]] inline int roundDoubleToInt (double value) noexcept { return roundToInt (value); }
[[deprecated ("Use roundToInt instead.")]] inline int roundFloatToInt (float value) noexcept { return roundToInt (value); }
[[deprecated ("Use std::abs() instead.")]] inline int64 abs64 (int64 n) noexcept { return std::abs (n); }
#endif
/** @cond */
[[deprecated ("Use roundToInt instead.")]] inline int roundDoubleToInt (double value) noexcept { return roundToInt (value); }
[[deprecated ("Use roundToInt instead.")]] inline int roundFloatToInt (float value) noexcept { return roundToInt (value); }
[[deprecated ("Use std::abs() instead.")]] inline int64 abs64 (int64 n) noexcept { return std::abs (n); }
/** @endcond */
/** Converts an enum to its underlying integral type.
Similar to std::to_underlying, which is only available in C++23 and above.

View file

@ -35,13 +35,13 @@
namespace juce
{
#ifndef DOXYGEN
namespace AtomicHelpers
{
template <typename T> struct DiffTypeHelper { using Type = T; };
template <typename T> struct DiffTypeHelper<T*> { using Type = std::ptrdiff_t; };
}
#endif
/** @cond */
namespace AtomicHelpers
{
template <typename T> struct DiffTypeHelper { using Type = T; };
template <typename T> struct DiffTypeHelper<T*> { using Type = std::ptrdiff_t; };
}
/** @endcond */
//==============================================================================
/**
@ -147,11 +147,11 @@ struct Atomic final
std::atomic<Type> value;
//==============================================================================
#ifndef DOXYGEN
/** @cond */
[[deprecated ("This method has been deprecated as there is no equivalent method in "
"std::atomic. Use compareAndSetBool instead.")]]
Type compareAndSetValue (Type, Type) noexcept;
#endif
/** @endcond */
};
} // namespace juce

View file

@ -35,7 +35,8 @@
namespace juce
{
#if ! (DOXYGEN || JUCE_EXCEPTIONS_DISABLED)
#if ! JUCE_EXCEPTIONS_DISABLED
/** @cond */
namespace HeapBlockHelper
{
template <bool shouldThrow>
@ -44,6 +45,7 @@ namespace HeapBlockHelper
template <>
struct ThrowOnFail<true> { static void checkPointer (void* data) { if (data == nullptr) throw std::bad_alloc(); } };
}
/** @endcond */
#endif
//==============================================================================

View file

@ -178,7 +178,8 @@ inline const Type* addBytesToPointer (const Type* basePointer, IntegerType bytes
avoiding problems when an object is created in one module and passed across to another where it is deleted.
By piggy-backing on the JUCE_LEAK_DETECTOR macro, these allocators can be injected into most juce classes.
*/
#if JUCE_MSVC && (defined (JUCE_DLL) || defined (JUCE_DLL_BUILD)) && ! (JUCE_DISABLE_DLL_ALLOCATORS || DOXYGEN)
#if JUCE_MSVC && (defined (JUCE_DLL) || defined (JUCE_DLL_BUILD)) && ! JUCE_DISABLE_DLL_ALLOCATORS
/** @cond */
extern JUCE_API void* juceDLL_malloc (size_t);
extern JUCE_API void juceDLL_free (void*);
@ -187,6 +188,7 @@ inline const Type* addBytesToPointer (const Type* basePointer, IntegerType bytes
static void* operator new (size_t, void* p) { return p; } \
static void operator delete (void* p) { juce::juceDLL_free (p); } \
static void operator delete (void*, void*) {}
/** @endcond */
#endif
//==============================================================================

View file

@ -281,14 +281,14 @@ public:
bool fromBase64Encoding (StringRef encodedString);
//==============================================================================
#ifndef DOXYGEN
/** @cond */
[[deprecated ("Use the replaceAll method instead, which will also replace the data when numBytes == 0.")]]
void replaceWith (const void* srcData, size_t numBytes)
{
if (numBytes > 0)
replaceAll (srcData, numBytes);
}
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -440,10 +440,10 @@ public:
operator ReferencedType*() const noexcept { return referencedObject; }
#endif
#ifndef DOXYGEN
/** @cond */
[[deprecated ("Use the get method instead.")]]
ReferencedType* getObject() const { return get(); }
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -32,8 +32,7 @@
==============================================================================
*/
#ifndef DOXYGEN
/** @cond */
namespace juce
{
@ -228,5 +227,4 @@ void deleteAndZero (ScopedPointer<Type>&) { static_assert (sizeof (Type) == 123
JUCE_END_IGNORE_DEPRECATION_WARNINGS
} // namespace juce
#endif
/** @endcond */

View file

@ -128,10 +128,10 @@ public:
/** Returns a reference to the shared object. */
SharedObjectType& operator*() const noexcept { return *sharedObject; }
#ifndef DOXYGEN
/** @cond */
[[deprecated ("If you are relying on this function please inform the JUCE team as we are planing on removing this in a subsequent release")]]
int getReferenceCount() const noexcept { return (int) sharedObject.use_count(); }
#endif
/** @endcond */
/** Returns the SharedResourcePointer if one already exists, or a null optional otherwise. */
static std::optional<SharedResourcePointer> getSharedObjectWithoutCreating()

View file

@ -135,7 +135,7 @@ struct SingletonHolder : private MutexType // (inherited so we can use the empt
std::atomic<Type*> instance { nullptr };
};
#ifndef DOXYGEN
/** @cond */
#define JUCE_PRIVATE_DECLARE_SINGLETON(Classname, mutex, doNotRecreate, inlineToken, getter) \
static inlineToken juce::SingletonHolder<Classname, mutex, doNotRecreate> singletonHolder; \
friend juce::SingletonHolder<Classname, mutex, doNotRecreate>; \
@ -143,7 +143,7 @@ struct SingletonHolder : private MutexType // (inherited so we can use the empt
static Classname* JUCE_CALLTYPE getInstanceWithoutCreating() noexcept { return singletonHolder.instance; } \
static void JUCE_CALLTYPE deleteInstance() noexcept { singletonHolder.deleteInstance(); } \
void clearSingletonInstance() noexcept { singletonHolder.clear (this); }
#endif
/** @endcond */
//==============================================================================
/**
@ -281,14 +281,14 @@ struct SingletonHolder : private MutexType // (inherited so we can use the empt
JUCE_PRIVATE_DECLARE_SINGLETON (Classname, juce::DummyCriticalSection, false, inline, getWithoutChecking)
//==============================================================================
#ifndef DOXYGEN
// These are ancient macros, and have now been updated with new names to match the JUCE style guide,
// so please update your code to use the newer versions!
#define juce_DeclareSingleton(Classname, doNotRecreate) JUCE_DECLARE_SINGLETON(Classname, doNotRecreate)
#define juce_DeclareSingleton_SingleThreaded(Classname, doNotRecreate) JUCE_DECLARE_SINGLETON_SINGLETHREADED(Classname, doNotRecreate)
#define juce_DeclareSingleton_SingleThreaded_Minimal(Classname) JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL(Classname)
#define juce_ImplementSingleton(Classname) JUCE_IMPLEMENT_SINGLETON(Classname)
#define juce_ImplementSingleton_SingleThreaded(Classname) JUCE_IMPLEMENT_SINGLETON(Classname)
#endif
/** @cond */
// These are ancient macros, and have now been updated with new names to match the JUCE style guide,
// so please update your code to use the newer versions!
#define juce_DeclareSingleton(Classname, doNotRecreate) JUCE_DECLARE_SINGLETON(Classname, doNotRecreate)
#define juce_DeclareSingleton_SingleThreaded(Classname, doNotRecreate) JUCE_DECLARE_SINGLETON_SINGLETHREADED(Classname, doNotRecreate)
#define juce_DeclareSingleton_SingleThreaded_Minimal(Classname) JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL(Classname)
#define juce_ImplementSingleton(Classname) JUCE_IMPLEMENT_SINGLETON(Classname)
#define juce_ImplementSingleton_SingleThreaded(Classname) JUCE_IMPLEMENT_SINGLETON(Classname)
/** @endcond */
} // namespace juce

View file

@ -35,7 +35,7 @@
namespace juce
{
#ifndef DOXYGEN
/** @cond */
namespace detail
{
template <typename...>
@ -47,7 +47,7 @@ namespace detail
template <typename T>
constexpr auto equalityComparableToNullptr<T, Void<decltype (std::declval<T>() != nullptr)>> = true;
} // namespace detail
#endif
/** @endcond */
//==============================================================================
/** Some helper methods for checking a callable object before invoking with
@ -98,7 +98,7 @@ template <typename Object, typename OtherObject, typename Member, typename Other
return copy;
}
#ifndef DOXYGEN
/** @cond */
namespace detail
{
template <typename Functor, typename Return, typename... Args>
@ -107,7 +107,7 @@ static constexpr auto toFnPtr (Functor functor, Return (Functor::*) (Args...) co
return static_cast<Return (*) (Args...)> (functor);
}
} // namespace detail
#endif
/** @endcond */
/** Converts a captureless lambda to its equivalent function pointer type. */
template <typename Functor>

View file

@ -151,7 +151,7 @@ private:
} // namespace juce
#ifndef DOXYGEN
/** @cond */
namespace std
{
template <> struct hash<juce::Uuid>
@ -159,4 +159,4 @@ namespace std
size_t operator() (const juce::Uuid& u) const noexcept { return (size_t) u.hash(); }
};
}
#endif
/** @endcond */

View file

@ -135,12 +135,12 @@ public:
bool registerForCurrentUserOnly,
WoW64Mode mode = WoW64_Default);
#ifndef DOXYGEN
/** @cond */
// DEPRECATED: use the other methods with a WoW64Mode parameter of WoW64_64bit instead.
[[deprecated]] static String getValueWow64 (const String&, const String& defaultValue = String());
[[deprecated]] static bool valueExistsWow64 (const String&);
[[deprecated]] static bool keyExistsWow64 (const String&);
#endif
/** @endcond */
private:
WindowsRegistry() = delete;

View file

@ -367,6 +367,7 @@ DECLARE_JNI_CLASS (AndroidContext, "android/content/Context")
METHOD (startActivityForResult, "startActivityForResult", "(Landroid/content/Intent;I)V") \
METHOD (getFragmentManager, "getFragmentManager", "()Landroid/app/FragmentManager;") \
METHOD (setContentView, "setContentView", "(Landroid/view/View;)V") \
METHOD (addContentView, "addContentView", "(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V") \
METHOD (getActionBar, "getActionBar", "()Landroid/app/ActionBar;") \
METHOD (getWindow, "getWindow", "()Landroid/view/Window;") \
METHOD (isInMultiWindowMode, "isInMultiWindowMode", "()Z") \
@ -690,13 +691,22 @@ DECLARE_JNI_CLASS (AndroidViewGroup, "android/view/ViewGroup")
METHOD (getDecorView, "getDecorView", "()Landroid/view/View;") \
METHOD (getAttributes, "getAttributes", "()Landroid/view/WindowManager$LayoutParams;") \
METHOD (setFlags, "setFlags", "(II)V") \
METHOD (clearFlags, "clearFlags", "(I)V")
METHOD (clearFlags, "clearFlags", "(I)V") \
METHOD (setStatusBarColor, "setStatusBarColor", "(I)V") \
METHOD (setNavigationBarColor, "setNavigationBarColor", "(I)V") \
DECLARE_JNI_CLASS (AndroidWindow, "android/view/Window")
#undef JNI_CLASS_MEMBERS
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
METHOD (getDefaultDisplay, "getDefaultDisplay", "()Landroid/view/Display;")
METHOD (setNavigationBarContrastEnforced, "setNavigationBarContrastEnforced", "(Z)V") \
DECLARE_JNI_CLASS_WITH_MIN_SDK (AndroidWindow29, "android/view/Window", 29)
#undef JNI_CLASS_MEMBERS
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \
METHOD (getDefaultDisplay, "getDefaultDisplay", "()Landroid/view/Display;") \
METHOD (removeViewImmediate, "removeViewImmediate", "(Landroid/view/View;)V") \
DECLARE_JNI_CLASS (AndroidWindowManager, "android/view/WindowManager")
#undef JNI_CLASS_MEMBERS

View file

@ -140,15 +140,18 @@ public:
~SharedSession()
{
std::unique_lock lock { mutex };
[session.get() finishTasksAndInvalidate];
condvar.wait (lock, [&] { return state == State::stopped; });
if (session != nullptr)
[session.get() finishTasksAndInvalidate];
condvar.wait (lock, [&] { return session == nullptr; });
}
NSUniquePtr<NSURLSessionTask> addTask (NSURLRequest* request, SessionListener* listener)
{
std::unique_lock lock { mutex };
if (state != State::running)
if (session == nullptr)
return nullptr;
NSUniquePtr<NSURLSessionTask> task { [[session.get() dataTaskWithRequest: request] retain] };
@ -170,28 +173,28 @@ private:
DBG (nsStringToJuce ([error description]));
#endif
const auto toNotify = [&]
const auto toNotify = std::invoke ([&]
{
const std::scoped_lock lock { mutex };
state = State::stopRequested;
session.reset();
// Take a copy of listenerForTask so that we don't need to hold the lock while
// iterating through the remaining listeners.
return listenerForTask;
}();
return std::exchange (listenerForTask, {});
});
for (const auto& pair : toNotify)
pair.second->didComplete (error);
const std::scoped_lock lock { mutex };
listenerForTask.clear();
state = State::stopped;
// Important: we keep the lock held while calling condvar.notify_one().
// Important: we keep the lock held while calling condvar.notify_all().
// If we don't, then it's possible that when the destructor runs, it will wake
// before we notify the condvar on this thread, allowing the destructor to continue
// and destroying the condition variable. When didBecomeInvalid resumes, the condition
// variable will have been destroyed.
condvar.notify_one();
// Use notify_all() rather than notify_one() so that all threads waiting
// in removeTask() can make progress in the case that the session is
// invalidated unexpectedly.
const std::scoped_lock lock { mutex };
condvar.notify_all();
}
void didComplete (NSURLSessionTask* task, [[maybe_unused]] NSError* error)
@ -213,7 +216,7 @@ private:
listenerForTask.erase ([task taskIdentifier]);
}
condvar.notify_one();
condvar.notify_all();
}
void didReceiveResponse (NSURLSessionTask* task,
@ -324,13 +327,6 @@ private:
}
};
enum class State
{
running,
stopRequested,
stopped,
};
std::mutex mutex;
std::condition_variable condvar;
@ -343,8 +339,6 @@ private:
};
std::map<NSUInteger, SessionListener*> listenerForTask;
State state = State::running;
};
class TaskToken

View file

@ -392,7 +392,7 @@ private:
};
//==============================================================================
#ifndef DOXYGEN
/** @cond */
template <class JuceClass>
struct ObjCLifetimeManagedClass : public ObjCClass<NSObject>
{
@ -434,7 +434,7 @@ struct ObjCLifetimeManagedClass : public ObjCClass<NSObject>
template <typename Class>
ObjCLifetimeManagedClass<Class> ObjCLifetimeManagedClass<Class>::objCLifetimeManagedClass;
#endif
/** @endcond */
// this will return an NSObject which takes ownership of the JUCE instance passed-in
// This is useful to tie the life-time of a juce instance to the life-time of an NSObject

View file

@ -684,7 +684,7 @@ public:
static URL createWithoutParsing (const String& url);
//==============================================================================
#ifndef DOXYGEN
/** @cond */
using OpenStreamProgressCallback = bool (void* context, int bytesSent, int totalBytes);
/** This method has been deprecated.
@ -701,7 +701,7 @@ public:
int* statusCode = nullptr,
int numRedirectsToFollow = 5,
String httpRequestCmd = {}) const;
#endif
/** @endcond */
private:
//==============================================================================

View file

@ -148,8 +148,7 @@ template <typename T> constexpr auto serialisationSize (const T& t) -> std::enab
The following are specialisations of SerialisationTraits for commonly-used types.
*/
#ifndef DOXYGEN
/** @cond */
template <typename... Ts>
struct SerialisationTraits<std::vector<Ts...>>
{
@ -583,6 +582,6 @@ namespace detail
}
} // namespace detail
#endif
/** @endcond */
} // namespace juce

View file

@ -113,14 +113,14 @@
#endif
//==============================================================================
#ifndef DOXYGEN
// These are old flags that are now supported on all compatible build targets
#define JUCE_CXX14_IS_AVAILABLE 1
#define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1
#define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1
#define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1
#define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1
#define JUCE_DELETED_FUNCTION = delete
#define JUCE_CONSTEXPR constexpr
#define JUCE_NODISCARD [[nodiscard]]
#endif
// These are old flags that are now supported on all compatible build targets
/** @cond */
#define JUCE_CXX14_IS_AVAILABLE 1
#define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1
#define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1
#define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1
#define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1
#define JUCE_DELETED_FUNCTION = delete
#define JUCE_CONSTEXPR constexpr
#define JUCE_NODISCARD [[nodiscard]]
/** @endcond */

View file

@ -36,6 +36,7 @@
#include "juce_TargetPlatform.h"
/** @cond */
/** Return the Nth argument. By passing a variadic pack followed by N other
parameters, we can select one of those N parameter based on the length of
the parameter pack.
@ -160,6 +161,7 @@
/** Quote the argument, turning it into a string. */
#define JUCE_TO_STRING(x) #x
/** @endcond */
#if JUCE_CLANG || JUCE_GCC
#define JUCE_IGNORE_GCC_IMPL_(compiler, warning)
#define JUCE_IGNORE_GCC_IMPL_0(compiler, warning)

View file

@ -129,12 +129,14 @@ namespace juce
#endif
//==============================================================================
#if JUCE_MSVC && ! defined (DOXYGEN)
#if JUCE_MSVC
/** @cond */
#define JUCE_BLOCK_WITH_FORCED_SEMICOLON(x) \
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
do { x } while (false) \
__pragma(warning(pop))
/** @endcond */
#else
/** This is the good old C++ trick for creating a macro that forces the user to put
a semicolon after it when they use it.
@ -160,6 +162,7 @@ namespace juce
/** This will always cause an assertion failure.
It is only compiled in a debug build, (unless JUCE_LOG_ASSERTIONS is enabled for your build).
@see jassert
@hiderefby
*/
#define jassertfalse JUCE_BLOCK_WITH_FORCED_SEMICOLON (JUCE_LOG_CURRENT_ASSERTION; if (juce::juce_isRunningUnderDebugger()) JUCE_BREAK_IN_DEBUGGER; JUCE_ANALYZER_NORETURN)
@ -170,6 +173,7 @@ namespace juce
careful that the expression you pass to it doesn't perform any actions that are vital for the
correct behaviour of your program!
@see jassertfalse
@hiderefby
*/
#define jassert(expression) JUCE_BLOCK_WITH_FORCED_SEMICOLON (if (! (expression)) jassertfalse;)
@ -202,10 +206,10 @@ namespace juce
#define JUCE_ASSERTIONS_ENABLED_OR_LOGGED JUCE_ASSERTIONS_ENABLED || JUCE_LOG_ASSERTIONS
//==============================================================================
#ifndef DOXYGEN
#define JUCE_JOIN_MACRO_HELPER(a, b) a ## b
#define JUCE_STRINGIFY_MACRO_HELPER(a) #a
#endif
/** @cond */
#define JUCE_JOIN_MACRO_HELPER(a, b) a ## b
#define JUCE_STRINGIFY_MACRO_HELPER(a) #a
/** @endcond */
/** A good old-fashioned C macro concatenation helper.
This combines two items (which may themselves be macros) into a single string,
@ -269,8 +273,10 @@ namespace juce
static void operator delete (void*) = delete;
//==============================================================================
#if JUCE_MSVC && ! defined (DOXYGEN)
#if JUCE_MSVC
/** @cond */
#define JUCE_COMPILER_WARNING(msg) __pragma (message (__FILE__ "(" JUCE_STRINGIFY (__LINE__) ") : Warning: " msg))
/** @endcond */
#else
/** This macro allows you to emit a custom compiler warning message.
@ -312,8 +318,10 @@ namespace juce
#endif
//==============================================================================
#if JUCE_ANDROID && ! defined (DOXYGEN)
#if JUCE_ANDROID
/** @cond */
#define JUCE_MODAL_LOOPS_PERMITTED 0
/** @endcond */
#elif ! defined (JUCE_MODAL_LOOPS_PERMITTED)
/** Some operating environments don't provide a modal loop mechanism, so this flag can be
used to disable any functions that try to run a modal loop. */
@ -321,11 +329,13 @@ namespace juce
#endif
//==============================================================================
/** @cond */
#if JUCE_GCC || JUCE_CLANG
#define JUCE_PACKED __attribute__ ((packed))
#elif ! defined (DOXYGEN)
#else
#define JUCE_PACKED
#endif
/** @endcond */
//==============================================================================
#if JUCE_GCC || DOXYGEN

View file

@ -53,10 +53,10 @@
*/
#define JUCE_VERSION ((JUCE_MAJOR_VERSION << 16) + (JUCE_MINOR_VERSION << 8) + JUCE_BUILDNUMBER)
#if ! DOXYGEN
/** @cond */
#define JUCE_VERSION_ID \
[[maybe_unused]] volatile auto juceVersionId = "juce_version_" JUCE_STRINGIFY(JUCE_MAJOR_VERSION) "_" JUCE_STRINGIFY(JUCE_MINOR_VERSION) "_" JUCE_STRINGIFY(JUCE_BUILDNUMBER);
#endif
/** @endcond */
//==============================================================================
#include <algorithm>
@ -173,6 +173,6 @@ JUCE_END_IGNORE_WARNINGS_MSVC
/** This macro is added to all JUCE public function declarations. */
#define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE
#ifndef DOXYGEN
#define JUCE_NAMESPACE juce // This old macro is deprecated: you should just use the juce namespace directly.
#endif
/** @cond */
#define JUCE_NAMESPACE juce // This old macro is deprecated: you should just use the juce namespace directly.
/** @endcond */

View file

@ -294,10 +294,10 @@ public:
#endif
//==============================================================================
#ifndef DOXYGEN
/** @cond */
[[deprecated ("This method was spelt wrong! Please change your code to use getCpuSpeedInMegahertz instead.")]]
static int getCpuSpeedInMegaherz() { return getCpuSpeedInMegahertz(); }
#endif
/** @endcond */
private:
SystemStats() = delete; // uses only static methods

View file

@ -350,7 +350,8 @@ public:
return CharacterFunctions::compareIgnoreCaseUpTo (*this, other, maxChars);
}
#if JUCE_MSVC && ! defined (DOXYGEN)
#if JUCE_MSVC
/** @cond */
int compareIgnoreCase (CharPointer_UTF16 other) const noexcept
{
return _wcsicmp (data, other.data);
@ -366,6 +367,7 @@ public:
const CharType* const t = wcsstr (data, stringToFind.getAddress());
return t == nullptr ? -1 : (int) (t - data);
}
/** @endcond */
#endif
/** Returns the character index of a substring, or -1 if it isn't found. */

View file

@ -36,10 +36,12 @@ namespace juce
{
//==============================================================================
#if JUCE_WINDOWS && ! defined (DOXYGEN)
#if JUCE_WINDOWS
/** @cond */
#define JUCE_NATIVE_WCHAR_IS_UTF8 0
#define JUCE_NATIVE_WCHAR_IS_UTF16 1
#define JUCE_NATIVE_WCHAR_IS_UTF32 0
/** @endcond */
#else
/** This macro will be set to 1 if the compiler's native wchar_t is an 8-bit type. */
#define JUCE_NATIVE_WCHAR_IS_UTF8 0
@ -56,10 +58,10 @@ namespace juce
using juce_wchar = uint32;
#endif
#ifndef DOXYGEN
/** This macro is deprecated, but preserved for compatibility with old code. */
#define JUCE_T(stringLiteral) (L##stringLiteral)
#endif
// This macro is deprecated, but preserved for compatibility with old code.
/** @cond */
#define JUCE_T(stringLiteral) (L##stringLiteral)
/** @endcond */
#if JUCE_DEFINE_T_MACRO
/** The 'T' macro is an alternative for using the "L" prefix in front of a string literal.
@ -72,8 +74,7 @@ namespace juce
#define T(stringLiteral) JUCE_T(stringLiteral)
#endif
#ifndef DOXYGEN
/** @cond */
//==============================================================================
// GNU libstdc++ does not have std::make_unsigned
namespace internal
@ -86,8 +87,7 @@ namespace internal
template <> struct make_unsigned<long> { using type = unsigned long; };
template <> struct make_unsigned<long long> { using type = unsigned long long; };
}
#endif
/** @endcond */
//==============================================================================
/**

View file

@ -85,10 +85,12 @@ extern NewLine newLine;
@endcode
*/
inline String& operator<< (String& string1, const NewLine&) { return string1 += NewLine::getDefault(); }
inline String& operator+= (String& s1, const NewLine&) { return s1 += NewLine::getDefault(); }
inline String& operator+= (String& s, const NewLine&) { return s += NewLine::getDefault(); }
inline String operator+ (const NewLine&, const NewLine&) { return String (NewLine::getDefault()) + NewLine::getDefault(); }
inline String operator+ (String s1, const NewLine&) { return s1 += NewLine::getDefault(); }
inline String operator+ (const NewLine&, const char* s2) { return String (NewLine::getDefault()) + s2; }
inline String operator+ (String s, const NewLine&) { return s += NewLine::getDefault(); }
inline String operator+ (const NewLine&, String s) { return NewLine::getDefault() + s; }
inline String operator+ (const NewLine&, const char* s) { return String (NewLine::getDefault()) + s; }
inline String operator+ (const char* s, const NewLine&) { return s + String (NewLine::getDefault()); }
} // namespace juce

Some files were not shown because too many files have changed in this diff Show more