mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-07-02 00:22:10 -05:00
Remove libremidi patch
This commit is contained in:
parent
d2b4b1cc07
commit
7c4c0056ce
|
|
@ -43,21 +43,6 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(OS_MACOS)
|
||||
set(PATCH_FILE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/remove-bit-cast-for-macos-build.patch")
|
||||
execute_process(
|
||||
COMMAND git apply ${PATCH_FILE}
|
||||
WORKING_DIRECTORY ${LIBREMIDI_DIR}
|
||||
RESULT_VARIABLE PATCH_RESULT)
|
||||
if(PATCH_RESULT EQUAL 0)
|
||||
message("Libremidi patch \"${PATCH_FILE}\" applied successfully!")
|
||||
else()
|
||||
message(
|
||||
WARNING "Libremidi patch \"${PATCH_FILE}\" did NOT apply successfully!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_sources(
|
||||
${PROJECT_NAME}
|
||||
PRIVATE macro-condition-midi.cpp macro-condition-midi.hpp
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
diff --git a/include/libremidi/backends/coremidi/helpers.hpp b/include/libremidi/backends/coremidi/helpers.hpp
|
||||
index 08e62ff..ba35ec7 100644
|
||||
--- a/include/libremidi/backends/coremidi/helpers.hpp
|
||||
+++ b/include/libremidi/backends/coremidi/helpers.hpp
|
||||
@@ -207,7 +207,8 @@ inline CFStringRef ConnectedEndpointName(MIDIEndpointRef endpoint)
|
||||
inline MIDIObjectRef
|
||||
locate_object(auto& self, const port_information& info, MIDIObjectType requested_type)
|
||||
{
|
||||
- auto uid = std::bit_cast<std::int32_t>((uint32_t)info.port);
|
||||
+ std::int32_t uid;
|
||||
+ std::memcpy(&uid, &(info.port), sizeof(uint32_t));
|
||||
MIDIObjectRef object{};
|
||||
MIDIObjectType type{};
|
||||
auto ret = MIDIObjectFindByUniqueID(uid, &object, &type);
|
||||
diff --git a/include/libremidi/backends/coremidi/observer.hpp b/include/libremidi/backends/coremidi/observer.hpp
|
||||
index defe623..12a936a 100644
|
||||
--- a/include/libremidi/backends/coremidi/observer.hpp
|
||||
+++ b/include/libremidi/backends/coremidi/observer.hpp
|
||||
@@ -78,13 +78,16 @@ public:
|
||||
if (!ok)
|
||||
return {};
|
||||
|
||||
- return std::conditional_t<Input, input_port, output_port>{
|
||||
- {.client = (std::uintptr_t)this->client,
|
||||
- .port = std::bit_cast<uint32_t>(get_int_property(obj, kMIDIPropertyUniqueID)),
|
||||
- .manufacturer = get_string_property(obj, kMIDIPropertyManufacturer),
|
||||
- .device_name = get_string_property(obj, kMIDIPropertyModel),
|
||||
- .port_name = get_string_property(obj, kMIDIPropertyName),
|
||||
- .display_name = get_string_property(obj, kMIDIPropertyDisplayName)}};
|
||||
+ std::conditional_t<Input, input_port, output_port> ret{
|
||||
+ {.client = (std::uintptr_t)this->client,
|
||||
+ .port = 0,
|
||||
+ .manufacturer = get_string_property(obj, kMIDIPropertyManufacturer),
|
||||
+ .device_name = get_string_property(obj, kMIDIPropertyModel),
|
||||
+ .port_name = get_string_property(obj, kMIDIPropertyName),
|
||||
+ .display_name = get_string_property(obj, kMIDIPropertyDisplayName)}};
|
||||
+ auto prop = get_int_property(obj, kMIDIPropertyUniqueID);
|
||||
+ std::memcpy(&ret.port, &(prop), sizeof(prop));
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
std::vector<libremidi::input_port> get_input_ports() const noexcept override
|
||||
Loading…
Reference in New Issue
Block a user