- update to 1.0.9
- inlude sndio(7) midi support from ratchov@ - 'libsndio' -> 'sndio' renaming throughout - completely disable OSS support
This commit is contained in:
parent
9f4650538c
commit
a62a108b80
@ -1,10 +1,9 @@
|
|||||||
# $OpenBSD: Makefile,v 1.5 2009/03/06 21:24:52 jasper Exp $
|
# $OpenBSD: Makefile,v 1.6 2009/10/15 15:44:50 jakemsr Exp $
|
||||||
|
|
||||||
COMMENT = SoundFont2 software synthesizer
|
COMMENT = SoundFont2 software synthesizer
|
||||||
DISTNAME = fluidsynth-1.0.8
|
DISTNAME = fluidsynth-1.0.9
|
||||||
PKGNAME = ${DISTNAME}p2
|
|
||||||
|
|
||||||
SHARED_LIBS = fluidsynth 0.0
|
SHARED_LIBS = fluidsynth 0.1
|
||||||
|
|
||||||
CATEGORIES = audio
|
CATEGORIES = audio
|
||||||
HOMEPAGE = http://fluidsynth.resonance.org/trac
|
HOMEPAGE = http://fluidsynth.resonance.org/trac
|
||||||
@ -21,10 +20,6 @@ WANTLIB = c m ncurses pthread readline sndio
|
|||||||
|
|
||||||
MASTER_SITES = ${MASTER_SITE_SAVANNAH:=fluid/}
|
MASTER_SITES = ${MASTER_SITE_SAVANNAH:=fluid/}
|
||||||
|
|
||||||
DEV_FLAGS = -DDEVOSSAUDIO=\\\"/dev/audio\\\" \
|
|
||||||
-DDEVOSSMIDI=\\\"/dev/rmidi0\\\"
|
|
||||||
MAKE_FLAGS = CFLAGS="${CFLAGS} ${DEV_FLAGS}"
|
|
||||||
|
|
||||||
LIB_DEPENDS = jack::audio/jack
|
LIB_DEPENDS = jack::audio/jack
|
||||||
|
|
||||||
AUTOCONF_VERSION = 2.61
|
AUTOCONF_VERSION = 2.61
|
||||||
@ -38,10 +33,11 @@ CONFIGURE_STYLE = gnu
|
|||||||
CONFIGURE_ARGS += ${CONFIGURE_SHARED} \
|
CONFIGURE_ARGS += ${CONFIGURE_SHARED} \
|
||||||
--disable-lash \
|
--disable-lash \
|
||||||
--disable-ladcca \
|
--disable-ladcca \
|
||||||
--disable-oss-support
|
--disable-oss-support \
|
||||||
|
--disable-portaudio-support
|
||||||
|
|
||||||
post-patch:
|
post-patch:
|
||||||
cp ${FILESDIR}/fluid_libsndio.c ${WRKSRC}/src/
|
cp ${FILESDIR}/fluid_sndio.c ${WRKSRC}/src/
|
||||||
|
|
||||||
pre-configure:
|
pre-configure:
|
||||||
cd ${WRKSRC} && AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
|
cd ${WRKSRC} && AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
MD5 (fluidsynth-1.0.8.tar.gz) = 4qv9Lmn9iyjZZd+WjX1E7g==
|
MD5 (fluidsynth-1.0.9.tar.gz) = WEdVLglSj8kdyojxDLk5HA==
|
||||||
RMD160 (fluidsynth-1.0.8.tar.gz) = H2R2Je2JN/SAQBg287b3gZ+kark=
|
RMD160 (fluidsynth-1.0.9.tar.gz) = B37LEwAO5Y68DPzeZTI6ehEo8eI=
|
||||||
SHA1 (fluidsynth-1.0.8.tar.gz) = H1/ZlkpyEvdykFckSXq9RqseJTY=
|
SHA1 (fluidsynth-1.0.9.tar.gz) = /tjc2KgWmB4eMKyIGKRZSetPWcA=
|
||||||
SHA256 (fluidsynth-1.0.8.tar.gz) = RefJln0PsDRPTaU5qzQ/uXk4SzakKahZTJTPRm3/QyA=
|
SHA256 (fluidsynth-1.0.9.tar.gz) = Fxtrt1T7Y0LNAPkTn1hzvBt2TUos/nBAmq5ssfAabmA=
|
||||||
SIZE (fluidsynth-1.0.8.tar.gz) = 1267922
|
SIZE (fluidsynth-1.0.9.tar.gz) = 927002
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* libsndio backend for FluidSynth - A Software Synthesizer
|
/* sndio backend for FluidSynth - A Software Synthesizer
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
|
* Copyright (c) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
|
||||||
*
|
*
|
||||||
@ -16,16 +16,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* fluid_libsndio.c
|
/* fluid_sndio.c
|
||||||
*
|
*
|
||||||
* Driver for the libsndio audio access library
|
* Driver for the sndio audio access library
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fluid_synth.h"
|
#include "fluid_synth.h"
|
||||||
#include "fluid_adriver.h"
|
#include "fluid_adriver.h"
|
||||||
|
#include "fluid_midi.h"
|
||||||
|
#include "fluid_mdriver.h"
|
||||||
#include "fluid_settings.h"
|
#include "fluid_settings.h"
|
||||||
|
|
||||||
#if LIBSNDIO_SUPPORT
|
#if SNDIO_SUPPORT
|
||||||
|
|
||||||
#include <sndio.h>
|
#include <sndio.h>
|
||||||
|
|
||||||
@ -35,7 +37,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
/** fluid_libsndio_audio_driver_t
|
/** fluid_sndio_audio_driver_t
|
||||||
*
|
*
|
||||||
* This structure should not be accessed directly. Use audio port
|
* This structure should not be accessed directly. Use audio port
|
||||||
* functions instead.
|
* functions instead.
|
||||||
@ -54,28 +56,36 @@ typedef struct {
|
|||||||
fluid_audio_func_t callback;
|
fluid_audio_func_t callback;
|
||||||
void* data;
|
void* data;
|
||||||
float* buffers[2];
|
float* buffers[2];
|
||||||
} fluid_libsndio_audio_driver_t;
|
} fluid_sndio_audio_driver_t;
|
||||||
|
|
||||||
int delete_fluid_libsndio_audio_driver(fluid_audio_driver_t* p);
|
typedef struct {
|
||||||
|
fluid_midi_driver_t driver;
|
||||||
|
struct mio_hdl *hdl;
|
||||||
|
pthread_t thread;
|
||||||
|
int status;
|
||||||
|
fluid_midi_parser_t *parser;
|
||||||
|
} fluid_sndio_midi_driver_t;
|
||||||
|
|
||||||
|
int delete_fluid_sndio_audio_driver(fluid_audio_driver_t* p);
|
||||||
|
|
||||||
/* local utilities */
|
/* local utilities */
|
||||||
static void* fluid_libsndio_audio_run(void* d);
|
static void* fluid_sndio_audio_run(void* d);
|
||||||
static void* fluid_libsndio_audio_run2(void* d);
|
static void* fluid_sndio_audio_run2(void* d);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
fluid_libsndio_audio_driver_settings(fluid_settings_t* settings)
|
fluid_sndio_audio_driver_settings(fluid_settings_t* settings)
|
||||||
{
|
{
|
||||||
fluid_settings_register_str(settings, "audio.libsndio.device", NULL, 0, NULL, NULL);
|
fluid_settings_register_str(settings, "audio.sndio.device", NULL, 0, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* new_fluid_libsndio_audio_driver
|
* new_fluid_sndio_audio_driver
|
||||||
*/
|
*/
|
||||||
fluid_audio_driver_t*
|
fluid_audio_driver_t*
|
||||||
new_fluid_libsndio_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth)
|
new_fluid_sndio_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth)
|
||||||
{
|
{
|
||||||
fluid_libsndio_audio_driver_t* dev = NULL;
|
fluid_sndio_audio_driver_t* dev = NULL;
|
||||||
int queuesize;
|
int queuesize;
|
||||||
double sample_rate;
|
double sample_rate;
|
||||||
int periods, period_size;
|
int periods, period_size;
|
||||||
@ -83,12 +93,12 @@ new_fluid_libsndio_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth
|
|||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
dev = FLUID_NEW(fluid_libsndio_audio_driver_t);
|
dev = FLUID_NEW(fluid_sndio_audio_driver_t);
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
FLUID_LOG(FLUID_ERR, "Out of memory");
|
FLUID_LOG(FLUID_ERR, "Out of memory");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
FLUID_MEMSET(dev, 0, sizeof(fluid_libsndio_audio_driver_t));
|
FLUID_MEMSET(dev, 0, sizeof(fluid_sndio_audio_driver_t));
|
||||||
|
|
||||||
fluid_settings_getint(settings, "audio.periods", &periods);
|
fluid_settings_getint(settings, "audio.periods", &periods);
|
||||||
fluid_settings_getint(settings, "audio.period-size", &period_size);
|
fluid_settings_getint(settings, "audio.period-size", &period_size);
|
||||||
@ -102,13 +112,13 @@ new_fluid_libsndio_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth
|
|||||||
dev->buffer_size = (int) period_size;
|
dev->buffer_size = (int) period_size;
|
||||||
queuesize = (int) (periods * period_size);
|
queuesize = (int) (periods * period_size);
|
||||||
|
|
||||||
if (!fluid_settings_getstr(settings, "audio.libsndio.device", &devname)) {
|
if (!fluid_settings_getstr(settings, "audio.sndio.device", &devname)) {
|
||||||
devname = NULL;
|
devname = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->hdl = sio_open(devname, SIO_PLAY, 0);
|
dev->hdl = sio_open(devname, SIO_PLAY, 0);
|
||||||
if (dev->hdl == NULL) {
|
if (dev->hdl == NULL) {
|
||||||
FLUID_LOG(FLUID_ERR, "libsndio could not be opened for writing");
|
FLUID_LOG(FLUID_ERR, "sndio could not be opened for writing");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,21 +152,21 @@ new_fluid_libsndio_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth
|
|||||||
dev->par.rate = sample_rate;
|
dev->par.rate = sample_rate;
|
||||||
|
|
||||||
if (!sio_setpar(dev->hdl, &dev->par)) {
|
if (!sio_setpar(dev->hdl, &dev->par)) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't set libsndio audio parameters");
|
FLUID_LOG(FLUID_ERR, "Couldn't set sndio audio parameters");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sio_getpar(dev->hdl, &dev->par)) {
|
if (!sio_getpar(dev->hdl, &dev->par)) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't get libsndio audio parameters");
|
FLUID_LOG(FLUID_ERR, "Couldn't get sndio audio parameters");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
} else if (dev->par.pchan != 2 || dev->par.rate != sample_rate ||
|
} else if (dev->par.pchan != 2 || dev->par.rate != sample_rate ||
|
||||||
dev->par.bits != 16) {
|
dev->par.bits != 16) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't set libsndio audio parameters as desired");
|
FLUID_LOG(FLUID_ERR, "Couldn't set sndio audio parameters as desired");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sio_start(dev->hdl)) {
|
if (!sio_start(dev->hdl)) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't start libsndio");
|
FLUID_LOG(FLUID_ERR, "Couldn't start sndio");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +175,7 @@ new_fluid_libsndio_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth
|
|||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pthread_create(&dev->thread, &attr, fluid_libsndio_audio_run, (void*) dev);
|
err = pthread_create(&dev->thread, &attr, fluid_sndio_audio_run, (void*) dev);
|
||||||
if (err) {
|
if (err) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't create audio thread");
|
FLUID_LOG(FLUID_ERR, "Couldn't create audio thread");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
@ -174,14 +184,14 @@ new_fluid_libsndio_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth
|
|||||||
return (fluid_audio_driver_t*) dev;
|
return (fluid_audio_driver_t*) dev;
|
||||||
|
|
||||||
error_recovery:
|
error_recovery:
|
||||||
delete_fluid_libsndio_audio_driver((fluid_audio_driver_t*) dev);
|
delete_fluid_sndio_audio_driver((fluid_audio_driver_t*) dev);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
fluid_audio_driver_t*
|
fluid_audio_driver_t*
|
||||||
new_fluid_libsndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t func, void* data)
|
new_fluid_sndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t func, void* data)
|
||||||
{
|
{
|
||||||
fluid_libsndio_audio_driver_t* dev = NULL;
|
fluid_sndio_audio_driver_t* dev = NULL;
|
||||||
int queuesize;
|
int queuesize;
|
||||||
double sample_rate;
|
double sample_rate;
|
||||||
int periods, period_size;
|
int periods, period_size;
|
||||||
@ -189,12 +199,12 @@ new_fluid_libsndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t
|
|||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
dev = FLUID_NEW(fluid_libsndio_audio_driver_t);
|
dev = FLUID_NEW(fluid_sndio_audio_driver_t);
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
FLUID_LOG(FLUID_ERR, "Out of memory");
|
FLUID_LOG(FLUID_ERR, "Out of memory");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
FLUID_MEMSET(dev, 0, sizeof(fluid_libsndio_audio_driver_t));
|
FLUID_MEMSET(dev, 0, sizeof(fluid_sndio_audio_driver_t));
|
||||||
|
|
||||||
fluid_settings_getint(settings, "audio.periods", &periods);
|
fluid_settings_getint(settings, "audio.periods", &periods);
|
||||||
fluid_settings_getint(settings, "audio.period-size", &period_size);
|
fluid_settings_getint(settings, "audio.period-size", &period_size);
|
||||||
@ -210,13 +220,13 @@ new_fluid_libsndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t
|
|||||||
queuesize = (int) (periods * period_size);
|
queuesize = (int) (periods * period_size);
|
||||||
dev->buffer_byte_size = dev->buffer_size * 2 * 2; /* 2 channels * 16 bits audio */
|
dev->buffer_byte_size = dev->buffer_size * 2 * 2; /* 2 channels * 16 bits audio */
|
||||||
|
|
||||||
if (!fluid_settings_getstr(settings, "audio.libsndio.device", &devname)) {
|
if (!fluid_settings_getstr(settings, "audio.sndio.device", &devname)) {
|
||||||
devname = NULL;
|
devname = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->hdl = sio_open(devname, SIO_PLAY, 0);
|
dev->hdl = sio_open(devname, SIO_PLAY, 0);
|
||||||
if (dev->hdl == NULL) {
|
if (dev->hdl == NULL) {
|
||||||
FLUID_LOG(FLUID_ERR, "libsndio could not be opened for writing");
|
FLUID_LOG(FLUID_ERR, "sndio could not be opened for writing");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,16 +246,16 @@ new_fluid_libsndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t
|
|||||||
dev->par.rate = sample_rate;
|
dev->par.rate = sample_rate;
|
||||||
|
|
||||||
if (!sio_setpar(dev->hdl, &dev->par)){
|
if (!sio_setpar(dev->hdl, &dev->par)){
|
||||||
FLUID_LOG(FLUID_ERR, "Can't configure libsndio parameters");
|
FLUID_LOG(FLUID_ERR, "Can't configure sndio parameters");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sio_getpar(dev->hdl, &dev->par)) {
|
if (!sio_getpar(dev->hdl, &dev->par)) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't get libsndio audio parameters");
|
FLUID_LOG(FLUID_ERR, "Couldn't get sndio audio parameters");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
} else if (dev->par.pchan != 2 || dev->par.rate != sample_rate ||
|
} else if (dev->par.pchan != 2 || dev->par.rate != sample_rate ||
|
||||||
dev->par.bits != 16) {
|
dev->par.bits != 16) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't set libsndio audio parameters as desired");
|
FLUID_LOG(FLUID_ERR, "Couldn't set sndio audio parameters as desired");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +269,7 @@ new_fluid_libsndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!sio_start(dev->hdl)) {
|
if (!sio_start(dev->hdl)) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't start libsndio");
|
FLUID_LOG(FLUID_ERR, "Couldn't start sndio");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +278,7 @@ new_fluid_libsndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t
|
|||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pthread_create(&dev->thread, &attr, fluid_libsndio_audio_run2, (void*) dev);
|
err = pthread_create(&dev->thread, &attr, fluid_sndio_audio_run2, (void*) dev);
|
||||||
if (err) {
|
if (err) {
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't create audio2 thread");
|
FLUID_LOG(FLUID_ERR, "Couldn't create audio2 thread");
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
@ -277,17 +287,17 @@ new_fluid_libsndio_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t
|
|||||||
return (fluid_audio_driver_t*) dev;
|
return (fluid_audio_driver_t*) dev;
|
||||||
|
|
||||||
error_recovery:
|
error_recovery:
|
||||||
delete_fluid_libsndio_audio_driver((fluid_audio_driver_t*) dev);
|
delete_fluid_sndio_audio_driver((fluid_audio_driver_t*) dev);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* delete_fluid_libsndio_audio_driver
|
* delete_fluid_sndio_audio_driver
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
delete_fluid_libsndio_audio_driver(fluid_audio_driver_t* p)
|
delete_fluid_sndio_audio_driver(fluid_audio_driver_t* p)
|
||||||
{
|
{
|
||||||
fluid_libsndio_audio_driver_t* dev = (fluid_libsndio_audio_driver_t*) p;
|
fluid_sndio_audio_driver_t* dev = (fluid_sndio_audio_driver_t*) p;
|
||||||
|
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
return FLUID_OK;
|
return FLUID_OK;
|
||||||
@ -310,12 +320,12 @@ delete_fluid_libsndio_audio_driver(fluid_audio_driver_t* p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fluid_libsndio_audio_run
|
* fluid_sndio_audio_run
|
||||||
*/
|
*/
|
||||||
void*
|
void*
|
||||||
fluid_libsndio_audio_run(void* d)
|
fluid_sndio_audio_run(void* d)
|
||||||
{
|
{
|
||||||
fluid_libsndio_audio_driver_t* dev = (fluid_libsndio_audio_driver_t*) d;
|
fluid_sndio_audio_driver_t* dev = (fluid_sndio_audio_driver_t*) d;
|
||||||
fluid_synth_t* synth = dev->synth;
|
fluid_synth_t* synth = dev->synth;
|
||||||
void* buffer = dev->buffer;
|
void* buffer = dev->buffer;
|
||||||
int len = dev->buffer_size;
|
int len = dev->buffer_size;
|
||||||
@ -336,12 +346,12 @@ fluid_libsndio_audio_run(void* d)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fluid_libsndio_audio_run
|
* fluid_sndio_audio_run
|
||||||
*/
|
*/
|
||||||
void*
|
void*
|
||||||
fluid_libsndio_audio_run2(void* d)
|
fluid_sndio_audio_run2(void* d)
|
||||||
{
|
{
|
||||||
fluid_libsndio_audio_driver_t* dev = (fluid_libsndio_audio_driver_t*) d;
|
fluid_sndio_audio_driver_t* dev = (fluid_sndio_audio_driver_t*) d;
|
||||||
short* buffer = (short*) dev->buffer;
|
short* buffer = (short*) dev->buffer;
|
||||||
float* left = dev->buffers[0];
|
float* left = dev->buffers[0];
|
||||||
float* right = dev->buffers[1];
|
float* right = dev->buffers[1];
|
||||||
@ -368,5 +378,153 @@ fluid_libsndio_audio_run2(void* d)
|
|||||||
return 0; /* not reached */
|
return 0; /* not reached */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fluid_sndio_midi_driver_settings(fluid_settings_t* settings)
|
||||||
|
{
|
||||||
|
fluid_settings_register_str(settings, "midi.sndio.device", NULL, 0, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /*#if LIBSNDIO_SUPPORT */
|
int
|
||||||
|
delete_fluid_sndio_midi_driver(fluid_midi_driver_t *addr)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
fluid_sndio_midi_driver_t *dev = (fluid_sndio_midi_driver_t *)addr;
|
||||||
|
|
||||||
|
if (dev == NULL) {
|
||||||
|
return FLUID_OK;
|
||||||
|
}
|
||||||
|
dev->status = FLUID_MIDI_DONE;
|
||||||
|
|
||||||
|
/* cancel the thread and wait for it before cleaning up */
|
||||||
|
if (dev->thread) {
|
||||||
|
err = pthread_cancel(dev->thread);
|
||||||
|
if (err) {
|
||||||
|
FLUID_LOG(FLUID_ERR, "Failed to cancel the midi thread");
|
||||||
|
return FLUID_FAILED;
|
||||||
|
}
|
||||||
|
if (pthread_join(dev->thread, NULL)) {
|
||||||
|
FLUID_LOG(FLUID_ERR, "Failed to join the midi thread");
|
||||||
|
return FLUID_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dev->hdl != NULL) {
|
||||||
|
mio_close(dev->hdl);
|
||||||
|
}
|
||||||
|
if (dev->parser != NULL) {
|
||||||
|
delete_fluid_midi_parser(dev->parser);
|
||||||
|
}
|
||||||
|
FLUID_FREE(dev);
|
||||||
|
return FLUID_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
fluid_sndio_midi_run(void *addr)
|
||||||
|
{
|
||||||
|
int n, i;
|
||||||
|
fluid_midi_event_t* evt;
|
||||||
|
fluid_sndio_midi_driver_t *dev = (fluid_sndio_midi_driver_t *)addr;
|
||||||
|
#define MIDI_BUFLEN (3125 / 10)
|
||||||
|
unsigned char buffer[MIDI_BUFLEN];
|
||||||
|
|
||||||
|
/* make sure the other threads can cancel this thread any time */
|
||||||
|
if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL)) {
|
||||||
|
FLUID_LOG(FLUID_ERR, "Failed to set the cancel state of the midi thread");
|
||||||
|
pthread_exit(NULL);
|
||||||
|
}
|
||||||
|
if (pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL)) {
|
||||||
|
FLUID_LOG(FLUID_ERR, "Failed to set the cancel state of the midi thread");
|
||||||
|
pthread_exit(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* go into a loop until someone tells us to stop */
|
||||||
|
dev->status = FLUID_MIDI_LISTENING;
|
||||||
|
|
||||||
|
while (dev->status == FLUID_MIDI_LISTENING) {
|
||||||
|
|
||||||
|
/* read new data */
|
||||||
|
n = mio_read(dev->hdl, buffer, MIDI_BUFLEN);
|
||||||
|
if (n == 0 && mio_eof(dev->hdl)) {
|
||||||
|
fprintf(stderr, "cant read midi device\n");
|
||||||
|
FLUID_LOG(FLUID_ERR, "Failed to read the midi input");
|
||||||
|
dev->status = FLUID_MIDI_DONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* let the parser convert the data into events */
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
|
evt = fluid_midi_parser_parse(dev->parser, buffer[i]);
|
||||||
|
if (evt != NULL) {
|
||||||
|
/* send the event to the next link in the chain */
|
||||||
|
(*dev->driver.handler)(dev->driver.data, evt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pthread_exit(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
fluid_sndio_midi_driver_status(fluid_midi_driver_t *addr)
|
||||||
|
{
|
||||||
|
fluid_sndio_midi_driver_t *dev = (fluid_sndio_midi_driver_t *)addr;
|
||||||
|
return dev->status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fluid_midi_driver_t *
|
||||||
|
new_fluid_sndio_midi_driver(fluid_settings_t *settings,
|
||||||
|
handle_midi_event_func_t handler, void *data)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
fluid_sndio_midi_driver_t *dev;
|
||||||
|
char *device;
|
||||||
|
|
||||||
|
/* not much use doing anything */
|
||||||
|
if (handler == NULL) {
|
||||||
|
FLUID_LOG(FLUID_ERR, "Invalid argument");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* allocate the device */
|
||||||
|
dev = FLUID_NEW(fluid_sndio_midi_driver_t);
|
||||||
|
if (dev == NULL) {
|
||||||
|
FLUID_LOG(FLUID_ERR, "Out of memory");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
FLUID_MEMSET(dev, 0, sizeof(fluid_sndio_midi_driver_t));
|
||||||
|
dev->hdl = NULL;
|
||||||
|
|
||||||
|
dev->driver.handler = handler;
|
||||||
|
dev->driver.data = data;
|
||||||
|
|
||||||
|
/* allocate one event to store the input data */
|
||||||
|
dev->parser = new_fluid_midi_parser();
|
||||||
|
if (dev->parser == NULL) {
|
||||||
|
FLUID_LOG(FLUID_ERR, "Out of memory");
|
||||||
|
goto error_recovery;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* get the device name. if none is specified, use the default device. */
|
||||||
|
if (!fluid_settings_getstr(settings, "midi.sndio.device", &device)) {
|
||||||
|
device = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* open the default hardware device. only use midi in. */
|
||||||
|
dev->hdl = mio_open(device, MIO_IN, 0);
|
||||||
|
if (dev->hdl == NULL) {
|
||||||
|
fprintf(stderr, "%s: couldn't open midi device\n");
|
||||||
|
goto error_recovery;
|
||||||
|
}
|
||||||
|
|
||||||
|
dev->status = FLUID_MIDI_READY;
|
||||||
|
|
||||||
|
err = pthread_create(&dev->thread, NULL, fluid_sndio_midi_run, (void *)dev);
|
||||||
|
if (err) {
|
||||||
|
FLUID_LOG(FLUID_PANIC, "Couldn't create the midi thread.");
|
||||||
|
goto error_recovery;
|
||||||
|
}
|
||||||
|
return (fluid_midi_driver_t *) dev;
|
||||||
|
|
||||||
|
error_recovery:
|
||||||
|
delete_fluid_sndio_midi_driver((fluid_midi_driver_t *)dev);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /*#if SNDIO_SUPPORT */
|
@ -1,7 +1,7 @@
|
|||||||
$OpenBSD: patch-configure_ac,v 1.1 2008/12/26 08:45:12 jakemsr Exp $
|
$OpenBSD: patch-configure_ac,v 1.2 2009/10/15 15:44:50 jakemsr Exp $
|
||||||
--- configure.ac.orig Sat Oct 18 20:58:26 2008
|
--- configure.ac.orig Sat Apr 11 22:06:55 2009
|
||||||
+++ configure.ac Sat Oct 18 21:08:50 2008
|
+++ configure.ac Tue Oct 13 20:59:08 2009
|
||||||
@@ -49,7 +49,8 @@ AM_PROG_LIBTOOL
|
@@ -50,7 +50,8 @@ AM_PROG_LIBTOOL
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
|
|
||||||
dnl Check for libraries
|
dnl Check for libraries
|
||||||
@ -11,7 +11,7 @@ $OpenBSD: patch-configure_ac,v 1.1 2008/12/26 08:45:12 jakemsr Exp $
|
|||||||
|
|
||||||
dnl Check for header files
|
dnl Check for header files
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
@@ -82,7 +83,7 @@ AC_SUBST(LIBFLUID_CPPFLAGS)
|
@@ -87,7 +88,7 @@ AC_SUBST(LIBFLUID_CPPFLAGS)
|
||||||
AC_SUBST(LIBFLUID_LDFLAGS)
|
AC_SUBST(LIBFLUID_LDFLAGS)
|
||||||
AC_SUBST(FLUID_CPPFLAGS)
|
AC_SUBST(FLUID_CPPFLAGS)
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ $OpenBSD: patch-configure_ac,v 1.1 2008/12/26 08:45:12 jakemsr Exp $
|
|||||||
|
|
||||||
AC_ARG_ENABLE(double, AS_HELP_STRING([--enable-double],
|
AC_ARG_ENABLE(double, AS_HELP_STRING([--enable-double],
|
||||||
[double floating point for dsp (default=float)]),
|
[double floating point for dsp (default=float)]),
|
||||||
@@ -136,7 +137,7 @@ if test "$ENABLE_DEBUG" = "yes"; then
|
@@ -141,7 +142,7 @@ if test "$ENABLE_DEBUG" = "yes"; then
|
||||||
CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused"
|
CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused"
|
||||||
AC_DEFINE(DEBUG, 1, [Define to activate debugging message])
|
AC_DEFINE(DEBUG, 1, [Define to activate debugging message])
|
||||||
else
|
else
|
||||||
@ -29,44 +29,44 @@ $OpenBSD: patch-configure_ac,v 1.1 2008/12/26 08:45:12 jakemsr Exp $
|
|||||||
AC_DEFINE(DEBUG, 0, [Define to activate debugging message])
|
AC_DEFINE(DEBUG, 0, [Define to activate debugging message])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -183,7 +184,27 @@ dnl - Check support for OSS audio
|
@@ -228,7 +229,27 @@ dnl - Check support for OSS audio
|
||||||
AC_OSS_AUDIO
|
AC_OSS_AUDIO
|
||||||
AM_CONDITIONAL(OSS_SUPPORT, test "$OSS_SUPPORT" = "1")
|
AM_CONDITIONAL(OSS_SUPPORT, test "$OSS_SUPPORT" = "1")
|
||||||
|
|
||||||
+dnl - Check for libsndio support
|
+dnl - Check for sndio support
|
||||||
+AC_ARG_ENABLE(libsndio-support, AS_HELP_STRING([--disable-libsndio-support],
|
+AC_ARG_ENABLE(sndio-support, AS_HELP_STRING([--disable-sndio-support],
|
||||||
+ [disable libsndio support (default=auto)]),
|
+ [disable sndio support (default=auto)]),
|
||||||
+ enable_libsndio=$enableval, enable_libsndio="yes")
|
+ enable_sndio=$enableval, enable_sndio="yes")
|
||||||
|
|
||||||
+if test "x$enable_libsndio" != "xno"; then
|
+if test "x$enable_sndio" != "xno"; then
|
||||||
+ AC_CHECK_HEADER(sndio.h, LIBSNDIO_SUPPORT=1, LIBSNDIO_SUPPORT=0)
|
+ AC_CHECK_HEADER(sndio.h, SNDIO_SUPPORT=1, SNDIO_SUPPORT=0)
|
||||||
+else
|
+else
|
||||||
+ LIBSNDIO_SUPPORT=0
|
+ SNDIO_SUPPORT=0
|
||||||
+fi
|
+fi
|
||||||
+
|
+
|
||||||
+if test "$LIBSNDIO_SUPPORT" = "1"; then
|
+if test "$SNDIO_SUPPORT" = "1"; then
|
||||||
+ AC_DEFINE(LIBSNDIO_SUPPORT, 1, [Define to enable libsndio driver])
|
+ AC_DEFINE(SNDIO_SUPPORT, 1, [Define to enable sndio driver])
|
||||||
+fi
|
+fi
|
||||||
+AM_CONDITIONAL(LIBSNDIO_SUPPORT, test "$LIBSNDIO_SUPPORT" = "1")
|
+AM_CONDITIONAL(SNDIO_SUPPORT, test "$SNDIO_SUPPORT" = "1")
|
||||||
+LIBSNDIO_CFLAGS=""
|
+SNDIO_CFLAGS=""
|
||||||
+AC_SUBST(LIBSNDIO_CFLAGS)
|
+AC_SUBST(SNDIO_CFLAGS)
|
||||||
+LIBSNDIO_LIBS="-lsndio"
|
+SNDIO_LIBS="-lsndio"
|
||||||
+AC_SUBST(LIBSNDIO_LIBS)
|
+AC_SUBST(SNDIO_LIBS)
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
dnl - Check support for MidiShare
|
dnl - Check support for MidiShare
|
||||||
AC_MIDISHARE
|
AC_MIDISHARE
|
||||||
|
|
||||||
@@ -341,6 +362,12 @@ if test "${OSS_SUPPORT}" = "1"; then
|
@@ -440,6 +461,12 @@ if test "${OSS_SUPPORT}" = "1"; then
|
||||||
echo "OSS: yes"
|
echo "OSS: yes"
|
||||||
else
|
else
|
||||||
echo "OSS: no"
|
echo "OSS: no"
|
||||||
+fi
|
+fi
|
||||||
+
|
+
|
||||||
+if test "${LIBSNDIO_SUPPORT}" = "1"; then
|
+if test "${SNDIO_SUPPORT}" = "1"; then
|
||||||
+ echo "libsndio: yes"
|
+ echo "sndio: yes"
|
||||||
+else
|
+else
|
||||||
+ echo "libsndio: no"
|
+ echo "sndio: no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "${MIDISHARE_SUPPORT}" = "1"; then
|
if test "${MIDISHARE_SUPPORT}" = "1"; then
|
||||||
|
@ -1,43 +1,40 @@
|
|||||||
$OpenBSD: patch-src_Makefile_am,v 1.1 2008/12/26 08:45:12 jakemsr Exp $
|
$OpenBSD: patch-src_Makefile_am,v 1.2 2009/10/15 15:44:50 jakemsr Exp $
|
||||||
--- src/Makefile.am.orig Sun Nov 11 12:06:28 2007
|
--- src/Makefile.am.orig Tue Feb 3 23:34:02 2009
|
||||||
+++ src/Makefile.am Sat Dec 20 17:37:23 2008
|
+++ src/Makefile.am Tue Oct 13 21:12:04 2009
|
||||||
@@ -17,8 +17,12 @@ if MINGW32_SUPPORT
|
@@ -33,6 +33,10 @@ if OSS_SUPPORT
|
||||||
fluid_windows = fluid_dll.c fluid_dsound.c fluid_winmidi.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
-if OSS_SUPPORT
|
|
||||||
+# if OSS_SUPPORT
|
|
||||||
fluid_oss = fluid_oss.c
|
fluid_oss = fluid_oss.c
|
||||||
+# endif
|
|
||||||
+
|
|
||||||
+if LIBSNDIO_SUPPORT
|
|
||||||
+fluid_libsndio = fluid_libsndio.c
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
+if SNDIO_SUPPORT
|
||||||
|
+fluid_sndio = fluid_sndio.c
|
||||||
|
+endif
|
||||||
|
+
|
||||||
# if LASH_SUPPORT || LADCCA_SUPPORT (Makefile supports OR?)
|
# if LASH_SUPPORT || LADCCA_SUPPORT (Makefile supports OR?)
|
||||||
@@ -33,7 +37,7 @@ endif
|
if LASH_SUPPORT
|
||||||
|
fluid_lash = fluid_lash.c
|
||||||
|
@@ -49,7 +53,7 @@ endif
|
||||||
# Extra files and optional drivers
|
# Extra files and optional drivers
|
||||||
EXTRA_DIST = fluid_dll.c fluid_dsound.c fluid_winmidi.c fluid_portaudio.c \
|
EXTRA_DIST = fluid_dll.c fluid_dsound.c fluid_winmidi.c fluid_portaudio.c \
|
||||||
- fluid_coreaudio.c fluid_alsa.c fluid_oss.c \
|
fluid_coreaudio.c fluid_alsa.c fluid_oss.c fluid_pulse.c \
|
||||||
+ fluid_coreaudio.c fluid_alsa.c fluid_oss.c fluid_libsndio.c \
|
- fluid_dsp_simple.c \
|
||||||
fluid_dsp_simple.c \
|
+ fluid_sndio.c fluid_dsp_simple.c \
|
||||||
fluid_sndmgr.c config_macos.h config_macosx.h config_macosx_pb.h \
|
fluid_sndmgr.c config_macos.h config_macosx.h config_macosx_pb.h \
|
||||||
config_win32.h fluid_jack.c
|
config_win32.h fluid_jack.c fluid_dart.c
|
||||||
@@ -47,6 +51,7 @@ libfluidsynth_la_SOURCES = \
|
|
||||||
$(fluid_jack) \
|
@@ -65,6 +69,7 @@ libfluidsynth_la_SOURCES = \
|
||||||
$(fluid_lash) \
|
|
||||||
$(fluid_oss) \
|
$(fluid_oss) \
|
||||||
+ $(fluid_libsndio) \
|
$(fluid_portaudio) \
|
||||||
|
$(fluid_pulse) \
|
||||||
|
+ $(fluid_sndio) \
|
||||||
$(fluid_windows) \
|
$(fluid_windows) \
|
||||||
|
$(fluid_dart) \
|
||||||
fluid_adriver.c \
|
fluid_adriver.c \
|
||||||
fluid_adriver.h \
|
@@ -129,7 +134,7 @@ INCLUDES = -I$(top_srcdir)/include $(LASH_CFLAGS) $(LA
|
||||||
@@ -108,7 +113,7 @@ INCLUDES = -I$(top_srcdir)/include $(LASH_CFLAGS) $(LA
|
|
||||||
$(READLINE_CFLAGS) $(JACK_CFLAGS) $(ALSA_CFLAGS)
|
|
||||||
|
|
||||||
libfluidsynth_la_LIBADD = $(LIBFLUID_LIBS) $(LASH_LIBS) $(LADCCA_LIBS) \
|
libfluidsynth_la_LIBADD = $(LIBFLUID_LIBS) $(LASH_LIBS) $(LADCCA_LIBS) \
|
||||||
- $(READLINE_LIBS) $(COREAUDIO_LIBS) $(JACK_LIBS) $(ALSA_LIBS)
|
$(READLINE_LIBS) $(COREAUDIO_LIBS) $(COREMIDI_LIBS) $(JACK_LIBS) \
|
||||||
+ $(READLINE_LIBS) $(COREAUDIO_LIBS) $(JACK_LIBS) $(ALSA_LIBS) $(LIBSNDIO_LIBS)
|
- $(ALSA_LIBS) $(PULSE_LIBS) $(PORTAUDIO_LIBS) $(DART_LIBS)
|
||||||
|
+ $(ALSA_LIBS) $(PULSE_LIBS) $(PORTAUDIO_LIBS) $(DART_LIBS) $(SNDIO_LIBS)
|
||||||
|
|
||||||
libfluidsynth_la_LDFLAGS = \
|
libfluidsynth_la_LDFLAGS = \
|
||||||
-version-info @LT_VERSION_INFO@ \
|
-version-info @LT_VERSION_INFO@ \
|
||||||
-export-dynamic $(LIBFLUID_LDFLAGS)
|
|
||||||
|
@ -1,52 +1,52 @@
|
|||||||
$OpenBSD: patch-src_fluid_adriver_c,v 1.1 2008/12/26 08:45:12 jakemsr Exp $
|
$OpenBSD: patch-src_fluid_adriver_c,v 1.2 2009/10/15 15:44:50 jakemsr Exp $
|
||||||
--- src/fluid_adriver.c.orig Sat Oct 18 20:34:27 2008
|
--- src/fluid_adriver.c.orig Sun Mar 15 18:02:15 2009
|
||||||
+++ src/fluid_adriver.c Sat Oct 18 20:36:59 2008
|
+++ src/fluid_adriver.c Tue Oct 13 20:55:26 2009
|
||||||
@@ -56,6 +56,15 @@ int delete_fluid_oss_audio_driver(fluid_audio_driver_t
|
@@ -64,6 +64,15 @@ int delete_fluid_oss_audio_driver(fluid_audio_driver_t
|
||||||
void fluid_oss_audio_driver_settings(fluid_settings_t* settings);
|
void fluid_oss_audio_driver_settings(fluid_settings_t* settings);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
+#if LIBSNDIO_SUPPORT
|
+#if SNDIO_SUPPORT
|
||||||
+fluid_audio_driver_t* new_fluid_libsndio_audio_driver(fluid_settings_t* settings,
|
+fluid_audio_driver_t* new_fluid_sndio_audio_driver(fluid_settings_t* settings,
|
||||||
+ fluid_synth_t* synth);
|
+ fluid_synth_t* synth);
|
||||||
+fluid_audio_driver_t* new_fluid_libsndio_audio_driver2(fluid_settings_t* settings,
|
+fluid_audio_driver_t* new_fluid_sndio_audio_driver2(fluid_settings_t* settings,
|
||||||
+ fluid_audio_func_t func, void* data);
|
+ fluid_audio_func_t func, void* data);
|
||||||
+int delete_fluid_libsndio_audio_driver(fluid_audio_driver_t* p);
|
+int delete_fluid_sndio_audio_driver(fluid_audio_driver_t* p);
|
||||||
+void fluid_libsndio_audio_driver_settings(fluid_settings_t* settings);
|
+void fluid_sndio_audio_driver_settings(fluid_settings_t* settings);
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
#if COREAUDIO_SUPPORT
|
#if COREAUDIO_SUPPORT
|
||||||
fluid_audio_driver_t* new_fluid_core_audio_driver(fluid_settings_t* settings,
|
fluid_audio_driver_t* new_fluid_core_audio_driver(fluid_settings_t* settings,
|
||||||
fluid_synth_t* synth);
|
fluid_synth_t* synth);
|
||||||
@@ -112,6 +121,13 @@ fluid_audriver_definition_t fluid_audio_drivers[] = {
|
@@ -129,6 +138,13 @@ fluid_audriver_definition_t fluid_audio_drivers[] = {
|
||||||
delete_fluid_oss_audio_driver,
|
delete_fluid_jack_audio_driver,
|
||||||
fluid_oss_audio_driver_settings },
|
fluid_jack_audio_driver_settings },
|
||||||
#endif
|
#endif
|
||||||
+#if LIBSNDIO_SUPPORT
|
+#if SNDIO_SUPPORT
|
||||||
+ { "libsndio",
|
+ { "sndio",
|
||||||
+ new_fluid_libsndio_audio_driver,
|
+ new_fluid_sndio_audio_driver,
|
||||||
+ new_fluid_libsndio_audio_driver2,
|
+ new_fluid_sndio_audio_driver2,
|
||||||
+ delete_fluid_libsndio_audio_driver,
|
+ delete_fluid_sndio_audio_driver,
|
||||||
+ fluid_libsndio_audio_driver_settings },
|
+ fluid_sndio_audio_driver_settings },
|
||||||
+#endif
|
+#endif
|
||||||
#if ALSA_SUPPORT
|
#if ALSA_SUPPORT
|
||||||
{ "alsa",
|
{ "alsa",
|
||||||
new_fluid_alsa_audio_driver,
|
new_fluid_alsa_audio_driver,
|
||||||
@@ -193,6 +209,8 @@ void fluid_audio_driver_settings(fluid_settings_t* set
|
@@ -230,6 +246,8 @@ void fluid_audio_driver_settings(fluid_settings_t* set
|
||||||
/* Set the default driver */
|
fluid_settings_register_str(settings, "audio.driver", "pulseaudio", 0, NULL, NULL);
|
||||||
#if ALSA_SUPPORT
|
|
||||||
fluid_settings_register_str(settings, "audio.driver", "alsa", 0, NULL, NULL);
|
|
||||||
+#elif LIBSNDIO_SUPPORT
|
|
||||||
+ fluid_settings_register_str(settings, "audio.driver", "libsndio", 0, NULL, NULL);
|
|
||||||
#elif OSS_SUPPORT
|
#elif OSS_SUPPORT
|
||||||
fluid_settings_register_str(settings, "audio.driver", "oss", 0, NULL, NULL);
|
fluid_settings_register_str(settings, "audio.driver", "oss", 0, NULL, NULL);
|
||||||
|
+#elif SNDIO_SUPPORT
|
||||||
|
+ fluid_settings_register_str(settings, "audio.driver", "sndio", 0, NULL, NULL);
|
||||||
#elif COREAUDIO_SUPPORT
|
#elif COREAUDIO_SUPPORT
|
||||||
@@ -217,6 +235,9 @@ void fluid_audio_driver_settings(fluid_settings_t* set
|
fluid_settings_register_str(settings, "audio.driver", "coreaudio", 0, NULL, NULL);
|
||||||
|
#elif DSOUND_SUPPORT
|
||||||
|
@@ -255,6 +273,9 @@ void fluid_audio_driver_settings(fluid_settings_t* set
|
||||||
#endif
|
#endif
|
||||||
#if OSS_SUPPORT
|
#if OSS_SUPPORT
|
||||||
fluid_settings_add_option(settings, "audio.driver", "oss");
|
fluid_settings_add_option(settings, "audio.driver", "oss");
|
||||||
+#endif
|
+#endif
|
||||||
+#if LIBSNDIO_SUPPORT
|
+#if SNDIO_SUPPORT
|
||||||
+ fluid_settings_add_option(settings, "audio.driver", "libsndio");
|
+ fluid_settings_add_option(settings, "audio.driver", "sndio");
|
||||||
#endif
|
#endif
|
||||||
#if COREAUDIO_SUPPORT
|
#if COREAUDIO_SUPPORT
|
||||||
fluid_settings_add_option(settings, "audio.driver", "coreaudio");
|
fluid_settings_add_option(settings, "audio.driver", "coreaudio");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
$OpenBSD: patch-src_fluid_jack_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
|
$OpenBSD: patch-src_fluid_jack_c,v 1.2 2009/10/15 15:44:50 jakemsr Exp $
|
||||||
--- src/fluid_jack.c.orig Sat Apr 5 15:42:46 2008
|
--- src/fluid_jack.c.orig Sun Mar 8 22:43:14 2009
|
||||||
+++ src/fluid_jack.c Sat Apr 5 15:43:54 2008
|
+++ src/fluid_jack.c Tue Oct 13 20:47:41 2009
|
||||||
@@ -83,7 +83,7 @@ fluid_jack_audio_driver_settings(fluid_settings_t* set
|
@@ -90,7 +90,7 @@ fluid_jack_audio_driver_settings(fluid_settings_t* set
|
||||||
{
|
{
|
||||||
fluid_settings_register_str(settings, "audio.jack.id", "fluidsynth", 0, NULL, NULL);
|
fluid_settings_register_str(settings, "audio.jack.id", "fluidsynth", 0, NULL, NULL);
|
||||||
fluid_settings_register_str(settings, "audio.jack.multi", "no", 0, NULL, NULL);
|
fluid_settings_register_str(settings, "audio.jack.multi", "no", 0, NULL, NULL);
|
||||||
|
@ -1,34 +1,50 @@
|
|||||||
$OpenBSD: patch-src_fluid_mdriver_c,v 1.1 2008/12/26 08:45:12 jakemsr Exp $
|
--- src/fluid_mdriver.c.orig Sun Mar 8 21:31:02 2009
|
||||||
--- src/fluid_mdriver.c.orig Sat Dec 20 17:42:12 2008
|
+++ src/fluid_mdriver.c Tue Oct 13 21:12:59 2009
|
||||||
+++ src/fluid_mdriver.c Sat Dec 20 17:43:01 2008
|
@@ -46,6 +46,15 @@ fluid_midi_driver_t *new_fluid_jack_midi_driver (fluid
|
||||||
@@ -38,13 +38,13 @@ void fluid_alsa_seq_driver_settings(fluid_settings_t*
|
int delete_fluid_jack_midi_driver(fluid_midi_driver_t *p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
+/* SNDIO */
|
||||||
|
+#if SNDIO_SUPPORT
|
||||||
|
+fluid_midi_driver_t* new_fluid_sndio_midi_driver(fluid_settings_t* settings,
|
||||||
|
+ handle_midi_event_func_t handler,
|
||||||
|
+ void* event_handler_data);
|
||||||
|
+int delete_fluid_sndio_midi_driver(fluid_midi_driver_t* p);
|
||||||
|
+void fluid_sndio_midi_driver_settings(fluid_settings_t* settings);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
/* OSS */
|
/* OSS */
|
||||||
-#if OSS_SUPPORT
|
#if OSS_SUPPORT
|
||||||
+/* #if OSS_SUPPORT */
|
|
||||||
fluid_midi_driver_t* new_fluid_oss_midi_driver(fluid_settings_t* settings,
|
fluid_midi_driver_t* new_fluid_oss_midi_driver(fluid_settings_t* settings,
|
||||||
handle_midi_event_func_t handler,
|
@@ -118,6 +127,12 @@ struct fluid_mdriver_definition_t fluid_midi_drivers[]
|
||||||
void* event_handler_data);
|
delete_fluid_alsa_seq_driver,
|
||||||
int delete_fluid_oss_midi_driver(fluid_midi_driver_t* p);
|
fluid_alsa_seq_driver_settings },
|
||||||
void fluid_oss_midi_driver_settings(fluid_settings_t* settings);
|
#endif
|
||||||
-#endif
|
+#if SNDIO_SUPPORT
|
||||||
+/* #endif */
|
+ { "sndio",
|
||||||
|
+ new_fluid_sndio_midi_driver,
|
||||||
/* Windows MIDI service */
|
+ delete_fluid_sndio_midi_driver,
|
||||||
|
+ fluid_sndio_midi_driver_settings },
|
||||||
|
+#endif
|
||||||
#if WINMIDI_SUPPORT
|
#if WINMIDI_SUPPORT
|
||||||
@@ -78,12 +78,12 @@ struct fluid_mdriver_definition_t {
|
{ "winmidi",
|
||||||
|
new_fluid_winmidi_driver,
|
||||||
|
@@ -152,6 +167,8 @@ void fluid_midi_driver_settings(fluid_settings_t* sett
|
||||||
struct fluid_mdriver_definition_t fluid_midi_drivers[] = {
|
fluid_settings_register_str(settings, "midi.driver", "jack", 0, NULL, NULL);
|
||||||
-#if OSS_SUPPORT
|
#elif OSS_SUPPORT
|
||||||
+/* #if OSS_SUPPORT */
|
fluid_settings_register_str(settings, "midi.driver", "oss", 0, NULL, NULL);
|
||||||
{ "oss",
|
+#elif SNDIO_SUPPORT
|
||||||
new_fluid_oss_midi_driver,
|
+ fluid_settings_register_str(settings, "midi.driver", "sndio", 0, NULL, NULL);
|
||||||
delete_fluid_oss_midi_driver,
|
#elif WINMIDI_SUPPORT
|
||||||
fluid_oss_midi_driver_settings },
|
fluid_settings_register_str(settings, "midi.driver", "winmidi", 0, NULL, NULL);
|
||||||
-#endif
|
#elif MIDISHARE_SUPPORT
|
||||||
+/* #endif */
|
@@ -166,6 +183,9 @@ void fluid_midi_driver_settings(fluid_settings_t* sett
|
||||||
#if ALSA_SUPPORT
|
#if ALSA_SUPPORT
|
||||||
{ "alsa_raw",
|
fluid_settings_add_option(settings, "midi.driver", "alsa_seq");
|
||||||
new_fluid_alsa_rawmidi_driver,
|
fluid_settings_add_option(settings, "midi.driver", "alsa_raw");
|
||||||
|
+#endif
|
||||||
|
+#if SNDIO_SUPPORT
|
||||||
|
+ fluid_settings_add_option(settings, "midi.driver", "sndio");
|
||||||
|
#endif
|
||||||
|
#if JACK_SUPPORT
|
||||||
|
fluid_settings_add_option(settings, "midi.driver", "jack");
|
||||||
|
@ -1,99 +0,0 @@
|
|||||||
$OpenBSD: patch-src_fluid_oss_c,v 1.3 2008/12/26 08:45:12 jakemsr Exp $
|
|
||||||
--- src/fluid_oss.c.orig Tue Sep 18 23:10:57 2007
|
|
||||||
+++ src/fluid_oss.c Sat Dec 20 17:57:57 2008
|
|
||||||
@@ -34,6 +34,9 @@
|
|
||||||
|
|
||||||
#include <sys/soundcard.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
+
|
|
||||||
+#endif /*#if OSS_SUPPORT */
|
|
||||||
+
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
@@ -49,6 +52,8 @@
|
|
||||||
#define OSS_PCM_SCHED_PRIORITY 90
|
|
||||||
#define OSS_MIDI_SCHED_PRIORITY 90
|
|
||||||
|
|
||||||
+#if OSS_SUPPORT
|
|
||||||
+
|
|
||||||
/** fluid_oss_audio_driver_t
|
|
||||||
*
|
|
||||||
* This structure should not be accessed directly. Use audio port
|
|
||||||
@@ -82,6 +87,7 @@ static int fluid_oss_get_sample_formats(fluid_oss_audi
|
|
||||||
static void* fluid_oss_audio_run(void* d);
|
|
||||||
static void* fluid_oss_audio_run2(void* d);
|
|
||||||
|
|
||||||
+#endif /*#if OSS_SUPPORT */
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
fluid_midi_driver_t driver;
|
|
||||||
@@ -99,6 +105,7 @@ int delete_fluid_oss_midi_driver(fluid_midi_driver_t*
|
|
||||||
int fluid_oss_midi_driver_status(fluid_midi_driver_t* p);
|
|
||||||
static void* fluid_oss_midi_run(void* d);
|
|
||||||
|
|
||||||
+#if OSS_SUPPORT
|
|
||||||
|
|
||||||
void
|
|
||||||
fluid_oss_audio_driver_settings(fluid_settings_t* settings)
|
|
||||||
@@ -639,10 +646,11 @@ fluid_oss_audio_run2(void* d)
|
|
||||||
return 0; /* not reached */
|
|
||||||
}
|
|
||||||
|
|
||||||
+#endif /*#if OSS_SUPPORT */
|
|
||||||
|
|
||||||
void fluid_oss_midi_driver_settings(fluid_settings_t* settings)
|
|
||||||
{
|
|
||||||
- fluid_settings_register_str(settings, "midi.oss.device", "/dev/midi", 0, NULL, NULL);
|
|
||||||
+ fluid_settings_register_str(settings, "midi.oss.device", DEVOSSMIDI, 0, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -655,8 +663,10 @@ new_fluid_oss_midi_driver(fluid_settings_t* settings,
|
|
||||||
int err;
|
|
||||||
fluid_oss_midi_driver_t* dev;
|
|
||||||
pthread_attr_t attr;
|
|
||||||
+#if !defined(__OpenBSD__)
|
|
||||||
int sched = SCHED_FIFO;
|
|
||||||
struct sched_param priority;
|
|
||||||
+#endif
|
|
||||||
char* device;
|
|
||||||
|
|
||||||
/* not much use doing anything */
|
|
||||||
@@ -687,7 +697,7 @@ new_fluid_oss_midi_driver(fluid_settings_t* settings,
|
|
||||||
/* get the device name. if none is specified, use the default device. */
|
|
||||||
fluid_settings_getstr(settings, "midi.oss.device", &device);
|
|
||||||
if (device == NULL) {
|
|
||||||
- device = "/dev/midi";
|
|
||||||
+ device = DEVOSSMIDI;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* open the default hardware device. only use midi in. */
|
|
||||||
@@ -704,6 +714,14 @@ new_fluid_oss_midi_driver(fluid_settings_t* settings,
|
|
||||||
FLUID_LOG(FLUID_ERR, "Couldn't initialize midi thread attributes");
|
|
||||||
goto error_recovery;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+#if defined(__OpenBSD__)
|
|
||||||
+ err = pthread_create(&dev->thread, &attr, fluid_oss_midi_run, (void*) dev);
|
|
||||||
+ if (err) {
|
|
||||||
+ FLUID_LOG(FLUID_ERR, "Couldn't create midi thread");
|
|
||||||
+ goto error_recovery;
|
|
||||||
+ }
|
|
||||||
+#else
|
|
||||||
/* use fifo scheduling. if it fails, use default scheduling. */
|
|
||||||
while (1) {
|
|
||||||
err = pthread_attr_setschedpolicy(&attr, sched);
|
|
||||||
@@ -735,6 +753,7 @@ new_fluid_oss_midi_driver(fluid_settings_t* settings,
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
+#endif /* __OpenBSD__ */
|
|
||||||
return (fluid_midi_driver_t*) dev;
|
|
||||||
|
|
||||||
error_recovery:
|
|
||||||
@@ -833,4 +852,3 @@ fluid_oss_midi_driver_status(fluid_midi_driver_t* p)
|
|
||||||
return dev->status;
|
|
||||||
}
|
|
||||||
|
|
||||||
-#endif /*#if OSS_SUPPORT */
|
|
@ -1,7 +1,7 @@
|
|||||||
$OpenBSD: patch-src_fluid_synth_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
|
$OpenBSD: patch-src_fluid_synth_c,v 1.2 2009/10/15 15:44:50 jakemsr Exp $
|
||||||
--- src/fluid_synth.c.orig Sat Apr 5 15:21:35 2008
|
--- src/fluid_synth.c.orig Sun Mar 15 20:01:36 2009
|
||||||
+++ src/fluid_synth.c Sat Apr 5 15:21:51 2008
|
+++ src/fluid_synth.c Tue Oct 13 20:47:41 2009
|
||||||
@@ -127,7 +127,7 @@ void fluid_synth_settings(fluid_settings_t* settings)
|
@@ -128,7 +128,7 @@ void fluid_synth_settings(fluid_settings_t* settings)
|
||||||
fluid_settings_register_int(settings, "synth.effects-channels",
|
fluid_settings_register_int(settings, "synth.effects-channels",
|
||||||
2, 2, 2, 0, NULL, NULL);
|
2, 2, 2, 0, NULL, NULL);
|
||||||
fluid_settings_register_num(settings, "synth.sample-rate",
|
fluid_settings_register_num(settings, "synth.sample-rate",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
$OpenBSD: patch-src_fluid_sys_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
|
$OpenBSD: patch-src_fluid_sys_c,v 1.2 2009/10/15 15:44:50 jakemsr Exp $
|
||||||
--- src/fluid_sys.c.orig Sun Nov 11 11:47:30 2007
|
--- src/fluid_sys.c.orig Tue Feb 3 23:29:24 2009
|
||||||
+++ src/fluid_sys.c Fri Feb 15 17:09:36 2008
|
+++ src/fluid_sys.c Tue Oct 13 20:47:41 2009
|
||||||
@@ -709,8 +709,10 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
|
@@ -889,8 +889,10 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
|
||||||
{
|
{
|
||||||
pthread_attr_t *attr = NULL;
|
pthread_attr_t *attr = NULL;
|
||||||
pthread_attr_t rt_attr;
|
pthread_attr_t rt_attr;
|
||||||
@ -12,7 +12,7 @@ $OpenBSD: patch-src_fluid_sys_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
fluid_timer_t* timer = FLUID_NEW(fluid_timer_t);
|
fluid_timer_t* timer = FLUID_NEW(fluid_timer_t);
|
||||||
@@ -726,6 +728,7 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
|
@@ -906,6 +908,7 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
|
||||||
timer->auto_destroy = auto_destroy;
|
timer->auto_destroy = auto_destroy;
|
||||||
|
|
||||||
err = pthread_attr_init(&rt_attr);
|
err = pthread_attr_init(&rt_attr);
|
||||||
@ -20,7 +20,7 @@ $OpenBSD: patch-src_fluid_sys_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
|
|||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
err = pthread_attr_setschedpolicy(&rt_attr, SCHED_FIFO);
|
err = pthread_attr_setschedpolicy(&rt_attr, SCHED_FIFO);
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
@@ -736,6 +739,7 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
|
@@ -916,6 +919,7 @@ new_fluid_timer(int msec, fluid_timer_callback_t callb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
$OpenBSD: patch-src_fluidsynth_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
|
$OpenBSD: patch-src_fluidsynth_c,v 1.2 2009/10/15 15:44:50 jakemsr Exp $
|
||||||
--- src/fluidsynth.c.orig Sun Nov 11 02:09:48 2007
|
--- src/fluidsynth.c.orig Tue Feb 3 23:45:02 2009
|
||||||
+++ src/fluidsynth.c Fri Feb 15 17:09:36 2008
|
+++ src/fluidsynth.c Tue Oct 13 20:57:00 2009
|
||||||
@@ -212,9 +212,9 @@ int main(int argc, char** argv)
|
@@ -212,9 +212,9 @@ int main(int argc, char** argv)
|
||||||
int audio_channels = 0;
|
int audio_channels = 0;
|
||||||
int with_server = 0;
|
int with_server = 0;
|
||||||
int dump = 0;
|
int dump = 0;
|
||||||
- int connect_lash = 1;
|
- int connect_lash = 1;
|
||||||
char *optchars = "a:C:c:df:G:g:hijK:L:lm:no:R:r:sVvz:";
|
char *optchars = "a:C:c:df:G:g:hijK:L:lm:no:p:R:r:sVvz:";
|
||||||
#ifdef LASH_ENABLED
|
#ifdef LASH_ENABLED
|
||||||
+ int connect_lash = 1;
|
+ int connect_lash = 1;
|
||||||
int enabled_lash = 0; /* set to TRUE if lash gets enabled */
|
int enabled_lash = 0; /* set to TRUE if lash gets enabled */
|
||||||
@ -22,7 +22,7 @@ $OpenBSD: patch-src_fluidsynth_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
|
|||||||
{"dump", 0, 0, 'd'},
|
{"dump", 0, 0, 'd'},
|
||||||
{"gain", 1, 0, 'g'},
|
{"gain", 1, 0, 'g'},
|
||||||
{"help", 0, 0, 'h'},
|
{"help", 0, 0, 'h'},
|
||||||
@@ -343,9 +345,11 @@ int main(int argc, char** argv)
|
@@ -344,9 +346,11 @@ int main(int argc, char** argv)
|
||||||
audio_channels = atoi(optarg);
|
audio_channels = atoi(optarg);
|
||||||
fluid_settings_setint(settings, "synth.audio-channels", audio_channels);
|
fluid_settings_setint(settings, "synth.audio-channels", audio_channels);
|
||||||
break;
|
break;
|
||||||
@ -34,7 +34,7 @@ $OpenBSD: patch-src_fluidsynth_c,v 1.1.1.1 2008/04/06 22:42:11 jakemsr Exp $
|
|||||||
case 'm':
|
case 'm':
|
||||||
fluid_settings_setstr(settings, "midi.driver", optarg);
|
fluid_settings_setstr(settings, "midi.driver", optarg);
|
||||||
break;
|
break;
|
||||||
@@ -417,12 +421,14 @@ int main(int argc, char** argv)
|
@@ -421,12 +425,14 @@ int main(int argc, char** argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LASH_ENABLED
|
#ifdef LASH_ENABLED
|
||||||
|
Loading…
Reference in New Issue
Block a user