Skip to content

Commit 94ff22a

Browse files
committed
Upgrading to JUCE 7.0.10, which includes fixes to Timers (which were breaking on win32)
1 parent 840a475 commit 94ff22a

File tree

244 files changed

+10455
-2964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+10455
-2964
lines changed

JuceLibraryCode/AppConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
// BEGIN SECTION A
3737

3838
#ifndef JUCE_DISPLAY_SPLASH_SCREEN
39-
#define JUCE_DISPLAY_SPLASH_SCREEN 0
39+
#define JUCE_DISPLAY_SPLASH_SCREEN 1
4040
#endif
4141

4242
// END SECTION A
4343

4444
#define JUCE_USE_DARK_SPLASH_SCREEN 1
4545

46-
#define JUCE_PROJUCER_VERSION 0x70008
46+
#define JUCE_PROJUCER_VERSION 0x7000a
4747

4848
//==============================================================================
4949
#define JUCE_MODULE_AVAILABLE_juce_audio_basics 1

JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
3333
ID: juce_audio_basics
3434
vendor: juce
35-
version: 7.0.8
35+
version: 7.0.10
3636
name: JUCE audio and MIDI data classes
3737
description: Classes for audio buffer manipulation, midi message handling, synthesis, etc.
3838
website: http://www.juce.com/juce
@@ -124,3 +124,10 @@ JUCE_END_IGNORE_WARNINGS_MSVC
124124
#include "synthesisers/juce_Synthesiser.h"
125125
#include "audio_play_head/juce_AudioPlayHead.h"
126126
#include "utilities/juce_AudioWorkgroup.h"
127+
#include "midi/ump/juce_UMPBytesOnGroup.h"
128+
#include "midi/ump/juce_UMPDeviceInfo.h"
129+
130+
namespace juce
131+
{
132+
namespace ump = universal_midi_packets;
133+
}

JuceLibraryCode/modules/juce_audio_basics/midi/juce_MidiMessage.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,11 @@ MidiMessage MidiMessage::createSysExMessage (const void* sysexData, const int da
685685
return MidiMessage (m, dataSize + 2);
686686
}
687687

688+
MidiMessage MidiMessage::createSysExMessage (Span<const std::byte> data)
689+
{
690+
return createSysExMessage (data.data(), (int) data.size());
691+
}
692+
688693
const uint8* MidiMessage::getSysExData() const noexcept
689694
{
690695
return isSysEx() ? getRawData() + 1 : nullptr;

JuceLibraryCode/modules/juce_audio_basics/midi/juce_MidiMessage.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,13 @@ class JUCE_API MidiMessage
218218
*/
219219
int getSysExDataSize() const noexcept;
220220

221+
/** Returns a span that bounds the sysex body bytes contained in this message. */
222+
Span<const std::byte> getSysExDataSpan() const noexcept
223+
{
224+
return { reinterpret_cast<const std::byte*> (getSysExData()),
225+
(size_t) getSysExDataSize() };
226+
}
227+
221228
//==============================================================================
222229
/** Returns true if this message is a 'key-down' event.
223230
@@ -855,6 +862,10 @@ class JUCE_API MidiMessage
855862
static MidiMessage createSysExMessage (const void* sysexData,
856863
int dataSize);
857864

865+
/** Creates a system-exclusive message.
866+
The data passed in is wrapped with header and tail bytes of 0xf0 and 0xf7.
867+
*/
868+
static MidiMessage createSysExMessage (Span<const std::byte> data);
858869

859870
//==============================================================================
860871
#ifndef DOXYGEN
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
The code included in this file is provided under the terms of the ISC license
11+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12+
To use, copy, modify, and/or distribute this software for any purpose with or
13+
without fee is hereby granted provided that the above copyright notice and
14+
this permission notice appear in all copies.
15+
16+
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18+
DISCLAIMED.
19+
20+
==============================================================================
21+
*/
22+
23+
namespace juce::universal_midi_packets
24+
{
25+
26+
/**
27+
Holds a UMP group, and a span of bytes that were received or are to be
28+
sent on that group. Helpful when working with sysex messages.
29+
30+
@tags{Audio}
31+
*/
32+
struct BytesOnGroup
33+
{
34+
uint8_t group{};
35+
Span<const std::byte> bytes;
36+
};
37+
38+
} // namespace juce::universal_midi_packets
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
The code included in this file is provided under the terms of the ISC license
11+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12+
To use, copy, modify, and/or distribute this software for any purpose with or
13+
without fee is hereby granted provided that the above copyright notice and
14+
this permission notice appear in all copies.
15+
16+
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18+
DISCLAIMED.
19+
20+
==============================================================================
21+
*/
22+
23+
namespace juce::universal_midi_packets
24+
{
25+
26+
/**
27+
Holds MIDI device info that may be required by certain UMP messages and
28+
MIDI-CI messages.
29+
30+
@tags{Audio}
31+
*/
32+
struct DeviceInfo
33+
{
34+
std::array<std::byte, 3> manufacturer; ///< LSB first
35+
std::array<std::byte, 2> family; ///< LSB first
36+
std::array<std::byte, 2> modelNumber; ///< LSB first
37+
std::array<std::byte, 4> revision;
38+
39+
private:
40+
auto tie() const { return std::tie (manufacturer, family, modelNumber, revision); }
41+
42+
public:
43+
bool operator== (const DeviceInfo& other) const { return tie() == other.tie(); }
44+
bool operator!= (const DeviceInfo& other) const { return tie() != other.tie(); }
45+
46+
static constexpr auto marshallingVersion = std::nullopt;
47+
48+
template <typename Archive, typename This>
49+
static auto serialise (Archive& archive, This& t)
50+
{
51+
return archive (named ("manufacturer", t.manufacturer),
52+
named ("family", t.family),
53+
named ("modelNumber", t.modelNumber),
54+
named ("revision", t.revision));
55+
}
56+
};
57+
58+
} // namespace juce::universal_midi_packets

JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPFactory.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ struct Factory
5555

5656
std::array<uint32_t, 2> words;
5757

58-
size_t index = 0;
59-
60-
for (auto& word : words)
61-
word = ByteOrder::bigEndianInt (bytes.data() + 4 * index++);
58+
for (const auto [index, word] : enumerate (words))
59+
word = ByteOrder::bigEndianInt (bytes.data() + 4 * index);
6260

6361
return PacketX2 { words };
6462
}
@@ -79,10 +77,8 @@ struct Factory
7977

8078
std::array<uint32_t, 4> words;
8179

82-
size_t index = 0;
83-
84-
for (auto& word : words)
85-
word = ByteOrder::bigEndianInt (bytes.data() + 4 * index++);
80+
for (const auto [index, word] : enumerate (words))
81+
word = ByteOrder::bigEndianInt (bytes.data() + 4 * index);
8682

8783
return PacketX4 { words };
8884
}

JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMP_test.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -989,22 +989,12 @@ class UniversalMidiPacketTests final : public UnitTest
989989
}
990990
}
991991

992-
#if JUCE_WINDOWS && ! JUCE_MINGW
993-
#define JUCE_CHECKED_ITERATOR(msg, size) \
994-
stdext::checked_array_iterator<std::remove_reference_t<decltype (msg)>> ((msg), (size_t) (size))
995-
#else
996-
#define JUCE_CHECKED_ITERATOR(msg, size) (msg)
997-
#endif
998-
999992
static bool equal (const MidiMessage& a, const MidiMessage& b) noexcept
1000993
{
1001994
return a.getRawDataSize() == b.getRawDataSize()
1002-
&& std::equal (a.getRawData(), a.getRawData() + a.getRawDataSize(),
1003-
JUCE_CHECKED_ITERATOR (b.getRawData(), b.getRawDataSize()));
995+
&& std::equal (a.getRawData(), a.getRawData() + a.getRawDataSize(), b.getRawData());
1004996
}
1005997

1006-
#undef JUCE_CHECKED_ITERATOR
1007-
1008998
static bool equal (const MidiBuffer& a, const MidiBuffer& b) noexcept
1009999
{
10101000
return a.data == b.data;

JuceLibraryCode/modules/juce_audio_basics/mpe/juce_MPEZoneLayout.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,17 @@ class MPEZoneLayoutTests final : public UnitTest
381381
expectEquals (layout.getLowerZone().numMemberChannels, 3);
382382
expectEquals (layout.getLowerZone().perNotePitchbendRange, 48);
383383
expectEquals (layout.getLowerZone().masterPitchbendRange, 2);
384+
385+
const auto masterPitchBend = 0x0c;
386+
layout.processNextMidiEvent ({ 0xb0, 0x64, 0x00 });
387+
layout.processNextMidiEvent ({ 0xb0, 0x06, masterPitchBend });
388+
389+
expectEquals (layout.getLowerZone().masterPitchbendRange, masterPitchBend);
390+
391+
const auto newPitchBend = 0x0d;
392+
layout.processNextMidiEvent ({ 0xb0, 0x06, newPitchBend });
393+
394+
expectEquals (layout.getLowerZone().masterPitchbendRange, newPitchBend);
384395
}
385396
}
386397
};

JuceLibraryCode/modules/juce_audio_basics/utilities/juce_AudioWorkgroup.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,21 @@ void AudioWorkgroup::join (WorkgroupToken& token) const
204204
token.reset();
205205
}
206206

207+
size_t AudioWorkgroup::getMaxParallelThreadCount() const
208+
{
209+
#if JUCE_AUDIOWORKGROUP_TYPES_AVAILABLE
210+
211+
if (@available (macos 11.0, ios 14.0, *))
212+
{
213+
if (auto wg = WorkgroupProvider::getWorkgroup (*this))
214+
return (size_t) os_workgroup_max_parallel_threads (wg, nullptr);
215+
}
216+
217+
#endif
218+
219+
return 0;
220+
}
221+
207222
AudioWorkgroup::operator bool() const { return WorkgroupProvider::getWorkgroup (*this) != nullptr; }
208223

209224
#if JUCE_AUDIOWORKGROUP_TYPES_AVAILABLE

0 commit comments

Comments
 (0)