ioctl to set mixer volume

Adam D. Ruppe destructionator at gmail.com
Fri Apr 16 17:54:00 UTC 2021


On Friday, 16 April 2021 at 17:50:13 UTC, Alain De Vos wrote:
> The following very simple low level C-function simply sets the 
> mixer volume. How to convert this simple function to dlang ?

```
import core.stdc.config;
import core.sys.posix.sys.ioctl;
void mixer_setlevel_stereo(int mixfd,int dev,int left,int right)
{
left+=256*right;
ioctl(mixfd,
(cast(c_ulong) (((0x80000000UL|0x40000000UL)) | (((int.sizeof) & 
((1 << 13) - 1)) << 16) | ((('M')) << 8) | ((dev)))),
&left);
}
```
something like that it is almost identical


More information about the Digitalmars-d-learn mailing list