Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haiku support #38

Merged
merged 4 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packaging/PortMidiConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
if(UNIX AND NOT APPLE AND (@LINUX_DEFINES@ MATCHES ".*PMALSA.*"))
if(UNIX AND NOT APPLE AND NOT HAIKU AND (@LINUX_DEFINES@ MATCHES ".*PMALSA.*"))
find_dependency(ALSA)
endif()

Expand Down
7 changes: 7 additions & 0 deletions pm_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ if(UNIX AND APPLE)
${COREFOUNDATION_LIBRARY} ${COREMIDI_LIBRARY} ${CORESERVICES_LIBRARY})
# set to CMake default; is this right?:
set_target_properties(portmidi PROPERTIES MACOSX_RPATH ON)
elseif(HAIKU)
set(PM_LIB_PRIVATE_SRC
${PMDIR}/porttime/pthaiku.cpp
${PMDIR}/pm_haiku/pmhaiku.cpp
${PMDIR}/pm_linux/finddefault.c)
set(PM_NEEDED_LIBS be midi2 PARENT_SCOPE)
target_link_libraries(portmidi PRIVATE be midi2)
elseif(UNIX)
target_compile_definitions(portmidi PRIVATE ${LINUX_FLAGS})
set(PM_LIB_PRIVATE_SRC
Expand Down
374 changes: 187 additions & 187 deletions pm_common/pminternal.h

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pm_common/portmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,14 +841,15 @@ PmError pm_create_internal(PmInternal **stream, PmDeviceID device_id,
int is_input, int latency, PmTimeProcPtr time_proc,
void *time_info, int buffer_size)
{
PmInternal *midi;
if (device_id < 0 || device_id >= pm_descriptor_len) {
return pmInvalidDeviceId;
}
if (latency < 0) { /* force a legal value */
latency = 0;
}
/* create portMidi internal data */
PmInternal *midi = (PmInternal *) pm_alloc(sizeof(PmInternal));
midi = (PmInternal *) pm_alloc(sizeof(PmInternal));
*stream = midi;
if (!midi) {
return pmInsufficientMemory;
Expand Down