Annotation of ntddk/src/mmedia/sndblst/driver/sound.h, revision 1.1.1.1

1.1       root        1: /*++ BUILD Version: 0002    // Increment this if a change has global effects
                      2: 
                      3: 
                      4: Copyright (c) 1992  Microsoft Corporation
                      5: 
                      6: Module Name:
                      7: 
                      8:     sound.h
                      9: 
                     10: Abstract:
                     11: 
                     12:     This include file defines constants and types for
                     13:     the Microsoft sound system kernel mode device driver.
                     14: 
                     15: Author:
                     16: 
                     17:     Robin Speed (RobinSp) 20-Oct-92
                     18: 
                     19: Revision History:
                     20: 
                     21: --*/
                     22: 
                     23: #define MIDI
                     24: 
                     25: //
                     26: // Other header files needed to build this driver
                     27: //
                     28: 
                     29: #include <soundlib.h>
                     30: #include <wave.h>
                     31: #include <midi.h>
                     32: #include <string.h>
                     33: #include "hardware.h"
                     34: 
                     35: // #include "vendor.h"
                     36: 
                     37: #define DRIVER_VERSION  0x0100
                     38: 
                     39: //
                     40: // Defaults
                     41: //
                     42: 
                     43: #define DEFAULT_DMA_BUFFERSIZE 4096  // 4K
                     44: 
                     45: //
                     46: // Magic markers
                     47: //
                     48: 
                     49: #define GDI_KEY             (*(ULONG *)"GDI ")
                     50: 
                     51: 
                     52: 
                     53: extern SOUND_DEVICE_INIT DeviceInit[NumberOfDevices];
                     54: 
                     55: 
                     56: typedef struct {
                     57:     ULONG Port;
                     58:     ULONG InterruptNumber;
                     59:     ULONG DmaChannel;
                     60:     ULONG DmaBufferSize;
                     61:     ULONG InputSource;
                     62:     WAVE_DD_VOLUME Volume[NumberOfDevices];
                     63: } SB_CONFIG_DATA, *PSB_CONFIG_DATA;
                     64: 
                     65: //
                     66: // DMA buffer info
                     67: //
                     68: 
                     69: #define DMA_MAX_BUFFER_SIZE 0x10000 // 64k would be nice
                     70: 
                     71: //
                     72: // driver global data structure shared by each device object
                     73: // Note that we have one global spin lock used for all access
                     74: // to both the global data and the local data structures.
                     75: //
                     76: 
                     77: typedef struct _GLOBAL_DEVICE_INFO {
                     78: 
                     79:     // static items not requiring use of the spin lock
                     80: 
                     81:     ULONG           Key;
                     82:     INTERFACE_TYPE  BusType;
                     83:     ULONG           BusNumber;
                     84:     ULONG           InterruptVector;    // int level we are on
                     85:     KIRQL           InterruptRequestLevel;
                     86:     ULONG           InterruptsReceived; // For interrupt verification
                     87: 
                     88:     //
                     89:     // Device access
                     90:     //
                     91: 
                     92:     KMUTEX          DeviceMutex;
                     93:     KMUTEX          MidiMutex;
                     94: 
                     95:     //
                     96:     // Device sharing
                     97:     //
                     98: 
                     99:     UCHAR           Usage;              // Which of wavein, waveout and
                    100:                                         // midi in is in use
                    101:     BOOLEAN         MidiInUse;
                    102: 
                    103:     //
                    104:     // Clean-up info
                    105:     //
                    106: 
                    107:     ULONG           MemType;
                    108: 
                    109:     //
                    110:     // List of our devices
                    111:     //
                    112: 
                    113:     PDEVICE_OBJECT  DeviceObject[       // pointer to input device objects
                    114:                       NumberOfDevices];
                    115:     PDRIVER_OBJECT  DriverObject;       // The actual driver instance
                    116: 
                    117:     //
                    118:     // Generic device type data
                    119:     //
                    120: 
                    121:     WAVE_INFO       WaveInfo;           // Wave input and output data
                    122:     MIDI_INFO       MidiInfo;           // Midi generic input and output
                    123: 
                    124:     //
                    125:     // Data on sampling rate capabilities
                    126:     //
                    127: 
                    128:     ULONG           MinHz;              // Slowest rate
                    129:     ULONG           MaxInHz;            // Fastest input rate
                    130:     ULONG           MaxOutHz;           // Fastest output rate
                    131: 
                    132:     //
                    133:     // Hardware specific data
                    134:     //
                    135: 
                    136:     SOUND_HARDWARE  Hw;                 // Hardware specific stuff
                    137:     BOOLEAN         ProAudioSpectrum;
                    138:     FOUNDINFO       PASInfo;            // Pro Audio Spectrum data
                    139: 
                    140:     //
                    141:     // Registry path saving
                    142:     //
                    143: 
                    144:     PWSTR           RegistryPathName;
                    145: } GLOBAL_DEVICE_INFO, *PGLOBAL_DEVICE_INFO;
                    146: 
                    147: 
                    148: //
                    149: // config.c Configuration routines
                    150: //
                    151: 
                    152: NTSTATUS
                    153: SoundReadConfiguration(
                    154:     IN  PWSTR ValueName,
                    155:     IN  ULONG ValueType,
                    156:     IN  PVOID ValueData,
                    157:     IN  ULONG ValueLength,
                    158:     IN  PVOID Context,
                    159:     IN  PVOID EntryContext
                    160: );
                    161: 
                    162: NTSTATUS
                    163: SoundInitHardwareConfig(
                    164:     IN OUT PGLOBAL_DEVICE_INFO pGDI,
                    165:     IN     PSB_CONFIG_DATA ConfigData
                    166: );
                    167: NTSTATUS
                    168: SoundGetSynthConfig(
                    169:     IN OUT PGLOBAL_DEVICE_INFO pGDI
                    170: );
                    171: NTSTATUS
                    172: SoundSaveConfig(
                    173:     IN  PWSTR DeviceKey,
                    174:     IN  ULONG Port,
                    175:     IN  ULONG DmaChannel,
                    176:     IN  ULONG Interrupt,
                    177:     IN  ULONG InputSource
                    178: );
                    179: VOID
                    180: SoundSaveVolume(
                    181:     PGLOBAL_DEVICE_INFO pGDI
                    182: );
                    183: 
                    184: //
                    185: // isr.c interrupt service routine
                    186: //
                    187: BOOLEAN
                    188: SoundISR(
                    189:     IN    PKINTERRUPT pInterrupt,
                    190:     IN    PVOID Context
                    191: );
                    192: 
                    193: SOUND_DISPATCH_ROUTINE
                    194:     SoundWaveOutGetCaps,
                    195:     SoundWaveInGetCaps,
                    196:     SoundMidiInGetCaps,
                    197:     SoundMidiOutGetCaps,
                    198:     SoundMidiDispatch,
                    199:     SoundAuxGetCaps;
                    200: 
                    201: SOUND_QUERY_FORMAT_ROUTINE SoundQueryFormat;
                    202: 
                    203: //
                    204: // mididisp.c
                    205: //
                    206: 
                    207: 
                    208: VOID
                    209: SoundMidiQuiet(
                    210:     IN    PSOUND_HARDWARE pHw
                    211: );
                    212: NTSTATUS
                    213: SoundSynthPortValid(
                    214:     IN OUT PGLOBAL_DEVICE_INFO pGDI
                    215: );
                    216: 
                    217: //
                    218: // hardware.c
                    219: //
                    220: VOID
                    221: HwInitialize(
                    222:     IN OUT PGLOBAL_DEVICE_INFO pGDI
                    223: );
                    224: VOID
                    225: HwInitVolume(
                    226:     IN     PGLOBAL_DEVICE_INFO pGDI
                    227: );
                    228: 
                    229: //
                    230: // pas.c
                    231: //
                    232: 
                    233: 
                    234: NTSTATUS
                    235: FindPasHardware(
                    236:     PGLOBAL_DEVICE_INFO pGDI,
                    237:     PSB_CONFIG_DATA ConfigData);
                    238: 
                    239: 
                    240: void
                    241: InitPasAndMixer(
                    242:     PFOUNDINFO pFI,
                    243:     PSB_CONFIG_DATA ConfigData
                    244: );
                    245: 
                    246: //
                    247: // mvmix.c
                    248: //
                    249: 
                    250: 
                    251: void SetInput (
                    252:     PFOUNDINFO pFI,
                    253:     UCHAR  P_input_num,
                    254:     USHORT P_volume_lvl,
                    255:     USHORT P_channel,
                    256:     USHORT P_crossover,
                    257:     UCHAR  P_output_num );
                    258: 
                    259: void SetOutput (
                    260:     PFOUNDINFO pFI,
                    261:     UCHAR  P_output_num,
                    262:     USHORT P_volume_lvl,
                    263:     USHORT P_channel );
                    264: 
                    265: void SetFilter(
                    266:     PFOUNDINFO pFI,
                    267:     USHORT wSetting);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.