Mixer Control API

Draft 1.00

28. November 1997

This is a draft of a real mixer interface for OS/2. With it, it will be possible to access every function of your sound card.

1. Content

Mixer Control API
Subsystem DLL
More Information

2. Mixer Control API (MCAPI.DLL)

2.1. Data Types

PMixerChannel = ^TMixerChannel;
TMixerChannel = record
 Size : LongInt;
 Device : LongInt;
 ID : LongInt;
 ChannelType : LongInt;
 ChannelInfo : LongInt;
 Name : PChar;
end;

DeviceID = LongInt;

2.2. Constants

Channel types:

mix_CT_All      =  0; {Enum all channels}
mix_CT_Settings =  1; {Port, ...}
mix_CT_Volume   =  2; 
mix_CT_Output   =  4;
mix_CT_Input    =  8;
mix_CT_Other    = 16;

Settings info:

mix_SI_Number  =  1; {5..20}
mix_SI_Field   =  2; {5,7,10}
mix_SI_PerCent =  4; {0-100%}
mix_SI_Potency =  8; {0,1,2,4,8}
mix_SI_Flag    = 16; {0,1}

Volume info:

mix_VI_Mono   = 1;
mix_VI_Stereo = 2;

Output info:

mix_OI_Number  =  1;
mix_OI_Field   =  2;
mix_OI_PerCent =  4;
mix_OI_Potency =  8;
mix_OI_Flag    = 16;

Input info:

mix_II_Number  =  1;
mix_II_Field   =  2;
mix_II_PerCent =  4;
mix_II_Potency =  8;
mix_II_Flag    = 16;

Other info:


Priority

mix_Priority_Normal = 1;
mix_Priority_High   = 2;
mix_Priority_Mixer  = 4;

2.3. Functions

Enum devices

Function MixBeginEnumDevice : LongInt;
Function MixEnumNextDevice(Device : LongInt) : LongInt;

Device information

Function GetDeviceNameLen(Device : LongInt) : LongInt;
Function GetDeviceName(Device : LongInt;Buffer : PChar;BufferLen : LongInt) : LongInt;
Function GetDeviceManufacturerLen(Device : LongInt) : LongInt;
Function GetDeviceManufacturer(Device : LongInt;Buffer : PChar;BufferLen : LongInt) : LongInt;
Function GetDeviceVer(Device : LongInt) : LongInt;
Function MixOpenDevice(Device,Priority : LongInt) : DeviceID;
Function MixGetChannelPriority(Device : DeviceID) : LongInt;
Function MixSetChannelPriority(Device : DeviceID;Priority : LongInt) : Bool;
Function MixCopyDevice(Device : DeviceID) : DeviceID;

Enum channels:

Function MixBeginEnumChannels(Device : LongInt;Channel : PMixerChannel;ChannelType : LongInt) : Bool;
Function MixEnumNextChannel(Channel : PMixerChannel) : Bool;
Function MixEndEnumChannels(Channel : PMixerChannel) : Bool);

Functions for all channels

Function MixGetNameLen(Device : DeviceID;ID : LongInt) : LongInt;
Function MixGetName(Device : DeviceID;ID : LongInt;Buffer : PChar;BufferLen : LongInt) : Bool;
Function MixGetIcon(Device : DeviceID;ID : LongInt) : HPointer;
Function MixGetBitmap(Device : DeviceID;ID : LongInt) : HBitmap;
Number/Per cent/Potency/Volume min, max:
Function MixGetNr(Device : DeviceID;ID : LongInt;Lo.Hi : PLongInt) : Bool;
Function MixSetNr(Device : DeviceID;ID : LongInt;Lo,Hi : PLongInt) : Bool;
Field:
Function MixGetFieldSize(Device : DeviceID;ID : LongInt) : LongInt;
Function MixGetField(Device : DeviceID;ID : LongInt;Field : Pointer;FieldSize : LongInt) : Bool;
Function MixSetField(Device : DeviceID;ID : LongInt;Field : Pointer;FieldSize : LongInt) : Bool;
Flag:
Function MixGetFlag(Device : DeviceID;ID : LongInt) : Bool;
Function MixSetFlag(Device : DeviceID;ID : LongInt;Status : Bool) : Bool;
Volume
Function MixGetVolumeL(Device : DeviceID;ID : LongInt) : LongInt;
Function MixGetVolumeR(Device : DeviceID;ID : LongInt) : LongInt;
Function MixGetVolume(Device : DeviceID;ID: LongInt;L,R : PLongInt) : Bool;
Function MixSetVolumeL(Device : DeviceID;ID,L : LongInt) : Bool;
Function MixSetVolumeR(Device : DeviceID;ID,R : LongInt) : Bool;
Function MixSetVolume(Device : DeviceID;ID,L,R : LongInt) : Bool;
Function MixGetVolumeMono(Device : DeviceID;ID : LongInt) : LongInt;
Function MixSetVolumeMono(Device : DeviceID;ID,M : LongInt) : Bool;
Hooks
Function MixRegisterChannelHook(Device : DeviceID;ID : LongInt;Hook : Pointer) : LongInt;
Function MixDeregisterChannelHook(Device : DeviceID;Hook : LongInt) : Bool;
Function MixRegisterDeviceHook(Device : DeviceID;Hook : Pointer) : LongInt;
Function MixDeregisterDeviceHook(Device : DeviceID;Hook : LongInt) : Bool;

3. Subsystem DLL

Not specified in this draft.

4. More Information

Homepage: http://www.datacomm.ch/~cbratschi/

© 1997 by Christoph Bratschi