📄 dmusicc.h
字号:
/************************************************************************
* *
* dmusicc.h -- This module defines the DirectMusic core API's *
* *
* Copyright (c) 1998-1999 Microsoft Corporation
* *
************************************************************************/
#ifndef _DMUSICC_
#define _DMUSICC_
#include <windows.h>
#define COM_NO_WINDOWS_H
#include <objbase.h>
#include <mmsystem.h>
#include "dls1.h"
#include "dmerror.h"
#include "dmdls.h"
#include "dsound.h"
#include "dmusbuff.h"
#include <pshpack8.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef ULONGLONG SAMPLE_TIME;
typedef ULONGLONG SAMPLE_POSITION;
typedef SAMPLE_TIME *LPSAMPLE_TIME;
#define DMUS_MAX_DESCRIPTION 128
#define DMUS_MAX_DRIVER 128
typedef struct _DMUS_BUFFERDESC *LPDMUS_BUFFERDESC;
typedef struct _DMUS_BUFFERDESC
{
DWORD dwSize;
DWORD dwFlags;
GUID guidBufferFormat;
DWORD cbBuffer;
} DMUS_BUFFERDESC;
/* DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS
* and DMUS_PORTPARAMS.
*/
#define DMUS_EFFECT_NONE 0x00000000
#define DMUS_EFFECT_REVERB 0x00000001
#define DMUS_EFFECT_CHORUS 0x00000002
#define DMUS_EFFECT_DELAY 0x00000004
/* For DMUS_PORTCAPS dwClass
*/
#define DMUS_PC_INPUTCLASS (0)
#define DMUS_PC_OUTPUTCLASS (1)
/* For DMUS_PORTCAPS dwFlags
*/
#define DMUS_PC_DLS (0x00000001) // Supports DLS downloading and DLS level 1.
#define DMUS_PC_EXTERNAL (0x00000002) // External MIDI module.
#define DMUS_PC_SOFTWARESYNTH (0x00000004) // Software synthesizer.
#define DMUS_PC_MEMORYSIZEFIXED (0x00000008) // Memory size is fixed.
#define DMUS_PC_GMINHARDWARE (0x00000010) // GM sound set is built in, no need to download.
#define DMUS_PC_GSINHARDWARE (0x00000020) // GS sound set is built in.
#define DMUS_PC_XGINHARDWARE (0x00000040) // XG sound set is built in.
#define DMUS_PC_DIRECTSOUND (0x00000080) // Connects to DirectSound via a DSound buffer.
#define DMUS_PC_SHAREABLE (0x00000100) // Synth can be actively shared by multiple apps at once.
#define DMUS_PC_DLS2 (0x00000200) // Supports DLS2 instruments.
#define DMUS_PC_AUDIOPATH (0x00000400) // Multiple outputs can be connected to DirectSound for audiopaths.
#define DMUS_PC_WAVE (0x00000800) // Supports streaming and one shot waves.
#define DMUS_PC_SYSTEMMEMORY (0x7FFFFFFF) // Sample memory is system memory.
typedef struct _DMUS_PORTCAPS
{
DWORD dwSize;
DWORD dwFlags;
GUID guidPort;
DWORD dwClass;
DWORD dwType;
DWORD dwMemorySize;
DWORD dwMaxChannelGroups;
DWORD dwMaxVoices;
DWORD dwMaxAudioChannels;
DWORD dwEffectFlags;
WCHAR wszDescription[DMUS_MAX_DESCRIPTION];
} DMUS_PORTCAPS;
typedef DMUS_PORTCAPS *LPDMUS_PORTCAPS;
/* Values for DMUS_PORTCAPS dwType. This field indicates the underlying
* driver type of the port.
*/
#define DMUS_PORT_WINMM_DRIVER (0)
#define DMUS_PORT_USER_MODE_SYNTH (1)
#define DMUS_PORT_KERNEL_MODE (2)
/* These flags (set in dwValidParams) indicate which other members of the */
/* DMUS_PORTPARAMS are valid. */
/* */
#define DMUS_PORTPARAMS_VOICES 0x00000001
#define DMUS_PORTPARAMS_CHANNELGROUPS 0x00000002
#define DMUS_PORTPARAMS_AUDIOCHANNELS 0x00000004
#define DMUS_PORTPARAMS_SAMPLERATE 0x00000008
#define DMUS_PORTPARAMS_EFFECTS 0x00000020
#define DMUS_PORTPARAMS_SHARE 0x00000040
#define DMUS_PORTPARAMS_FEATURES 0x00000080 /* DirectX 8.0 and above */
typedef struct _DMUS_PORTPARAMS
{
DWORD dwSize;
DWORD dwValidParams;
DWORD dwVoices;
DWORD dwChannelGroups;
DWORD dwAudioChannels;
DWORD dwSampleRate;
DWORD dwEffectFlags;
BOOL fShare;
} DMUS_PORTPARAMS7;
typedef struct _DMUS_PORTPARAMS8
{
DWORD dwSize;
DWORD dwValidParams;
DWORD dwVoices;
DWORD dwChannelGroups;
DWORD dwAudioChannels;
DWORD dwSampleRate;
DWORD dwEffectFlags;
BOOL fShare;
DWORD dwFeatures;
} DMUS_PORTPARAMS8;
#define DMUS_PORT_FEATURE_AUDIOPATH 0x00000001 /* Supports audiopath connection to DSound buffers. */
#define DMUS_PORT_FEATURE_STREAMING 0x00000002 /* Supports streaming waves through the synth. */
typedef DMUS_PORTPARAMS8 DMUS_PORTPARAMS;
typedef DMUS_PORTPARAMS *LPDMUS_PORTPARAMS;
typedef struct _DMUS_SYNTHSTATS *LPDMUS_SYNTHSTATS;
typedef struct _DMUS_SYNTHSTATS8 *LPDMUS_SYNTHSTATS8;
typedef struct _DMUS_SYNTHSTATS
{
DWORD dwSize; /* Size in bytes of the structure */
DWORD dwValidStats; /* Flags indicating which fields below are valid. */
DWORD dwVoices; /* Average number of voices playing. */
DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */
DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */
DWORD dwLostNotes; /* Number of notes lost in 1 second. */
DWORD dwFreeMemory; /* Free memory in bytes */
long lPeakVolume; /* Decibel level * 100. */
} DMUS_SYNTHSTATS;
typedef struct _DMUS_SYNTHSTATS8
{
DWORD dwSize; /* Size in bytes of the structure */
DWORD dwValidStats; /* Flags indicating which fields below are valid. */
DWORD dwVoices; /* Average number of voices playing. */
DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */
DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */
DWORD dwLostNotes; /* Number of notes lost in 1 second. */
DWORD dwFreeMemory; /* Free memory in bytes */
long lPeakVolume; /* Decibel level * 100. */
DWORD dwSynthMemUse; /* Memory used by synth wave data */
} DMUS_SYNTHSTATS8;
#define DMUS_SYNTHSTATS_VOICES (1 << 0)
#define DMUS_SYNTHSTATS_TOTAL_CPU (1 << 1)
#define DMUS_SYNTHSTATS_CPU_PER_VOICE (1 << 2)
#define DMUS_SYNTHSTATS_LOST_NOTES (1 << 3)
#define DMUS_SYNTHSTATS_PEAK_VOLUME (1 << 4)
#define DMUS_SYNTHSTATS_FREE_MEMORY (1 << 5)
#define DMUS_SYNTHSTATS_SYSTEMMEMORY DMUS_PC_SYSTEMMEMORY
typedef struct _DMUS_WAVES_REVERB_PARAMS
{
float fInGain; /* Input gain in dB (to avoid output overflows) */
float fReverbMix; /* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal)
Negative values gives less wet signal.
The coeficients are calculated so that the overall output level stays
(approximately) constant regardless of the ammount of reverb mix. */
float fReverbTime; /* The reverb decay time, in milliseconds. */
float fHighFreqRTRatio; /* The ratio of the high frequencies to the global reverb time.
Unless very 'splashy-bright' reverbs are wanted, this should be set to
a value < 1.0.
For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the
decay time for high frequencies will be 100ms.*/
} DMUS_WAVES_REVERB_PARAMS;
/* Note: Default values for Reverb are:
fInGain = 0.0dB (no change in level)
fReverbMix = -10.0dB (a reasonable reverb mix)
fReverbTime = 1000.0ms (one second global reverb time)
fHighFreqRTRatio = 0.001 (the ratio of the high frequencies to the global reverb time)
*/
typedef enum
{
DMUS_CLOCK_SYSTEM = 0,
DMUS_CLOCK_WAVE = 1
} DMUS_CLOCKTYPE;
#define DMUS_CLOCKF_GLOBAL 0x00000001
typedef struct _DMUS_CLOCKINFO7 *LPDMUS_CLOCKINFO7;
typedef struct _DMUS_CLOCKINFO7
{
DWORD dwSize;
DMUS_CLOCKTYPE ctType;
GUID guidClock; /* Identifies this time source */
WCHAR wszDescription[DMUS_MAX_DESCRIPTION];
} DMUS_CLOCKINFO7;
typedef struct _DMUS_CLOCKINFO8 *LPDMUS_CLOCKINFO8;
typedef struct _DMUS_CLOCKINFO8
{
DWORD dwSize;
DMUS_CLOCKTYPE ctType;
GUID guidClock; /* Identifies this time source */
WCHAR wszDescription[DMUS_MAX_DESCRIPTION];
DWORD dwFlags;
} DMUS_CLOCKINFO8;
typedef DMUS_CLOCKINFO8 DMUS_CLOCKINFO;
typedef DMUS_CLOCKINFO *LPDMUS_CLOCKINFO;
/* Default bus identifiers
*
* The first 17 are direct mappings to the destinations defined in both
* the MMA DLS Level 2 specification and the Microsoft Multi-Channel audio
* specification.
*/
#define DSBUSID_FIRST_SPKR_LOC 0
#define DSBUSID_FRONT_LEFT 0
#define DSBUSID_LEFT 0 /* Front left is also just left */
#define DSBUSID_FRONT_RIGHT 1
#define DSBUSID_RIGHT 1 /* Ditto front right */
#define DSBUSID_FRONT_CENTER 2
#define DSBUSID_LOW_FREQUENCY 3
#define DSBUSID_BACK_LEFT 4
#define DSBUSID_BACK_RIGHT 5
#define DSBUSID_FRONT_LEFT_OF_CENTER 6
#define DSBUSID_FRONT_RIGHT_OF_CENTER 7
#define DSBUSID_BACK_CENTER 8
#define DSBUSID_SIDE_LEFT 9
#define DSBUSID_SIDE_RIGHT 10
#define DSBUSID_TOP_CENTER 11
#define DSBUSID_TOP_FRONT_LEFT 12
#define DSBUSID_TOP_FRONT_CENTER 13
#define DSBUSID_TOP_FRONT_RIGHT 14
#define DSBUSID_TOP_BACK_LEFT 15
#define DSBUSID_TOP_BACK_CENTER 16
#define DSBUSID_TOP_BACK_RIGHT 17
#define DSBUSID_LAST_SPKR_LOC 17
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -