Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 368 → Rev 367

/programs/develop/sdk/trunk/sound/include/snd.inc
File deleted
/programs/develop/sdk/trunk/sound/include/sound.h
11,9 → 11,6
 
#define PCM_ALL 0
#define PCM_STATIC 0x80000000
#define PCM_FILTER 0x40000000
#define PCM_FLOAT 0x20000000
 
#define PCM_2_16_48 1
#define PCM_1_16_48 2
#define PCM_2_16_44 3
71,41 → 68,17
int _stdcall DestroyBuffer(SNDBUF hBuff);
int _stdcall SetBuffer(SNDBUF hBuff,void* buff,
int offs, int size);
int _stdcall SetFormat(SNDBUF hBuff, unsigned int format);
int _stdcall ResetBuffer(SNDBUF hBuff, unsigned int flags);
int _stdcall SetBufferPos(SNDBUF hBuff, int offset);
int _stdcall SetVolume(SNDBUF hBuff, int left, int right);
int _stdcall GetVolume(SNDBUF hBuff, int *left, int *right);
int _stdcall SetPan(SNDBUF hBuff, int pan);
int _stdcall WaveOut(SNDBUF hBuff,void *buff, int size);
int _stdcall PlayBuffer(SNDBUF hBuff);
int _stdcall StopBuffer(SNDBUF hBuff);
 
typedef struct
{ unsigned int riff_id;
unsigned int riff_size;
unsigned int riff_format;
int _stdcall GetMasterVol(int* vol);
int _stdcall SetMasterVol(int vol);
 
unsigned int fmt_id;
unsigned int fmt_size;
 
unsigned short int wFormatTag;
unsigned short int nChannels;
unsigned int nSamplesPerSec;
unsigned int nAvgBytesPerSec;
unsigned short int nBlockAlign;
unsigned short int wBitsPerSample;
unsigned int data_id;
unsigned int data_size;
} WAVEHEADER;
 
unsigned int _stdcall test_wav(WAVEHEADER *hdr);
 
#ifdef __cplusplus
extern "C"
}
#endif
 
#endif //_SOUND_H_
#endif //_SOUND_H_
/programs/develop/sdk/trunk/sound/src/sndsetpos.asm
File deleted
/programs/develop/sdk/trunk/sound/src/sndreset.asm
File deleted
/programs/develop/sdk/trunk/sound/src/sndfmt.asm
File deleted
/programs/develop/sdk/trunk/sound/src/sndpan.asm
File deleted
/programs/develop/sdk/trunk/sound/src/wavhdr.asm
File deleted
/programs/develop/sdk/trunk/sound/src/init.asm
26,10 → 26,10
mov ebx, 16
mov ecx, szInfinity
int 0x40
mov [hSound], eax
test eax, eax
jz .fail
mov [hSound], eax
mov eax, 68
mov ebx, 16
mov ecx, szSound
51,8 → 51,6
lea ecx, [handle]
int 0x40
.fail:
 
.done:
pop ecx
pop ebx
ret
/programs/develop/sdk/trunk/sound/src/snd.inc
24,7 → 24,7
SND_OUT equ 9
SND_PLAY equ 10
SND_STOP equ 11
SND_SETPAN equ 12
SND_GETFREESIZE equ 12
 
DEV_SET_BUFF equ 4
DEV_NOTIFY equ 5
/programs/develop/sdk/trunk/sound/src/sndvol.asm
5,81 → 5,12
 
section '.text' align 16 code readable executable
 
public _SetVolume@12
public _GetVolume@12
 
public _GetMasterVol@4
public _SetMasterVol@4
 
extrn hSound
extrn hrdwSound
 
align 4
proc _SetVolume@12 stdcall, str:dword, lvol:dword,rvol:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
xor ecx, ecx
 
mov [handle], eax
mov [io_code], SND_SETVOLUME
mov [input], ebx
mov [inp_size], 12
mov [output], ecx
mov [out_size], ecx
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
align 4
proc _GetVolume@12 stdcall, str:dword, pleft:dword,pright:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
lea ecx, [pleft]
mov [handle], eax
mov [io_code], SND_GETVOLUME
mov [input], ebx
mov [inp_size], 4
mov [output], ecx
mov [out_size], 8
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
align 4
proc _GetMasterVol@4 stdcall, pvol:dword
locals
handle dd ?
/programs/develop/sdk/trunk/sound/src/sound.asm
0,0 → 1,372
format MS COFF
 
include "snd.inc"
include "proc32.inc"
 
section '.text' align 16 code readable executable
 
 
public _InitSound@0
public _CreateBuffer@8
public _DestroyBuffer@4
public _SetBuffer@16
public _WaveOut@12
public _PlayBuffer@4
public _StopBuffer@4
 
public _GetMasterVol@4
public _SetMasterVol@4
 
align 4
proc _InitSound@0
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
 
push ebx
push ecx
mov eax, 68
mov ebx, 16
mov ecx, szInfinity
int 0x40
test eax, eax
jz .fail
mov [hSound], eax
mov eax, 68
mov ebx, 16
mov ecx, szSound
int 0x40
mov [hrdwSound], eax
mov eax, [hSound]
xor ebx, ebx
 
mov [handle], eax
mov [io_code], SRV_GETVERSION
mov [input], ebx
mov [inp_size], ebx
mov [output], ebx
mov [out_size], ebx
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
.fail:
pop ecx
pop ebx
ret
endp
 
 
align 4
proc _CreateBuffer@8 stdcall, format:dword, size:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
 
push ebx
push ecx
mov eax, [hSound]
lea ebx, [format]
xor ecx, ecx
 
mov [handle], eax
mov [io_code], SND_CREATE_BUFF
mov [input], ebx
mov [inp_size], 4
mov [output], ecx
mov [out_size], ecx
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
align 4
proc _DestroyBuffer@4 stdcall, str:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
 
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
xor ecx, ecx
 
mov [handle], eax
mov [io_code], SND_DESTROY_BUFF
mov [input], ebx
mov [inp_size], 4
mov [output], ecx
mov [out_size], ecx
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
 
align 4
proc _SetBuffer@16 stdcall,str:dword, src:dword, offs:dword, size:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
 
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
xor ecx, ecx
 
mov [handle], eax
mov [io_code], SND_SETBUFF
mov [input], ebx
mov [inp_size], 16
mov [output], ecx
mov [out_size], ecx
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
align 4
proc _WaveOut@12 stdcall,str:dword, src:dword, size:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
 
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
xor ecx, ecx
 
mov [handle], eax
mov [io_code], SND_OUT
mov [input], ebx
mov [inp_size], 12
mov [output], ecx
mov [out_size], ecx
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
align 4
proc _PlayBuffer@4 stdcall, str:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
 
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
xor ecx, ecx
 
mov [handle], eax
mov [io_code], SND_PLAY
mov [input], ebx
mov [inp_size], 4
mov [output], ecx
mov [out_size], ecx
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
align 4
proc _StopBuffer@4 stdcall, str:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
 
push ebx
push ecx
mov eax, [hSound]
lea ebx, [str]
xor ecx, ecx
 
mov [handle], eax
mov [io_code], SND_STOP
mov [input], ebx
mov [inp_size], 4
mov [output], ecx
mov [out_size], ecx
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
align 4
proc _GetMasterVol@4 stdcall, pvol:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
push ebx
push ecx
mov eax, [hrdwSound]
mov ecx, [pvol]
xor ebx, ebx
mov [handle], eax
mov [io_code], DEV_GET_MASTERVOL
mov [input], ebx
mov [inp_size], ebx
mov [output], ecx
mov [out_size], 4
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
align 4
proc _SetMasterVol@4 stdcall,vol:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
push ebx
push ecx
mov eax, [hrdwSound]
lea ebx, [vol]
xor ecx, ecx
 
mov [handle], eax
mov [io_code], DEV_SET_MASTERVOL
mov [input], ebx
mov [inp_size], 4
mov [output], ecx
mov [out_size], ecx
 
mov eax, 68
mov ebx, 17
lea ecx, [handle]
int 0x40
pop ecx
pop ebx
ret
endp
 
if 0
align 4
proc _GetDevInfo@8 stdcall, hSrv:dword, p_info:dword
locals
handle dd ?
io_code dd ?
input dd ?
inp_size dd ?
output dd ?
out_size dd ?
endl
push ebx
mov eax, [hSrv]
xor ebx, ebx
mov ecx, [p_info]
 
mov [handle], eax
mov [io_code], DEV_GET_INFO
mov [input], ebx
mov [inp_size], ebx
mov [output], ecx
mov [out_size], CTRL_INFO_SIZE
 
lea eax, [handle]
stdcall CallServiceEx, eax
pop ebx
ret
endp
 
end if
 
section '.data' align 16 data readable writable
 
szInfinity db 'INFINITY',0
szSound db 'SOUND',0
 
align 4
hSound dd ?
hrdwSound dd ?