1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

iOS and macOS: Use consistent capitalisation with @available syntax

This commit is contained in:
Anthony Nicholls 2025-07-17 11:35:52 +01:00 committed by Anthony Nicholls
parent e68627c9ed
commit d0aa6d0486
8 changed files with 23 additions and 23 deletions

View file

@ -393,7 +393,7 @@ struct iOSAudioIODevice::Pimpl final : public AsyncUpdater
JUCE_NSERROR_CHECK ([[AVAudioSession sharedInstance] setActive: enabled
error: &error]);
if (@available (ios 18, *))
if (@available (iOS 18, *))
{
if (enabled)
{
@ -419,7 +419,7 @@ struct iOSAudioIODevice::Pimpl final : public AsyncUpdater
// Older iOS versions (iOS 12) seem to require that the requested buffer size is a bit
// larger than the desired buffer size.
// This breaks on iOS 18, which needs the buffer duration to be as precise as possible.
if (@available (ios 18, *))
if (@available (iOS 18, *))
return 0;
return 1;
@ -434,7 +434,7 @@ struct iOSAudioIODevice::Pimpl final : public AsyncUpdater
// iOS requires additional effort to observe the actual buffer size
// change however, it seems the buffer size change will always work
// so instead we just assume the change will apply eventually
if (@available (ios 18, *))
if (@available (iOS 18, *))
return newBufferSize;
return getBufferSize (currentSampleRate);
@ -449,7 +449,7 @@ struct iOSAudioIODevice::Pimpl final : public AsyncUpdater
constexpr auto suggestedMin = 64;
constexpr auto suggestedMax = 4096;
if (@available (ios 18, *))
if (@available (iOS 18, *))
return std::tuple (suggestedMin, suggestedMax);
const auto min = tryBufferSize (sampleRate, suggestedMin);
@ -541,11 +541,11 @@ struct iOSAudioIODevice::Pimpl final : public AsyncUpdater
// On iOS 18 the AVAudioSession sample rate is not always accurate but
// probing the sample rate via an AudioQueue seems to work reliably
if (@available (ios 18, *))
if (@available (iOS 18, *))
{
// On iOS 26, things seem to work as expected again,
// so avoid creating an AudioQueue
if (@available (ios 26, *))
if (@available (iOS 26, *))
return session.sampleRate;
return getSampleRateFromAudioQueue().value_or (session.sampleRate);

View file

@ -546,7 +546,7 @@ struct CoreMidiHelpers
std::optional<EndpointInfo> getCachedInfo (const ump::EndpointId& x) const
{
#if JUCE_COREMIDI_UMP_ENDPOINT_CAN_BE_BUILT
if (@available (macos 15, ios 18, *))
if (@available (macOS 15, iOS 18, *))
if (const auto iter = virtualEndpoints.find (x); iter != virtualEndpoints.end())
return getInfoForEndpoint (iter->second);
#endif
@ -627,7 +627,7 @@ struct CoreMidiHelpers
SharedEndpointsImplNative (MIDIClientRef c, ump::EndpointsListener& l)
: client (c), listener (l)
{
if (@available (macos 15.0, ios 18.0, *))
if (@available (macOS 15.0, iOS 18.0, *))
observers.emplace (*this);
}
@ -846,7 +846,7 @@ struct CoreMidiHelpers
static std::map<ump::EndpointId, EndpointInfo> findNativeUMPEndpoints()
{
#if JUCE_COREMIDI_UMP_ENDPOINT_CAN_BE_BUILT
if (@available (macos 15, ios 18, *))
if (@available (macOS 15, iOS 18, *))
{
std::map<ump::EndpointId, EndpointInfo> result;
@ -867,7 +867,7 @@ struct CoreMidiHelpers
static std::optional<SInt32> getUMPActiveGroupBitmap ([[maybe_unused]] MIDIEndpointRef r)
{
#if JUCE_MAC_API_VERSION_CAN_BE_BUILT (14, 0) || JUCE_IOS_API_VERSION_CAN_BE_BUILT (17, 0)
if (@available (macos 14, ios 17, *))
if (@available (macOS 14, iOS 17, *))
{
SInt32 bitmap{};
@ -884,7 +884,7 @@ struct CoreMidiHelpers
static bool canTransmitGroupless ([[maybe_unused]] MIDIEndpointRef endpoint)
{
#if JUCE_MAC_API_VERSION_CAN_BE_BUILT (14, 0) || JUCE_IOS_API_VERSION_CAN_BE_BUILT (17, 0)
if (@available (macos 14, ios 17, *))
if (@available (macOS 14, iOS 17, *))
{
SInt32 result;
if (MIDIObjectGetIntegerProperty (endpoint, kMIDIPropertyUMPCanTransmitGroupless, &result) == noErr)
@ -2385,7 +2385,7 @@ struct CoreMidiHelpers
[[maybe_unused]] ump::BlocksAreStatic areStatic) override
{
#if JUCE_COREMIDI_UMP_ENDPOINT_CAN_BE_BUILT
if (@available (macos 15, ios 18, *))
if (@available (macOS 15, iOS 18, *))
{
auto connection = VirtualEndpointImplNative::make (cachedEndpoints,
deviceName,
@ -2497,7 +2497,7 @@ struct CoreMidiHelpers
bool isVirtualMidiUmpServiceActive() const override
{
if (@available (macos 15, ios 18, *))
if (@available (macOS 15, iOS 18, *))
return true;
return false;