Skip to content

Commit 86bb910

Browse files
committed
More fixes
1 parent 45a0e10 commit 86bb910

File tree

3 files changed

+76
-98
lines changed

3 files changed

+76
-98
lines changed

modules/yup_audio_devices/native/yup_Midi_linux.cpp

Lines changed: 49 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,41 @@
1-
/*
2-
==============================================================================
3-
4-
This file is part of the YUP library.
5-
Copyright (c) 2024 - [email protected]
6-
7-
YUP is an open source library subject to open-source licensing.
8-
9-
The code included in this file is provided under the terms of the ISC license
10-
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
11-
to use, copy, modify, and/or distribute this software for any purpose with or
12-
without fee is hereby granted provided that the above copyright notice and
13-
this permission notice appear in all copies.
14-
15-
YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
16-
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
17-
DISCLAIMED.
18-
19-
==============================================================================
20-
21-
This file is part of the JUCE library.
22-
Copyright (c) 2022 - Raw Material Software Limited
23-
24-
JUCE is an open source library subject to commercial or open-source
25-
licensing.
26-
27-
The code included in this file is provided under the terms of the ISC license
28-
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
29-
To use, copy, modify, and/or distribute this software for any purpose with or
30-
without fee is hereby granted provided that the above copyright notice and
31-
this permission notice appear in all copies.
32-
33-
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
34-
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
35-
DISCLAIMED.
36-
37-
==============================================================================
38-
*/
1+
/*
2+
==============================================================================
393
40-
#include <array>
41-
#include <cstring>
42-
#include <poll.h>
43-
#include <unistd.h>
44-
#include <fcntl.h>
4+
This file is part of the YUP library.
5+
Copyright (c) 2024 - [email protected]
456
46-
#if defined(__has_include)
47-
#if __has_include(<alsa/ump.h>)
48-
#include <alsa/ump.h>
49-
#define YUP_HAS_ALSA_UMP 1
50-
#endif
51-
#endif
7+
YUP is an open source library subject to open-source licensing.
528
53-
#ifndef YUP_HAS_ALSA_UMP
54-
#define YUP_HAS_ALSA_UMP 0
55-
#endif
9+
The code included in this file is provided under the terms of the ISC license
10+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
11+
to use, copy, modify, and/or distribute this software for any purpose with or
12+
without fee is hereby granted provided that the above copyright notice and
13+
this permission notice appear in all copies.
14+
15+
YUP IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
16+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
17+
DISCLAIMED.
18+
19+
==============================================================================
20+
21+
This file is part of the JUCE library.
22+
Copyright (c) 2022 - Raw Material Software Limited
23+
24+
JUCE is an open source library subject to commercial or open-source
25+
licensing.
26+
27+
The code included in this file is provided under the terms of the ISC license
28+
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
29+
To use, copy, modify, and/or distribute this software for any purpose with or
30+
without fee is hereby granted provided that the above copyright notice and
31+
this permission notice appear in all copies.
32+
33+
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
34+
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
35+
DISCLAIMED.
36+
37+
==============================================================================
38+
*/
5639

5740
namespace yup
5841
{
@@ -432,6 +415,20 @@ class AlsaClient
432415

433416
int getId() const noexcept { return clientId; }
434417

418+
void configureForUmp()
419+
{
420+
#if defined(SND_SEQ_EVENT_UMP)
421+
if (! umpConfigured && handle != nullptr)
422+
{
423+
snd_seq_set_client_midi_version (handle, 2);
424+
#if defined(snd_seq_set_client_ump_conversion)
425+
snd_seq_set_client_ump_conversion (handle, 1);
426+
#endif
427+
umpConfigured = true;
428+
}
429+
#endif
430+
}
431+
435432
Port* createPort (const String& name, bool forInput, bool enableSubscription)
436433
{
437434
const ScopedLock sl (callbackLock);
@@ -766,20 +763,6 @@ struct AlsaPortPtr
766763
class MidiInput::Pimpl
767764
{
768765
public:
769-
void configureForUmp()
770-
{
771-
#if defined(SND_SEQ_EVENT_UMP)
772-
if (! umpConfigured && handle != nullptr)
773-
{
774-
snd_seq_set_client_midi_version (handle, 2);
775-
#if defined(snd_seq_set_client_ump_conversion)
776-
snd_seq_set_client_ump_conversion (handle, 1);
777-
#endif
778-
umpConfigured = true;
779-
}
780-
#endif
781-
}
782-
783766
virtual ~Pimpl() = default;
784767
virtual void start() = 0;
785768
virtual void stop() = 0;
@@ -954,31 +937,6 @@ class UmpReceiverCallback final : public MidiInputCallback
954937
ump::GenericUMPConverter converter;
955938
};
956939

957-
class UmpReceiverCallback final : public MidiInputCallback
958-
{
959-
public:
960-
UmpReceiverCallback (ump::PacketProtocol protocolIn, ump::Receiver& receiverIn)
961-
: receiver (receiverIn)
962-
, converter (protocolIn)
963-
{
964-
}
965-
966-
void handleIncomingMidiMessage (MidiInput*, const MidiMessage& message) override
967-
{
968-
const auto timestamp = message.getTimeStamp();
969-
converter.convert (ump::BytestreamMidiView (&message), [&] (const ump::View& view)
970-
{
971-
receiver.packetReceived (view, timestamp);
972-
});
973-
}
974-
975-
void handlePartialSysexMessage (MidiInput*, const uint8*, int, double) override {}
976-
977-
private:
978-
ump::Receiver& receiver;
979-
ump::GenericUMPConverter converter;
980-
};
981-
982940
Array<MidiDeviceInfo> MidiInput::getAvailableDevices()
983941
{
984942
Array<MidiDeviceInfo> devices;

modules/yup_audio_devices/yup_audio_devices.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,15 @@ YUP_END_IGNORE_WARNINGS_GCC_LIKE
184184
#include "native/yup_ALSA_linux.cpp"
185185
#endif
186186

187+
#if defined(__has_include) && __has_include(<alsa/ump.h>)
188+
#include <alsa/ump.h>
189+
#define YUP_HAS_ALSA_UMP 1
190+
#endif
191+
192+
#ifndef YUP_HAS_ALSA_UMP
193+
#define YUP_HAS_ALSA_UMP 0
194+
#endif
195+
187196
#if (YUP_LINUX && YUP_BELA)
188197
/* Got an include error here? If so, you've either not got the bela headers
189198
installed, or you've not got your paths set up correctly to find its header
@@ -198,6 +207,12 @@ YUP_END_IGNORE_WARNINGS_GCC_LIKE
198207
#undef SIZEOF
199208

200209
#if ! YUP_BELA
210+
#include <array>
211+
#include <cstring>
212+
#include <poll.h>
213+
#include <unistd.h>
214+
#include <fcntl.h>
215+
201216
#include "native/yup_Midi_linux.cpp"
202217
#endif
203218

@@ -249,6 +264,7 @@ RealtimeThreadFactory getAndroidRealtimeThreadFactory() { return nullptr; }
249264
} // namespace yup
250265
#endif
251266

267+
//==============================================================================
252268
#elif YUP_WASM
253269
#if YUP_EMSCRIPTEN
254270
#include <emscripten/webaudio.h>
@@ -261,6 +277,7 @@ RealtimeThreadFactory getAndroidRealtimeThreadFactory() { return nullptr; }
261277

262278
#endif
263279

280+
//==============================================================================
264281
#if (YUP_LINUX || YUP_BSD || YUP_MAC || YUP_WINDOWS) && YUP_JACK
265282
/* Got an include error here? If so, you've either not got jack-audio-connection-kit
266283
installed, or you've not got your paths set up correctly to find its header files.
@@ -277,6 +294,7 @@ RealtimeThreadFactory getAndroidRealtimeThreadFactory() { return nullptr; }
277294
#include "native/yup_JackAudio.cpp"
278295
#endif
279296

297+
//==============================================================================
280298
#if ! YUP_SYSTEMAUDIOVOL_IMPLEMENTED
281299
namespace yup
282300
{
@@ -309,6 +327,7 @@ bool YUP_CALLTYPE SystemAudioVolume::setMuted (bool)
309327
} // namespace yup
310328
#endif
311329

330+
//==============================================================================
312331
#include "audio_io/yup_AudioDeviceManager.cpp"
313332
#include "audio_io/yup_AudioIODevice.cpp"
314333
#include "audio_io/yup_AudioIODeviceType.cpp"

thirdparty/rive/rive.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@
2121

2222
#include "rive.h"
2323

24-
#if __clang__
25-
#pragma clang diagnostic push
26-
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
27-
#elif __GNUC__
24+
#if __GNUC__
2825
#pragma GCC diagnostic push
2926
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
27+
#pragma GCC diagnostic ignored "-Wempty-body"
28+
#elif __clang__
29+
#pragma clang diagnostic push
30+
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
3031
#elif _MSC_VER
3132
#pragma warning (push)
3233
#pragma warning (disable : 4244)
@@ -581,10 +582,10 @@
581582
#include "source/audio_event.cpp"
582583
#include "source/nested_artboard_leaf.cpp"
583584

584-
#if __clang__
585-
#pragma clang diagnostic pop
586-
#elif __GNUC__
585+
#if __GNUC__
587586
#pragma GCC diagnostic pop
587+
#elif __clang__
588+
#pragma clang diagnostic pop
588589
#elif _MSC_VER
589590
#pragma warning (pop)
590591
#endif

0 commit comments

Comments
 (0)