19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* 29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL - Simple DirectMedia Layer 39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Copyright (C) 1997-2012 Sam Lantinga 49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall This library is free software; you can redistribute it and/or 69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modify it under the terms of the GNU Lesser General Public 79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall License as published by the Free Software Foundation; either 89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall version 2.1 of the License, or (at your option) any later version. 99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall This library is distributed in the hope that it will be useful, 119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall but WITHOUT ANY WARRANTY; without even the implied warranty of 129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Lesser General Public License for more details. 149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall You should have received a copy of the GNU Lesser General Public 169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall License along with this library; if not, write to the Free Software 179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Sam Lantinga 209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall slouken@libsdl.org 219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall*/ 229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_config.h" 239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifndef _SDL_lowaudio_h 259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _SDL_lowaudio_h 269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../SDL_sysaudio.h" 289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Hidden "this" pointer for the video functions */ 309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _THIS SDL_AudioDevice *this 319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstruct SDL_PrivateAudioData { 339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* The file descriptor for the audio device */ 349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall int audio_fd; 359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Uint16 audio_fmt; /* The app audio format */ 379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Uint8 *mixbuf; /* The app mixing buffer */ 389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall int ulaw_only; /* Flag -- does hardware only output U-law? */ 399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Uint8 *ulaw_buf; /* The U-law mixing buffer */ 409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Sint32 written; /* The number of samples written */ 419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall int fragsize; /* The audio fragment size in samples */ 429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall int frequency; /* The audio frequency in KHz */ 439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}; 449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Old variable names */ 469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define audio_fd (this->hidden->audio_fd) 479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define audio_fmt (this->hidden->audio_fmt) 489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define mixbuf (this->hidden->mixbuf) 499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define ulaw_only (this->hidden->ulaw_only) 509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define ulaw_buf (this->hidden->ulaw_buf) 519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define written (this->hidden->written) 529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define fragsize (this->hidden->fragsize) 539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define frequency (this->hidden->frequency) 549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif /* _SDL_lowaudio_h */ 56