From a5c7901579789970353b794cffe98a722e011423 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Mon, 9 Jul 2007 01:04:33 +0000 Subject: [PATCH] update SOUND_VERSION git-svn-id: svn://kolibrios.org@573 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../develop/sdk/trunk/sound/include/snd.inc | 1 + .../develop/sdk/trunk/sound/include/sound.h | 4 ++- programs/develop/sdk/trunk/sound/src/snd.inc | 1 + .../sdk/trunk/sound/src/sndgetsize.asm | 27 +++++++++++++++++++ programs/media/ac97snd/trunk/sound.h | 5 +++- 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/programs/develop/sdk/trunk/sound/include/snd.inc b/programs/develop/sdk/trunk/sound/include/snd.inc index 265d121982..c8337e83c7 100644 --- a/programs/develop/sdk/trunk/sound/include/snd.inc +++ b/programs/develop/sdk/trunk/sound/include/snd.inc @@ -29,6 +29,7 @@ SND_GETVOLUME equ 13 SND_SETPAN equ 14 SND_GETPAN equ 15 SND_GETBUFFSIZE equ 16 +SND_GETFREESPACE equ 17 DEV_SET_BUFF equ 4 DEV_NOTIFY equ 5 diff --git a/programs/develop/sdk/trunk/sound/include/sound.h b/programs/develop/sdk/trunk/sound/include/sound.h index 430c210e36..48bb53b67b 100644 --- a/programs/develop/sdk/trunk/sound/include/sound.h +++ b/programs/develop/sdk/trunk/sound/include/sound.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define SOUND_VERSION 0x0100 +#define SOUND_VERSION 0x0101 #define PCM_ALL 0 #define PCM_OUT 0x08000000 @@ -70,6 +70,7 @@ extern "C" #define SND_SETPAN 14 #define SND_GETPAN 15 #define SND_GETBUFFSIZE 16 +#define SND_GETFREESPACE 17 #define PLAY_SYNC 0x80000000 @@ -87,6 +88,7 @@ int _stdcall ResetBuffer(SNDBUF hBuff, unsigned int flags); int _stdcall SetBufferPos(SNDBUF hBuff, int offset); int _stdcall GetBufferPos(SNDBUF hBuff, int *offset); int _stdcall GetBufferSize(SNDBUF hBuff, int *size); +int _stdcall GetBufferFree(SNDBUF hBuff, int *free); int _stdcall SetBuffer(SNDBUF hBuff,void* buff, int offs, int size); diff --git a/programs/develop/sdk/trunk/sound/src/snd.inc b/programs/develop/sdk/trunk/sound/src/snd.inc index 265d121982..c8337e83c7 100644 --- a/programs/develop/sdk/trunk/sound/src/snd.inc +++ b/programs/develop/sdk/trunk/sound/src/snd.inc @@ -29,6 +29,7 @@ SND_GETVOLUME equ 13 SND_SETPAN equ 14 SND_GETPAN equ 15 SND_GETBUFFSIZE equ 16 +SND_GETFREESPACE equ 17 DEV_SET_BUFF equ 4 DEV_NOTIFY equ 5 diff --git a/programs/develop/sdk/trunk/sound/src/sndgetsize.asm b/programs/develop/sdk/trunk/sound/src/sndgetsize.asm index 4864c54a6e..0a598b7026 100644 --- a/programs/develop/sdk/trunk/sound/src/sndgetsize.asm +++ b/programs/develop/sdk/trunk/sound/src/sndgetsize.asm @@ -6,6 +6,7 @@ include "proc32.inc" section '.text' align 16 code readable executable public _GetBufferSize@8 +public _GetBufferFree@8 extrn hSound @@ -34,3 +35,29 @@ _GetBufferSize@8: ;str:dword, p_size:dword pop ebx ret 8 +align 4 +_GetBufferFree@8: ;str:dword, p_free:dword + push ebx + push ecx + + lea ebx, [esp+12] ;[stream] + push 0 ;storage for free_space + mov eax, esp + + push 4 ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_GETFREESPACE ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + mov ecx, [esp+20] ; p_free + pop dword [ecx] + pop ecx + pop ebx + ret 8 diff --git a/programs/media/ac97snd/trunk/sound.h b/programs/media/ac97snd/trunk/sound.h index 430c210e36..2a921690e4 100644 --- a/programs/media/ac97snd/trunk/sound.h +++ b/programs/media/ac97snd/trunk/sound.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define SOUND_VERSION 0x0100 +#define SOUND_VERSION 0x0101 #define PCM_ALL 0 #define PCM_OUT 0x08000000 @@ -70,6 +70,8 @@ extern "C" #define SND_SETPAN 14 #define SND_GETPAN 15 #define SND_GETBUFFSIZE 16 +#define SND_GETFREESPACE 17 + #define PLAY_SYNC 0x80000000 @@ -87,6 +89,7 @@ int _stdcall ResetBuffer(SNDBUF hBuff, unsigned int flags); int _stdcall SetBufferPos(SNDBUF hBuff, int offset); int _stdcall GetBufferPos(SNDBUF hBuff, int *offset); int _stdcall GetBufferSize(SNDBUF hBuff, int *size); +int _stdcall GetBufferFree(SNDBUF hBuff, int *free); int _stdcall SetBuffer(SNDBUF hBuff,void* buff, int offs, int size);