src/audio/dummy/SDL_dummyaudio.c
author Ryan C. Gordon
Fri, 06 Oct 2006 04:46:58 +0000
branchSDL-ryan-multiple-audio-device
changeset 3816 9d070c1a45fa
parent 3811 d980c4dcad0f
child 3846 66fb40445587
permissions -rw-r--r--
Moved AudioBootstrap section in converted drivers to bottom of source, so I
could delete the predeclarations (one more thing to forget to update when
changing the API, otherwise). There're a few other cleanups that snuck into
this commit, too.
icculus@1532
     1
/*
icculus@1532
     2
    SDL - Simple DirectMedia Layer
icculus@1532
     3
    Copyright (C) 1997-2006 Sam Lantinga
icculus@1532
     4
icculus@1532
     5
    This library is free software; you can redistribute it and/or
icculus@1532
     6
    modify it under the terms of the GNU Lesser General Public
icculus@1532
     7
    License as published by the Free Software Foundation; either
icculus@1532
     8
    version 2.1 of the License, or (at your option) any later version.
icculus@1532
     9
icculus@1532
    10
    This library is distributed in the hope that it will be useful,
icculus@1532
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
icculus@1532
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
icculus@1532
    13
    Lesser General Public License for more details.
icculus@1532
    14
icculus@1532
    15
    You should have received a copy of the GNU Lesser General Public
icculus@1532
    16
    License along with this library; if not, write to the Free Software
icculus@1532
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
icculus@1532
    18
icculus@1532
    19
    Sam Lantinga
icculus@1532
    20
    slouken@libsdl.org
icculus@1532
    21
icculus@1537
    22
    This file written by Ryan C. Gordon (icculus@icculus.org)
icculus@1532
    23
*/
icculus@1532
    24
#include "SDL_config.h"
icculus@1532
    25
slouken@1533
    26
/* Output audio to nowhere... */
icculus@1532
    27
icculus@1532
    28
#include "SDL_rwops.h"
icculus@1532
    29
#include "SDL_timer.h"
icculus@1532
    30
#include "SDL_audio.h"
icculus@1532
    31
#include "../SDL_audiomem.h"
icculus@1532
    32
#include "../SDL_audio_c.h"
icculus@1532
    33
#include "SDL_dummyaudio.h"
icculus@1532
    34
icculus@1532
    35
/* The tag name used by DUMMY audio */
icculus@1532
    36
#define DUMMYAUD_DRIVER_NAME         "dummy"
icculus@1532
    37
slouken@1895
    38
static int
slouken@1895
    39
DUMMYAUD_Available(void)
icculus@1532
    40
{
icculus@3798
    41
    return 1;  /* always available. */
icculus@1532
    42
}
icculus@1532
    43
icculus@3784
    44
static int
icculus@3816
    45
DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture)
icculus@3816
    46
{
icculus@3816
    47
    return 1;   /* always succeeds. */
icculus@3816
    48
}
icculus@3816
    49
icculus@3816
    50
icculus@3816
    51
static int
icculus@3784
    52
DUMMYAUD_Init(SDL_AudioDriverImpl *impl)
icculus@1532
    53
{
icculus@3784
    54
    /* Set the function pointers */
icculus@3792
    55
    impl->OpenDevice = DUMMYAUD_OpenDevice;
icculus@3796
    56
    impl->OnlyHasDefaultOutputDevice = 1;
icculus@1532
    57
icculus@3784
    58
    return 1;
icculus@1532
    59
}
icculus@1532
    60
icculus@1532
    61
AudioBootStrap DUMMYAUD_bootstrap = {
slouken@1895
    62
    DUMMYAUD_DRIVER_NAME, "SDL dummy audio driver",
icculus@3798
    63
    DUMMYAUD_Available, DUMMYAUD_Init, 1
icculus@1532
    64
};
icculus@1532
    65
slouken@1895
    66
/* vi: set ts=4 sw=4 expandtab: */