ports/devel/sdl12/files/SDL_sndioaudio.h
Tobias Kortkamp 7562116656 Add sndio backend
While here

- Add LICENSE_FILE, USES=localbase
- Strip library
- Group audio backend options
- Use options helpers for VGL

I think the configure script patch needs to be explained.  OpenBSD
regenerates the configure script from configure.in after patching
sndio detection into it.  However SDL 1.2 requires an older autoconf
version (2.59) which is not available on FreeBSD.  Lots of errors when
using autoconf 2.69.

Since I was unable to regenerate it I opted to edit configure
manually.  So it does the bare minimum to wire the backend sources
into the build and make sure that SNDIO_CONFIGURE_ENABLE can do its
job in enabling/disabling sndio support.

Approved by:	lme (mentor)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D10658
2017-05-30 18:59:02 +00:00

50 lines
1.5 KiB
C

/*
* Copyright (c) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "SDL_config.h"
#ifndef _SDL_sndioaudio_h
#define _SDL_sndioaudio_h
#include <sndio.h>
#include "../SDL_sysaudio.h"
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_AudioDevice *this
struct SDL_PrivateAudioData {
/* The stream descriptor for the audio device */
struct sio_hdl *hdl;
/* The parent process id, to detect when application quits */
pid_t parent;
/* Raw mixing buffer */
Uint8 *mixbuf;
int mixlen;
};
/* Old variable names */
#define stream (this->hidden->stream)
#define parent (this->hidden->parent)
#define mixbuf (this->hidden->mixbuf)
#define mixlen (this->hidden->mixlen)
#define hdl (this->hidden->hdl)
#endif /* _SDL_sndioaudio_h */