zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dsound.c File Reference
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
#include <dsound.h>
#include <cguid.h>
#include <mmreg.h>
#include <ks.h>
#include <ksmedia.h>
#include "alMain.h"
#include "alu.h"

Go to the source code of this file.

Macros

#define DirectSoundCaptureCreate   pDirectSoundCaptureCreate
 
#define DirectSoundCaptureEnumerateA   pDirectSoundCaptureEnumerateA
 
#define DirectSoundCreate   pDirectSoundCreate
 
#define DirectSoundEnumerateA   pDirectSoundEnumerateA
 
#define LOAD_FUNC(f)
 
#define MAX_UPDATES   128
 

Functions

void alcDSoundDeinit (void)
 
ALCboolean alcDSoundInit (BackendFuncs *FuncList)
 
void alcDSoundProbe (enum DevProbe type)
 
 DEFINE_GUID (KSDATAFORMAT_SUBTYPE_PCM, 0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
 
 DEFINE_GUID (KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
 
static ALCuint DSoundAvailableSamples (ALCdevice *Device)
 
static ALCenum DSoundCaptureSamples (ALCdevice *Device, ALCvoid *pBuffer, ALCuint lSamples)
 
static void DSoundCloseCapture (ALCdevice *device)
 
static void DSoundClosePlayback (ALCdevice *device)
 
static BOOL CALLBACK DSoundEnumCaptureDevices (LPGUID guid, LPCSTR desc, LPCSTR drvname, LPVOID data)
 
static BOOL CALLBACK DSoundEnumPlaybackDevices (LPGUID guid, LPCSTR desc, LPCSTR drvname, LPVOID data)
 
static ALCboolean DSoundLoad (void)
 
static ALCenum DSoundOpenCapture (ALCdevice *device, const ALCchar *deviceName)
 
static ALCenum DSoundOpenPlayback (ALCdevice *device, const ALCchar *deviceName)
 
static ALuint DSoundPlaybackProc (ALvoid *ptr)
 
static ALCboolean DSoundResetPlayback (ALCdevice *device)
 
static void DSoundStartCapture (ALCdevice *device)
 
static ALCboolean DSoundStartPlayback (ALCdevice *device)
 
static void DSoundStopCapture (ALCdevice *device)
 
static void DSoundStopPlayback (ALCdevice *device)
 
static HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID pcGuidDevice
 

Variables

static DevMap * CaptureDeviceList
 
static voidds_handle
 
static const BackendFuncs DSoundFuncs
 
static ALuint NumCaptureDevices
 
static ALuint NumPlaybackDevices
 
static voidpContext
 
static DevMap * PlaybackDeviceList
 
static IDirectSound ** ppDS
 
static IDirectSoundCapture ** ppDSC
 
static IDirectSound IUnknown * pUnkOuter
 

Macro Definition Documentation

#define DirectSoundCaptureCreate   pDirectSoundCaptureCreate

Definition at line 57 of file dsound.c.

Referenced by DSoundLoad(), and DSoundOpenCapture().

#define DirectSoundCaptureEnumerateA   pDirectSoundCaptureEnumerateA

Definition at line 58 of file dsound.c.

Referenced by alcDSoundProbe(), DSoundLoad(), and DSoundOpenCapture().

#define DirectSoundCreate   pDirectSoundCreate

Definition at line 55 of file dsound.c.

Referenced by DSoundLoad(), and DSoundOpenPlayback().

#define DirectSoundEnumerateA   pDirectSoundEnumerateA

Definition at line 56 of file dsound.c.

Referenced by alcDSoundProbe(), DSoundLoad(), and DSoundOpenPlayback().

#define LOAD_FUNC (   f)
Value:
do { \
p##f = GetSymbol(ds_handle, #f); \
if(p##f == NULL) { \
CloseLib(ds_handle); \
} \
} while(0)
return
Definition: pngrutil.c:1266
#define NULL
Definition: ftobjs.h:61
GLclampf f
Definition: glew.h:3390
if(!yyg->yy_init)
#define ALC_FALSE
Definition: alc.h:81
GLfloat GLfloat p
Definition: glew.h:14938
static void * ds_handle
Definition: dsound.c:49

Referenced by alsa_load(), DSoundLoad(), and pa_load().

#define MAX_UPDATES   128

Definition at line 93 of file dsound.c.

Referenced by DSoundResetPlayback().

Function Documentation

void alcDSoundDeinit ( void  )
ALCboolean alcDSoundInit ( BackendFuncs FuncList)

Definition at line 961 of file dsound.c.

References ALC_FALSE, ALC_TRUE, DSoundFuncs, and DSoundLoad().

DEFINE_GUID ( KSDATAFORMAT_SUBTYPE_PCM  ,
0x00000001  ,
0x0000  ,
0x0010  ,
0x80  ,
0x00  ,
0x00  ,
0xaa  ,
0x00  ,
0x38  ,
0x9b  ,
0x71   
)

OpenAL cross platform audio library Copyright (C) 1999-2007 by authors. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Or go to http://www.gnu.org/copyleft/lgpl.html

DEFINE_GUID ( KSDATAFORMAT_SUBTYPE_IEEE_FLOAT  ,
0x00000003  ,
0x0000  ,
0x0010  ,
0x80  ,
0x00  ,
0x00  ,
0xaa  ,
0x00  ,
0x38  ,
0x9b  ,
0x71   
)
static ALCenum DSoundCaptureSamples ( ALCdevice Device,
ALCvoid pBuffer,
ALCuint  lSamples 
)
static

Definition at line 888 of file dsound.c.

References ALC_NO_ERROR, ALCdevice_struct::ExtraData, and ReadRingBuffer().

static void DSoundCloseCapture ( ALCdevice device)
static

Definition at line 841 of file dsound.c.

References DestroyRingBuffer(), ALCdevice_struct::ExtraData, free, and NULL.

static void DSoundClosePlayback ( ALCdevice device)
static

Definition at line 396 of file dsound.c.

References ALCdevice_struct::ExtraData, free, and NULL.

static BOOL CALLBACK DSoundEnumCaptureDevices ( LPGUID  guid,
LPCSTR  desc,
LPCSTR  drvname,
LPVOID  data 
)
static

Definition at line 174 of file dsound.c.

References CaptureDeviceList, HRESULT(), i, NULL, NumCaptureDevices, realloc, str, strdup(), TRACE, and TRUE.

Referenced by alcDSoundProbe(), and DSoundOpenCapture().

static BOOL CALLBACK DSoundEnumPlaybackDevices ( LPGUID  guid,
LPCSTR  desc,
LPCSTR  drvname,
LPVOID  data 
)
static

Definition at line 124 of file dsound.c.

References HRESULT(), i, NULL, NumPlaybackDevices, PlaybackDeviceList, realloc, str, strdup(), TRACE, and TRUE.

Referenced by alcDSoundProbe(), and DSoundOpenPlayback().

static ALCboolean DSoundLoad ( void  )
static
static ALCenum DSoundOpenCapture ( ALCdevice device,
const ALCchar deviceName 
)
static
static void DSoundStartCapture ( ALCdevice device)
static

Definition at line 862 of file dsound.c.

References aluHandleDisconnect(), ERR, ALCdevice_struct::ExtraData, and HRESULT().

static ALCboolean DSoundStartPlayback ( ALCdevice device)
static
static void DSoundStopCapture ( ALCdevice device)
static

Definition at line 875 of file dsound.c.

References aluHandleDisconnect(), ERR, ALCdevice_struct::ExtraData, and HRESULT().

static void DSoundStopPlayback ( ALCdevice device)
static

Definition at line 640 of file dsound.c.

References ALCdevice_struct::ExtraData, NULL, and StopThread().

Variable Documentation

DevMap* CaptureDeviceList
static
void* ds_handle
static

Definition at line 49 of file dsound.c.

Referenced by alcDSoundDeinit(), and DSoundLoad().

const BackendFuncs DSoundFuncs
static
Initial value:
= {
}
static void DSoundCloseCapture(ALCdevice *device)
Definition: dsound.c:841
static void DSoundStopPlayback(ALCdevice *device)
Definition: dsound.c:640
static ALCenum DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName)
Definition: dsound.c:331
static ALCenum DSoundOpenCapture(ALCdevice *device, const ALCchar *deviceName)
Definition: dsound.c:656
ALint64 ALCdevice_GetLatencyDefault(ALCdevice *device)
Definition: ALc.c:1285
static ALCboolean DSoundResetPlayback(ALCdevice *device)
Definition: dsound.c:416
static ALCboolean DSoundStartPlayback(ALCdevice *device)
Definition: dsound.c:629
static void DSoundStartCapture(ALCdevice *device)
Definition: dsound.c:862
static ALCuint DSoundAvailableSamples(ALCdevice *Device)
Definition: dsound.c:895
void ALCdevice_LockDefault(ALCdevice *device)
Definition: ALc.c:1277
static void DSoundClosePlayback(ALCdevice *device)
Definition: dsound.c:396
static ALCenum DSoundCaptureSamples(ALCdevice *Device, ALCvoid *pBuffer, ALCuint lSamples)
Definition: dsound.c:888
static void DSoundStopCapture(ALCdevice *device)
Definition: dsound.c:875
void ALCdevice_UnlockDefault(ALCdevice *device)
Definition: ALc.c:1281

Definition at line 943 of file dsound.c.

Referenced by alcDSoundInit().

ALuint NumCaptureDevices
static
ALuint NumPlaybackDevices
static
static void * pContext

Definition at line 51 of file dsound.c.

DevMap* PlaybackDeviceList
static
IDirectSound** ppDS

Definition at line 50 of file dsound.c.

IDirectSoundCapture** ppDSC

Definition at line 52 of file dsound.c.

static IDirectSoundCapture IUnknown * pUnkOuter

Definition at line 50 of file dsound.c.