Subversion Repositories Kolibri OS

Rev

Rev 359 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
359 serge 1
format MS COFF
2
 
3
include "snd.inc"
4
include "proc32.inc"
5
 
6
section '.text' align 16 code readable executable
7
 
368 serge 8
public _SetVolume@12
9
public _GetVolume@12
10
 
359 serge 11
public _GetMasterVol@4
12
public _SetMasterVol@4
13
 
368 serge 14
extrn hSound
359 serge 15
extrn hrdwSound
16
 
17
align 4
368 serge 18
proc _SetVolume@12 stdcall, str:dword, lvol:dword,rvol:dword
19
           locals
20
             handle     dd ?
21
             io_code    dd ?
22
             input      dd ?
23
             inp_size   dd ?
24
             output     dd ?
25
             out_size   dd ?
26
           endl
27
 
28
           push ebx
29
           push ecx
30
           mov eax, [hSound]
31
           lea ebx, [str]
32
           xor ecx, ecx
33
 
34
           mov [handle], eax
35
           mov [io_code], SND_SETVOLUME
36
           mov [input], ebx
37
           mov [inp_size], 12
38
           mov [output], ecx
39
           mov [out_size], ecx
40
 
41
           mov eax, 68
42
           mov ebx, 17
43
           lea ecx, [handle]
44
           int 0x40
45
           pop ecx
46
           pop ebx
47
           ret
48
endp
49
 
50
align 4
51
proc _GetVolume@12 stdcall, str:dword, pleft:dword,pright:dword
52
           locals
53
             handle     dd ?
54
             io_code    dd ?
55
             input      dd ?
56
             inp_size   dd ?
57
             output     dd ?
58
             out_size   dd ?
59
           endl
60
 
61
           push ebx
62
           push ecx
63
           mov eax, [hSound]
64
           lea ebx, [str]
65
           lea ecx, [pleft]
66
           mov [handle], eax
67
           mov [io_code], SND_GETVOLUME
68
           mov [input], ebx
69
           mov [inp_size], 4
70
           mov [output], ecx
71
           mov [out_size], 8
72
 
73
           mov eax, 68
74
           mov ebx, 17
75
           lea ecx, [handle]
76
           int 0x40
77
           pop ecx
78
           pop ebx
79
           ret
80
endp
81
 
82
align 4
359 serge 83
proc _GetMasterVol@4 stdcall, pvol:dword
84
           locals
85
             handle     dd ?
86
             io_code    dd ?
87
             input      dd ?
88
             inp_size   dd ?
89
             output     dd ?
90
             out_size   dd ?
91
           endl
92
 
93
           push ebx
94
           push ecx
95
           mov eax, [hrdwSound]
96
           mov ecx, [pvol]
97
           xor ebx, ebx
98
           mov [handle], eax
99
           mov [io_code], DEV_GET_MASTERVOL
100
           mov [input], ebx
101
           mov [inp_size], ebx
102
           mov [output], ecx
103
           mov [out_size], 4
104
 
105
           mov eax, 68
106
           mov ebx, 17
107
           lea ecx, [handle]
108
           int 0x40
109
           pop ecx
110
           pop ebx
111
           ret
112
endp
113
 
114
align 4
115
proc _SetMasterVol@4 stdcall,vol:dword
116
           locals
117
             handle     dd ?
118
             io_code    dd ?
119
             input      dd ?
120
             inp_size   dd ?
121
             output     dd ?
122
             out_size   dd ?
123
           endl
124
 
125
           push ebx
126
           push ecx
127
           mov eax, [hrdwSound]
128
           lea ebx, [vol]
129
           xor ecx, ecx
130
 
131
           mov [handle], eax
132
           mov [io_code], DEV_SET_MASTERVOL
133
           mov [input], ebx
134
           mov [inp_size], 4
135
           mov [output], ecx
136
           mov [out_size], ecx
137
 
138
           mov eax, 68
139
           mov ebx, 17
140
           lea ecx, [handle]
141
           int 0x40
142
           pop ecx
143
           pop ebx
144
           ret
145
endp
146
 
147
if 0
148
align 4
149
proc _GetDevInfo@8 stdcall, hSrv:dword, p_info:dword
150
           locals
151
             handle     dd ?
152
             io_code    dd ?
153
             input      dd ?
154
             inp_size   dd ?
155
             output     dd ?
156
             out_size   dd ?
157
           endl
158
 
159
           push ebx
160
           mov eax, [hSrv]
161
           xor ebx, ebx
162
           mov ecx, [p_info]
163
 
164
           mov [handle], eax
165
           mov [io_code], DEV_GET_INFO
166
           mov [input], ebx
167
           mov [inp_size], ebx
168
           mov [output], ecx
169
           mov [out_size], CTRL_INFO_SIZE
170
 
171
           lea eax, [handle]
172
           stdcall CallServiceEx, eax
173
           pop ebx
174
           ret
175
endp
176
 
177
end if