1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

audio/portmidi: New port: Library for real time MIDI input and output

PortMIDI is a cross platform (Windows, macOS, Linux, and BSDs which support
alsalib) library for interfacing with operating systems' MIDI I/O APIs. It was
started by Ross Bencina and Phil Burk, then maintained by Roger B. Dannenberg,
and now maintained by the Mixxx DJ Software team.

WWW: https://github.com/mixxxdj/portmidi
This commit is contained in:
Jose Alonso Cardenas Marquez 2021-07-16 21:31:07 -05:00
parent d902630dfc
commit 4efef97420
7 changed files with 112 additions and 0 deletions

View File

@ -626,6 +626,7 @@
SUBDIR += poly-lv2
SUBDIR += polyphone
SUBDIR += portaudio
SUBDIR += portmidi
SUBDIR += praat
SUBDIR += pragha
SUBDIR += prelude-lv2

20
audio/portmidi/Makefile Normal file
View File

@ -0,0 +1,20 @@
PORTNAME= portmidi
PORTVERSION= 235.0
CATEGORIES= audio
MAINTAINER= acm@FreeBSD.org
COMMENT= Library for real time MIDI input and output
LICENSE= PL
LICENSE_NAME= PortMidi license
LICENSE_FILE= ${WRKSRC}/license.txt
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
LIB_DEPENDS= libasound.so:audio/alsa-lib
USES= cmake dos2unix localbase:ldflags
USE_GITHUB= yes
GH_ACCOUNT= mixxxdj
.include <bsd.port.mk>

3
audio/portmidi/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1626464614
SHA256 (mixxxdj-portmidi-235.0_GH0.tar.gz) = 34cb2761b54965b2ffccf0cc50896e3460e2fd5336562469bd2bf3ce7ce7ae88
SIZE (mixxxdj-portmidi-235.0_GH0.tar.gz) = 725719

View File

@ -0,0 +1,21 @@
--- src/portmidi/linux/finddefault.c.orig 2021-07-17 02:14:06 UTC
+++ src/portmidi/linux/finddefault.c
@@ -5,6 +5,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#if defined(__FreeBSD__)
+#include <ctype.h>
+#endif
#include "portmidi.h"
#define STRING_MAX 256
@@ -27,7 +30,7 @@ int match_string(FILE *inf, char *s)
/*
-/* Parse preference files, find default device, search devices --
+ * Parse preference files, find default device, search devices --
*/
PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
/* path -- the name of the preference we are searching for

View File

@ -0,0 +1,51 @@
--- src/porttime/ptlinux.c.orig 2021-07-17 02:14:06 UTC
+++ src/porttime/ptlinux.c
@@ -1,3 +1,4 @@
+
/* ptlinux.c -- portable timer implementation for linux */
@@ -31,14 +32,14 @@ CHANGE LOG
#include "porttime.h"
#include "sys/time.h"
#include "sys/resource.h"
-#include "sys/timeb.h"
#include "pthread.h"
#define TRUE 1
#define FALSE 0
static int time_started_flag = FALSE;
-static struct timeb time_offset = {0, 0, 0, 0};
+static struct timeval *time_offset;
+
static pthread_t pt_thread_pid;
static int pt_thread_created = FALSE;
@@ -79,7 +80,8 @@ static void *Pt_CallbackProc(void *p)
PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
{
if (time_started_flag) return ptNoError;
- ftime(&time_offset); /* need this set before process runs */
+ gettimeofday(time_offset, NULL);
+
if (callback) {
int res;
pt_callback_parameters *parms = (pt_callback_parameters *)
@@ -121,10 +123,12 @@ int Pt_Started()
PtTimestamp Pt_Time()
{
long seconds, milliseconds;
- struct timeb now;
- ftime(&now);
- seconds = now.time - time_offset.time;
- milliseconds = now.millitm - time_offset.millitm;
+ struct timeval *now;
+
+ gettimeofday(now, NULL);
+
+ seconds = now->tv_sec - time_offset->tv_sec;
+ milliseconds = now->tv_usec - time_offset->tv_usec;
return seconds * 1000 + milliseconds;
}

6
audio/portmidi/pkg-descr Normal file
View File

@ -0,0 +1,6 @@
PortMIDI is a cross platform (Windows, macOS, Linux, and BSDs which support
alsalib) library for interfacing with operating systems' MIDI I/O APIs. It was
started by Ross Bencina and Phil Burk, then maintained by Roger B. Dannenberg,
and now maintained by the Mixxx DJ Software team.
WWW: https://github.com/mixxxdj/portmidi

10
audio/portmidi/pkg-plist Normal file
View File

@ -0,0 +1,10 @@
include/pmutil.h
include/portmidi.h
include/porttime.h
lib/cmake/PortMidi/PortMidiConfig.cmake
lib/cmake/PortMidi/PortMidiConfigVersion.cmake
lib/cmake/PortMidi/PortMidiTargets-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/PortMidi/PortMidiTargets.cmake
lib/libportmidi.so
lib/libporttime.so
libdata/pkgconfig/portmidi.pc