Next: 7.2 Data types Up: 2 Configurationinitialization and Previous: 2 Configurationinitialization and

# 7.1 Constants

This section describes all constants used in MIDAS initialization and configuration. They are grouped according to the `enum` used to define them.

## 2.1.1 MIDASdsoundModes

    enum MIDASdsoundModes

### Description

These constants are used to describe different MIDAS DirectSound usage modes. By default MIDAS does not use DirectSound at all, and DirectSound usage can be enabled by setting MIDAS_OPTION_DSOUND_MODE. Note that MIDAS_OPTION_DSOUND_HWND needs to be set when using DirectSound. A complete discussion of using DirectSound with MIDAS is available at MIDAS Programmer's Guide.

### Values

MIDAS_DSOUND_DISABLED
  DirectSound usage is disabled
MIDAS_DSOUND_STREAM
  DirectSound is used in stream mode - MIDAS will play to a DirectSound stream buffer. DirectSound usage is disabled if DirectSound runs in emulation mode.
MIDAS_DSOUND_PRIMARY
  DirectSound is used in primary buffer mode if possible - MIDAS will play directly to DirectSound primary buffer. If primary buffer is not available for writing, this mode behaves like MIDAS_DSOUND_STREAM.
MIDAS_DSOUND_FORCE_STREAM
  Behaves like MIDAS_DSOUND_STREAM, except that DirectSound is used always, even in emulation mode.

## 2.1.2 MIDASfilterModes

    enum MIDASfilterModes

### Description

These constants are used to describe different MIDAS output filter modes. By default, MIDAS Digital Audio System will select the most appropriate filter for the mixing mode automatically, but in some cases manually overriding the selection can result in better sound. Also, if all sounds are played exactly at the mixing rate, the output filtering should be disabled to get better sound quality. Finally, filtering is not normally used with high-quality mixing, and is therefore disabled with it by default.

The filter mode can be set by changing the option MIDAS_OPTION_FILTER_MODE with the function MIDASsetOption.

### Values

MIDAS_FILTER_NONE
  No filtering
MIDAS_FILTER_LESS
  Some filtering
MIDAS_FILTER_MORE
  More filtering
MIDAS_FILTER_AUTO
  Automatic filter selection (default)

## 2.1.3 MIDASmixingModes

    enum MIDASmixingModes

### Description

These constants define the different MIDAS Digital Audio System mixing modes available. The high-quality mixing mode yields better sound quality, with virtually no aliasing noise, but uses much more CPU power than normal mixing, and is mainly intended for stand-alone module players and similar applications. By default, MIDAS uses the normal mixing quality.

The mixing mode can be set by changing the option MIDAS_OPTION_MIXING_MODE with the function MIDASsetOption.

### Values

MIDAS_MIX_NORMAL_QUALITY
  Normal quality mixing
MIDAS_MIX_HIGH_QUALITY
  High-quality interpolating mixing

## 2.1.4 MIDASmodes

    enum MIDASmodes

### Description

These constants are used to describe different MIDAS output modes. They are used with the function MIDASsetOption, when changing the setting MIDAS_OPTION_OUTPUTMODE.

### Values

MIDAS_MODE_8BIT_MONO
  8-bit mono output
MIDAS_MODE_16BIT_MONO
  16-bit mono output
MIDAS_MODE_8BIT_STEREO
  8-bit stereo output
MIDAS_MODE_16BIT_STEREO
  16-bit stereo output

## 2.1.5 MIDASoptions

    enum MIDASoptions

### Description

These constants are used with the function MIDASsetOption to change different MIDAS configuration options, and MIDASgetOption to query their current settings.

### Values

MIDAS_OPTION_MIXRATE
  Output mixing rate
MIDAS_OPTION_OUTPUTMODE
  Output mode, see `enum` MIDASmodes
MIDAS_OPTION_MIXBUFLEN
  Mixing buffer length, in milliseconds
MIDAS_OPTION_MIXBUFBLOCKS
  The number of blocks the buffer should be divided into
MIDAS_OPTION_DSOUND_MODE
  DirectSound mode to use, see `enum` MIDASdsoundModes
MIDAS_OPTION_DSOUND_HWND
  Window handle for DirectSound support. The window handle is used by DirectSound to determine which window has the focus. The window handle has to be set when using DirectSound.
MIDAS_OPTION_DSOUND_OBJECT
  The DirectSound object that should be used. Setting this option forces DirectSound support on.
MIDAS_OPTION_DSOUND_BUFLEN
  Output buffer length fot DirectSound, in milliseconds. This option is used instead of MIDAS_OPTION_MIXBUFLEN when using DirectSound without emulation.
MIDAS_OPTION_16BIT_ULAW_AUTOCONVERT
  Controls whether 16-bit samples will be automatically converted to u-law or not. Enabled by default. The autoconversion only applies to Sound Devices which can natively play u-law format data, and will only be used if it results in smaller CPU use.
MIDAS_OPTION_FILTER_MODE
  Output filter mode, see `enum` MIDASfilterModes. The filter is selected automatically by default.
MIDAS_OPTION_MIXING_MODE
  Mixing mode, affects the output sound quality. See `enum` MIDASmixingModes.
MIDAS_OPTION_DEFAULT_STEREO_SEPARATION
  Controls the default stereo separation for modules with no panning information (MODs and old S3Ms). 64 is maximum stereo separation, 0 none. Default 64.
MIDAS_OPTION_FORCE_NO_SOUND
  Forces the No Sound Sound Device to be used for playback. Useful for trying to run MIDAS with no sound if MIDASinit fails.

Next: 7.2 Data types Up: 2 Configurationinitialization and Previous: 2 Configurationinitialization and