Removed AmigaOS audio driver from 1.3; it hasn't compiled for years, and it SDL-ryan-multiple-audio-device
authorRyan C. Gordon <icculus@icculus.org>
Wed, 04 Oct 2006 21:54:57 +0000
branchSDL-ryan-multiple-audio-device
changeset 3801e17a59e6aff6
parent 3800 2d77a732bd20
child 3802 cef5d927591f
Removed AmigaOS audio driver from 1.3; it hasn't compiled for years, and it
adds a lot of cruft to the core.
src/audio/SDL_audio.c
src/audio/amigaos/SDL_ahiaudio.c
src/audio/amigaos/SDL_ahiaudio.h
     1.1 --- a/src/audio/SDL_audio.c	Wed Oct 04 21:39:45 2006 +0000
     1.2 +++ b/src/audio/SDL_audio.c	Wed Oct 04 21:54:57 2006 +0000
     1.3 @@ -67,7 +67,6 @@
     1.4  extern AudioBootStrap BAUDIO_bootstrap;
     1.5  extern AudioBootStrap COREAUDIO_bootstrap;
     1.6  extern AudioBootStrap SNDMGR_bootstrap;
     1.7 -extern AudioBootStrap AHI_bootstrap;
     1.8  extern AudioBootStrap MINTAUDIO_GSXB_bootstrap;
     1.9  extern AudioBootStrap MINTAUDIO_MCSN_bootstrap;
    1.10  extern AudioBootStrap MINTAUDIO_STFA_bootstrap;
    1.11 @@ -128,9 +127,6 @@
    1.12  #if SDL_AUDIO_DRIVER_SNDMGR
    1.13      &SNDMGR_bootstrap,
    1.14  #endif
    1.15 -#if SDL_AUDIO_DRIVER_AHI
    1.16 -    &AHI_bootstrap,
    1.17 -#endif
    1.18  #if SDL_AUDIO_DRIVER_MINT
    1.19      &MINTAUDIO_GSXB_bootstrap,
    1.20      &MINTAUDIO_MCSN_bootstrap,
    1.21 @@ -156,10 +152,6 @@
    1.22      NULL
    1.23  };
    1.24  
    1.25 -#if SDL_AUDIO_DRIVER_AHI
    1.26 -static int audio_configured = 0;
    1.27 -#endif
    1.28 -
    1.29  static SDL_AudioDevice *get_audio_device(SDL_AudioDeviceID id)
    1.30  {
    1.31      id--;
    1.32 @@ -252,23 +244,6 @@
    1.33      void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len);
    1.34      int silence;
    1.35  
    1.36 -/* !!! FIXME: can we push this into the Amiga driver? */
    1.37 -#if SDL_AUDIO_DRIVER_AHI
    1.38 -#error this is probably broken.
    1.39 -    int started = 0;
    1.40 -
    1.41 -/* AmigaOS NEEDS that the audio driver is opened in the thread that uses it! */
    1.42 -
    1.43 -    D(bug("Task audio started audio struct:<%lx>...\n", audiop));
    1.44 -
    1.45 -    D(bug("Before Openaudio..."));
    1.46 -    if (audio->OpenAudio(audio, &audio->spec) == -1) {
    1.47 -        D(bug("Open audio failed...\n"));
    1.48 -        return (-1);
    1.49 -    }
    1.50 -    D(bug("OpenAudio...OK\n"));
    1.51 -#endif
    1.52 -
    1.53      /* Perform any thread setup */
    1.54      device->threadid = SDL_ThreadID();
    1.55      current_audio.impl.ThreadInit(device);
    1.56 @@ -277,14 +252,6 @@
    1.57      fill = device->spec.callback;
    1.58      udata = device->spec.userdata;
    1.59  
    1.60 -#if SDL_AUDIO_DRIVER_AHI
    1.61 -    audio_configured = 1;
    1.62 -
    1.63 -    D(bug("Audio configured... Checking for conversion\n"));
    1.64 -    SDL_mutexP(audio->mixer_lock);
    1.65 -    D(bug("Semaphore obtained...\n"));
    1.66 -#endif
    1.67 -
    1.68      if (device->convert.needed) {
    1.69          if (device->convert.src_format == AUDIO_U8) {
    1.70              silence = 0x80;
    1.71 @@ -297,11 +264,6 @@
    1.72          stream_len = device->spec.size;
    1.73      }
    1.74  
    1.75 -#if SDL_AUDIO_DRIVER_AHI
    1.76 -    SDL_mutexV(device->mixer_lock);
    1.77 -    D(bug("Entering audio loop...\n"));
    1.78 -#endif
    1.79 -
    1.80      /* Loop, filling the audio buffers */
    1.81      while (device->enabled) {
    1.82  
    1.83 @@ -356,15 +318,6 @@
    1.84      /* Wait for the audio to drain.. */
    1.85      current_audio.impl.WaitDone(device);
    1.86  
    1.87 -/* !!! FIXME: get this out of core. */
    1.88 -#if SDL_AUDIO_DRIVER_AHI
    1.89 -    D(bug("WaitDevice...Done\n"));
    1.90 -    current_audio.impl.CloseDevice(device);
    1.91 -    device->opened = 0;
    1.92 -    D(bug("CloseDevice..Done, subtask exiting...\n"));
    1.93 -    audio_configured = 0;
    1.94 -#endif
    1.95 -
    1.96      return (0);
    1.97  }
    1.98  
    1.99 @@ -748,34 +701,11 @@
   1.100          }
   1.101      }
   1.102  
   1.103 -/* !!! FIXME: Get this #if out of the core. */
   1.104 -/* AmigaOS opens audio inside the main loop */
   1.105 -#if !SDL_AUDIO_DRIVER_AHI
   1.106      if (!current_audio.impl.OpenDevice(device, devname, iscapture)) {
   1.107          close_audio_device(device);
   1.108          return 0;
   1.109      }
   1.110      device->opened = 1;
   1.111 -#else
   1.112 -#   error needs to be fixed for new internal API. Email Ryan for details.
   1.113 -
   1.114 -    D(bug("Locking semaphore..."));
   1.115 -    SDL_mutexP(audio->mixer_lock);
   1.116 -
   1.117 -
   1.118 -    audio->thread = SDL_CreateThread(SDL_RunAudio, audio);
   1.119 -    D(bug("Created thread...\n"));
   1.120 -
   1.121 -    if (audio->thread == NULL) {
   1.122 -        SDL_mutexV(audio->mixer_lock);
   1.123 -        SDL_CloseAudio();
   1.124 -        SDL_SetError("Couldn't create audio thread");
   1.125 -        return 0;
   1.126 -    }
   1.127 -
   1.128 -    while (!audio_configured)
   1.129 -        SDL_Delay(100);
   1.130 -#endif
   1.131  
   1.132      /* If the audio driver changes the buffer size, accept it */
   1.133      if (device->spec.samples != desired.samples) {
   1.134 @@ -834,8 +764,6 @@
   1.135          return 0;
   1.136      }
   1.137  
   1.138 -/* !!! FIXME: get this out of core. */
   1.139 -#if !SDL_AUDIO_DRIVER_AHI
   1.140      /* Start the audio thread if necessary */
   1.141      if (!current_audio.impl.ProvidesOwnCallbackThread) {
   1.142          /* Start the audio thread */
   1.143 @@ -853,12 +781,6 @@
   1.144          }
   1.145      }
   1.146  
   1.147 -#else
   1.148 -    SDL_mutexV(audio->mixer_lock);
   1.149 -    D(bug("SDL_OpenAudio USCITA...\n"));
   1.150 -
   1.151 -#endif
   1.152 -
   1.153      return id+1;
   1.154  }
   1.155  
     2.1 --- a/src/audio/amigaos/SDL_ahiaudio.c	Wed Oct 04 21:39:45 2006 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,360 +0,0 @@
     2.4 -/*
     2.5 -    SDL - Simple DirectMedia Layer
     2.6 -    Copyright (C) 1997-2006 Sam Lantinga
     2.7 -
     2.8 -    This library is free software; you can redistribute it and/or
     2.9 -    modify it under the terms of the GNU Lesser General Public
    2.10 -    License as published by the Free Software Foundation; either
    2.11 -    version 2.1 of the License, or (at your option) any later version.
    2.12 -
    2.13 -    This library is distributed in the hope that it will be useful,
    2.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.16 -    Lesser General Public License for more details.
    2.17 -
    2.18 -    You should have received a copy of the GNU Lesser General Public
    2.19 -    License along with this library; if not, write to the Free Software
    2.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2.21 -
    2.22 -    Sam Lantinga
    2.23 -    slouken@libsdl.org
    2.24 -*/
    2.25 -#include "SDL_config.h"
    2.26 -
    2.27 -/* Allow access to a raw mixing buffer (for AmigaOS) */
    2.28 -
    2.29 -#include "SDL_audio.h"
    2.30 -#include "../SDL_audio_c.h"
    2.31 -#include "SDL_ahiaudio.h"
    2.32 -
    2.33 -/* Audio driver functions */
    2.34 -static int AHI_OpenAudio(_THIS, SDL_AudioSpec * spec);
    2.35 -static void AHI_WaitAudio(_THIS);
    2.36 -static void AHI_PlayAudio(_THIS);
    2.37 -static Uint8 *AHI_GetAudioBuf(_THIS);
    2.38 -static void AHI_CloseAudio(_THIS);
    2.39 -
    2.40 -#ifndef __SASC
    2.41 -#define mymalloc(x) AllocVec(x,MEMF_PUBLIC)
    2.42 -#define myfree FreeVec
    2.43 -#else
    2.44 -#define mymalloc malloc
    2.45 -#define myfree free
    2.46 -#endif
    2.47 -
    2.48 -/* Audio driver bootstrap functions */
    2.49 -
    2.50 -static int
    2.51 -Audio_Available(void)
    2.52 -{
    2.53 -    int ok = 0;
    2.54 -    struct MsgPort *p;
    2.55 -    struct AHIRequest *req;
    2.56 -
    2.57 -    if (p = CreateMsgPort()) {
    2.58 -        if (req =
    2.59 -            (struct AHIRequest *) CreateIORequest(p,
    2.60 -                                                  sizeof(struct
    2.61 -                                                         AHIRequest))) {
    2.62 -            req->ahir_Version = 4;
    2.63 -
    2.64 -            if (!OpenDevice(AHINAME, 0, (struct IORequest *) req, NULL)) {
    2.65 -                D(bug("AHI available.\n"));
    2.66 -                ok = 1;
    2.67 -                CloseDevice((struct IORequest *) req);
    2.68 -            }
    2.69 -            DeleteIORequest((struct IORequest *) req);
    2.70 -        }
    2.71 -        DeleteMsgPort(p);
    2.72 -    }
    2.73 -
    2.74 -    D(if (!ok) bug("AHI not available\n"));
    2.75 -    return ok;
    2.76 -}
    2.77 -
    2.78 -static void
    2.79 -Audio_DeleteDevice(SDL_AudioDevice * device)
    2.80 -{
    2.81 -    SDL_free(device->hidden);
    2.82 -    SDL_free(device);
    2.83 -}
    2.84 -
    2.85 -static SDL_AudioDevice *
    2.86 -Audio_CreateDevice(int devindex)
    2.87 -{
    2.88 -    SDL_AudioDevice *this;
    2.89 -
    2.90 -#ifndef NO_AMIGADEBUG
    2.91 -    D(bug("AHI created...\n"));
    2.92 -#endif
    2.93 -
    2.94 -    /* Initialize all variables that we clean on shutdown */
    2.95 -    this = (SDL_AudioDevice *) SDL_malloc(sizeof(SDL_AudioDevice));
    2.96 -    if (this) {
    2.97 -        SDL_memset(this, 0, (sizeof *this));
    2.98 -        this->hidden = (struct SDL_PrivateAudioData *)
    2.99 -            SDL_malloc((sizeof *this->hidden));
   2.100 -    }
   2.101 -    if ((this == NULL) || (this->hidden == NULL)) {
   2.102 -        SDL_OutOfMemory();
   2.103 -        if (this) {
   2.104 -            SDL_free(this);
   2.105 -        }
   2.106 -        return (0);
   2.107 -    }
   2.108 -    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
   2.109 -
   2.110 -    /* Set the function pointers */
   2.111 -    this->OpenAudio = AHI_OpenAudio;
   2.112 -    this->WaitAudio = AHI_WaitAudio;
   2.113 -    this->PlayAudio = AHI_PlayAudio;
   2.114 -    this->GetAudioBuf = AHI_GetAudioBuf;
   2.115 -    this->CloseAudio = AHI_CloseAudio;
   2.116 -
   2.117 -    this->free = Audio_DeleteDevice;
   2.118 -
   2.119 -    return this;
   2.120 -}
   2.121 -
   2.122 -AudioBootStrap AHI_bootstrap = {
   2.123 -    "AHI", Audio_Available, Audio_CreateDevice
   2.124 -};
   2.125 -
   2.126 -
   2.127 -void static
   2.128 -AHI_WaitAudio(_THIS)
   2.129 -{
   2.130 -    if (!CheckIO((struct IORequest *) audio_req[current_buffer])) {
   2.131 -        WaitIO((struct IORequest *) audio_req[current_buffer]);
   2.132 -//              AbortIO((struct IORequest *)audio_req[current_buffer]);
   2.133 -    }
   2.134 -}
   2.135 -
   2.136 -static void
   2.137 -AHI_PlayAudio(_THIS)
   2.138 -{
   2.139 -    if (playing > 1)
   2.140 -        WaitIO((struct IORequest *) audio_req[current_buffer]);
   2.141 -
   2.142 -    /* Write the audio data out */
   2.143 -    audio_req[current_buffer]->ahir_Std.io_Message.mn_Node.ln_Pri = 60;
   2.144 -    audio_req[current_buffer]->ahir_Std.io_Data = mixbuf[current_buffer];
   2.145 -    audio_req[current_buffer]->ahir_Std.io_Length = this->hidden->size;
   2.146 -    audio_req[current_buffer]->ahir_Std.io_Offset = 0;
   2.147 -    audio_req[current_buffer]->ahir_Std.io_Command = CMD_WRITE;
   2.148 -    audio_req[current_buffer]->ahir_Frequency = this->hidden->freq;
   2.149 -    audio_req[current_buffer]->ahir_Volume = 0x10000;
   2.150 -    audio_req[current_buffer]->ahir_Type = this->hidden->type;
   2.151 -    audio_req[current_buffer]->ahir_Position = 0x8000;
   2.152 -    audio_req[current_buffer]->ahir_Link =
   2.153 -        (playing > 0 ? audio_req[current_buffer ^ 1] : NULL);
   2.154 -
   2.155 -    SendIO((struct IORequest *) audio_req[current_buffer]);
   2.156 -    current_buffer ^= 1;
   2.157 -
   2.158 -    playing++;
   2.159 -}
   2.160 -
   2.161 -static Uint8 *
   2.162 -AHI_GetAudioBuf(_THIS)
   2.163 -{
   2.164 -    return (mixbuf[current_buffer]);
   2.165 -}
   2.166 -
   2.167 -static void
   2.168 -AHI_CloseAudio(_THIS)
   2.169 -{
   2.170 -    D(bug("Closing audio...\n"));
   2.171 -
   2.172 -    playing = 0;
   2.173 -
   2.174 -    if (audio_req[0]) {
   2.175 -        if (audio_req[1]) {
   2.176 -            D(bug("Break req[1]...\n"));
   2.177 -
   2.178 -            AbortIO((struct IORequest *) audio_req[1]);
   2.179 -            WaitIO((struct IORequest *) audio_req[1]);
   2.180 -        }
   2.181 -
   2.182 -        D(bug("Break req[0]...\n"));
   2.183 -
   2.184 -        AbortIO((struct IORequest *) audio_req[0]);
   2.185 -        WaitIO((struct IORequest *) audio_req[0]);
   2.186 -
   2.187 -        if (audio_req[1]) {
   2.188 -            D(bug("Break AGAIN req[1]...\n"));
   2.189 -            AbortIO((struct IORequest *) audio_req[1]);
   2.190 -            WaitIO((struct IORequest *) audio_req[1]);
   2.191 -        }
   2.192 -// Double abort to be sure to break the dbuffering process.
   2.193 -
   2.194 -        SDL_Delay(200);
   2.195 -
   2.196 -        D(bug("Reqs breaked, closing device...\n"));
   2.197 -        CloseDevice((struct IORequest *) audio_req[0]);
   2.198 -        D(bug("Device closed, freeing memory...\n"));
   2.199 -        myfree(audio_req[1]);
   2.200 -        D(bug("Memory freed, deleting IOReq...\n"));
   2.201 -        DeleteIORequest((struct IORequest *) audio_req[0]);
   2.202 -        audio_req[0] = audio_req[1] = NULL;
   2.203 -    }
   2.204 -
   2.205 -    D(bug("Freeing mixbuf[0]...\n"));
   2.206 -    if (mixbuf[0] != NULL) {
   2.207 -        myfree(mixbuf[0]);
   2.208 -//              SDL_FreeAudioMem(mixbuf[0]);
   2.209 -        mixbuf[0] = NULL;
   2.210 -    }
   2.211 -
   2.212 -    D(bug("Freeing mixbuf[1]...\n"));
   2.213 -    if (mixbuf[1] != NULL) {
   2.214 -        myfree(mixbuf[1]);
   2.215 -//              SDL_FreeAudioMem(mixbuf[1]);
   2.216 -        mixbuf[1] = NULL;
   2.217 -    }
   2.218 -
   2.219 -    D(bug("Freeing audio_port...\n"));
   2.220 -
   2.221 -    if (audio_port != NULL) {
   2.222 -        DeleteMsgPort(audio_port);
   2.223 -        audio_port = NULL;
   2.224 -    }
   2.225 -    D(bug("...done!\n"));
   2.226 -}
   2.227 -
   2.228 -static int
   2.229 -AHI_OpenAudio(_THIS, SDL_AudioSpec * spec)
   2.230 -{
   2.231 -//      int width;
   2.232 -    SDL_AudioFormat test_format = SDL_FirstAudioFormat(spec->format);
   2.233 -    int valid_datatype = 1;
   2.234 -
   2.235 -    D(bug("AHI opening...\n"));
   2.236 -
   2.237 -    /* Determine the audio parameters from the AudioSpec */
   2.238 -    while ((!valid_datatype) && (test_format)) {
   2.239 -        valid_datatype = 1;
   2.240 -        switch (test_format) {
   2.241 -        case AUDIO_S8:
   2.242 -            D(bug("AUDIO_S8...\n"));
   2.243 -            spec->format = AUDIO_S8;
   2.244 -            this->hidden->bytespersample = 1;
   2.245 -            if (spec->channels < 2)
   2.246 -                this->hidden->type = AHIST_M8S;
   2.247 -            else
   2.248 -                this->hidden->type = AHIST_S8S;
   2.249 -            break;
   2.250 -
   2.251 -        case AUDIO_S16MSB:
   2.252 -            D(bug("AUDIO_S16MSB...\n"));
   2.253 -            spec->format = AUDIO_S16MSB;
   2.254 -            this->hidden->bytespersample = 2;
   2.255 -            if (spec->channels < 2)
   2.256 -                this->hidden->type = AHIST_M16S;
   2.257 -            else
   2.258 -                this->hidden->type = AHIST_S16S;
   2.259 -            break;
   2.260 -
   2.261 -        case AUDIO_S32MSB:
   2.262 -            D(bug("AUDIO_S32MSB...\n"));
   2.263 -            spec->format = AUDIO_S32MSB;
   2.264 -            this->hidden->bytespersample = 4;
   2.265 -            if (spec->channels < 2)
   2.266 -                this->hidden->type = AHIST_M32S;
   2.267 -            else
   2.268 -                this->hidden->type = AHIST_S32S;
   2.269 -            break;
   2.270 -
   2.271 -        default:
   2.272 -            valid_datatype = 0;
   2.273 -            test_format = SDL_NextAudioFormat();
   2.274 -            break;
   2.275 -        }
   2.276 -    }
   2.277 -
   2.278 -    if (!valid_datatype) {      /* shouldn't happen, but just in case... */
   2.279 -        SDL_SetError("Unsupported audio format");
   2.280 -        return (-1);
   2.281 -    }
   2.282 -
   2.283 -    if (spec->channels > 2) {
   2.284 -        spec->channels = 2;     /* will convert at higher level. */
   2.285 -    }
   2.286 -
   2.287 -    D(bug("Before CalculateAudioSpec\n"));
   2.288 -    /* Update the fragment size as size in bytes */
   2.289 -    SDL_CalculateAudioSpec(spec);
   2.290 -
   2.291 -    D(bug("Before CreateMsgPort\n"));
   2.292 -
   2.293 -    if (!(audio_port = CreateMsgPort())) {
   2.294 -        SDL_SetError("Unable to create a MsgPort");
   2.295 -        return -1;
   2.296 -    }
   2.297 -
   2.298 -    D(bug("Before CreateIORequest\n"));
   2.299 -
   2.300 -    if (!
   2.301 -        (audio_req[0] =
   2.302 -         (struct AHIRequest *) CreateIORequest(audio_port,
   2.303 -                                               sizeof(struct AHIRequest)))) {
   2.304 -        SDL_SetError("Unable to create an AHIRequest");
   2.305 -        DeleteMsgPort(audio_port);
   2.306 -        return -1;
   2.307 -    }
   2.308 -
   2.309 -    audio_req[0]->ahir_Version = 4;
   2.310 -
   2.311 -    if (OpenDevice(AHINAME, 0, (struct IORequest *) audio_req[0], NULL)) {
   2.312 -        SDL_SetError("Unable to open AHI device!\n");
   2.313 -        DeleteIORequest((struct IORequest *) audio_req[0]);
   2.314 -        DeleteMsgPort(audio_port);
   2.315 -        return -1;
   2.316 -    }
   2.317 -
   2.318 -    D(bug("AFTER opendevice\n"));
   2.319 -
   2.320 -    /* Set output frequency and size */
   2.321 -    this->hidden->freq = spec->freq;
   2.322 -    this->hidden->size = spec->size;
   2.323 -
   2.324 -    D(bug("Before buffer allocation\n"));
   2.325 -
   2.326 -    /* Allocate mixing buffer */
   2.327 -    mixbuf[0] = (Uint8 *) mymalloc(spec->size);
   2.328 -    mixbuf[1] = (Uint8 *) mymalloc(spec->size);
   2.329 -
   2.330 -    D(bug("Before audio_req allocation\n"));
   2.331 -
   2.332 -    if (!(audio_req[1] = mymalloc(sizeof(struct AHIRequest)))) {
   2.333 -        SDL_OutOfMemory();
   2.334 -        return (-1);
   2.335 -    }
   2.336 -
   2.337 -    D(bug("Before audio_req memcpy\n"));
   2.338 -
   2.339 -    SDL_memcpy(audio_req[1], audio_req[0], sizeof(struct AHIRequest));
   2.340 -
   2.341 -    if (mixbuf[0] == NULL || mixbuf[1] == NULL) {
   2.342 -        SDL_OutOfMemory();
   2.343 -        return (-1);
   2.344 -    }
   2.345 -
   2.346 -    D(bug("Before mixbuf memset\n"));
   2.347 -
   2.348 -    SDL_memset(mixbuf[0], spec->silence, spec->size);
   2.349 -    SDL_memset(mixbuf[1], spec->silence, spec->size);
   2.350 -
   2.351 -    current_buffer = 0;
   2.352 -    playing = 0;
   2.353 -
   2.354 -    D(bug
   2.355 -      ("AHI opened: freq:%ld mixbuf:%lx/%lx buflen:%ld bits:%ld channels:%ld\n",
   2.356 -       spec->freq, mixbuf[0], mixbuf[1], spec->size,
   2.357 -       this->hidden->bytespersample * 8, spec->channels));
   2.358 -
   2.359 -    /* We're ready to rock and roll. :-) */
   2.360 -    return (0);
   2.361 -}
   2.362 -
   2.363 -/* vi: set ts=4 sw=4 expandtab: */
     3.1 --- a/src/audio/amigaos/SDL_ahiaudio.h	Wed Oct 04 21:39:45 2006 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,62 +0,0 @@
     3.4 -/*
     3.5 -    SDL - Simple DirectMedia Layer
     3.6 -    Copyright (C) 1997-2006 Sam Lantinga
     3.7 -
     3.8 -    This library is free software; you can redistribute it and/or
     3.9 -    modify it under the terms of the GNU Lesser General Public
    3.10 -    License as published by the Free Software Foundation; either
    3.11 -    version 2.1 of the License, or (at your option) any later version.
    3.12 -
    3.13 -    This library is distributed in the hope that it will be useful,
    3.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.16 -    Lesser General Public License for more details.
    3.17 -
    3.18 -    You should have received a copy of the GNU Lesser General Public
    3.19 -    License along with this library; if not, write to the Free Software
    3.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    3.21 -
    3.22 -    Sam Lantinga
    3.23 -    slouken@libsdl.org
    3.24 -*/
    3.25 -#include "SDL_config.h"
    3.26 -
    3.27 -#ifndef _SDL_ahiaudio_h
    3.28 -#define _SDL_ahiaudio_h
    3.29 -
    3.30 -#include <exec/exec.h>
    3.31 -#include <dos/dos.h>
    3.32 -#ifdef __SASC
    3.33 -#include <proto/exec.h>
    3.34 -#else
    3.35 -#include <inline/exec.h>
    3.36 -#endif
    3.37 -
    3.38 -#include <devices/ahi.h>
    3.39 -#include "mydebug.h"
    3.40 -
    3.41 -#include "../SDL_sysaudio.h"
    3.42 -
    3.43 -/* Hidden "this" pointer for the audio functions */
    3.44 -#define _THIS	SDL_AudioDevice *this
    3.45 -
    3.46 -struct SDL_PrivateAudioData
    3.47 -{
    3.48 -    /* The handle for the audio device */
    3.49 -    struct AHIRequest *audio_req[2];
    3.50 -    struct MsgPort *audio_port;
    3.51 -    Sint32 freq, type, bytespersample, size;
    3.52 -    Uint8 *mixbuf[2];           /* The app mixing buffer */
    3.53 -    int current_buffer;
    3.54 -    Uint32 playing;
    3.55 -};
    3.56 -
    3.57 -/* Old variable names */
    3.58 -#define audio_port		(this->hidden->audio_port)
    3.59 -#define audio_req		(this->hidden->audio_req)
    3.60 -#define mixbuf			(this->hidden->mixbuf)
    3.61 -#define current_buffer		(this->hidden->current_buffer)
    3.62 -#define playing			(this->hidden->playing)
    3.63 -
    3.64 -#endif /* _SDL_ahiaudio_h */
    3.65 -/* vi: set ts=4 sw=4 expandtab: */