src/audio/nto/SDL_nto_audio.h
author Sam Lantinga
Mon, 06 Feb 2006 08:28:51 +0000
changeset 1330 450721ad5436
parent 769 b8d311d90021
child 1361 19418e4422cb
permissions -rw-r--r--
It's now possible to build SDL without any C runtime at all on Windows,
using Visual C++ 2005
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@769
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@0
     6
    modify it under the terms of the GNU Library General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@0
     8
    version 2 of the License, or (at your option) any later version.
slouken@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@0
    13
    Library General Public License for more details.
slouken@0
    14
slouken@0
    15
    You should have received a copy of the GNU Library General Public
slouken@0
    16
    License along with this library; if not, write to the Free
slouken@0
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@252
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@0
    22
slouken@718
    23
#ifndef __SDL_NTO_AUDIO_H__
slouken@718
    24
#define __SDL_NTO_AUDIO_H__
slouken@0
    25
slouken@0
    26
#include "SDL_sysaudio.h"
slouken@0
    27
#include <sys/asoundlib.h>
slouken@0
    28
slouken@718
    29
/* Hidden "this" pointer for the audio functions */
slouken@0
    30
#define _THIS	SDL_AudioDevice *this
slouken@0
    31
slouken@718
    32
struct SDL_PrivateAudioData
slouken@718
    33
{
slouken@718
    34
    /* The audio device handle */
slouken@718
    35
    int cardno;
slouken@718
    36
    int deviceno;
slouken@718
    37
    snd_pcm_t* audio_handle;
slouken@0
    38
slouken@718
    39
    /* The audio file descriptor */
slouken@718
    40
    int audio_fd;
slouken@0
    41
slouken@718
    42
    /* The parent process id, to detect when application quits */
slouken@718
    43
    pid_t parent;
slouken@718
    44
slouken@718
    45
    /* Raw mixing buffer */
slouken@718
    46
    Uint8* pcm_buf;
slouken@718
    47
    Uint32 pcm_len;
slouken@0
    48
slouken@718
    49
    /* QSA parameters */
slouken@718
    50
    snd_pcm_channel_status_t cstatus;
slouken@718
    51
    snd_pcm_channel_params_t cparams;
slouken@718
    52
    snd_pcm_channel_setup_t  csetup;
slouken@0
    53
};
slouken@0
    54
slouken@718
    55
#define cardno          (this->hidden->cardno)
slouken@718
    56
#define deviceno        (this->hidden->deviceno)
slouken@718
    57
#define audio_handle    (this->hidden->audio_handle)
slouken@718
    58
#define audio_fd        (this->hidden->audio_fd)
slouken@718
    59
#define parent          (this->hidden->parent)
slouken@718
    60
#define pcm_buf         (this->hidden->pcm_buf)
slouken@718
    61
#define pcm_len         (this->hidden->pcm_len)
slouken@718
    62
#define cstatus         (this->hidden->cstatus)
slouken@718
    63
#define cparams         (this->hidden->cparams)
slouken@718
    64
#define csetup          (this->hidden->csetup)
slouken@0
    65
slouken@718
    66
#endif /* __SDL_NTO_AUDIO_H__ */