Subversion Repositories Kolibri OS

Rev

Rev 359 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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