1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89:
| RE:TRichedit;
procedure tform1.UpdateList; var c,i,iLine,iCtrl,iCon:integer; h:HMixer; caps:PMixerCaps; Line,Line2:PMixerLine; ctrls:PMixerLineControls; pctrl:PMixerControl; begin c:=mixerGetNumDevs; re.lines.add('DeviceCount: '+inttostr(c));
for i:=0 to c-1 do if mixerOpen(@h,i,0,HInstance,MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR then begin
if mixerGetDevCaps(h,@caps,sizeof(caps)) = MMSYSERR_NOERROR then begin re.lines.add(''); re.lines.add(inttostr(i)+': '+caps.szPname); re.lines.add(' - Driver-Version: '+ inttostr(caps.vDriverVersion) ); re.lines.add(' - Destinations: '+ inttostr(caps.cDestinations) );
for iLine:=0 to caps.cDestinations-1 do begin line.cbStruct:=sizeof(line); line.dwDestination:=iLine; if mixerGetLineInfo(h,@line,MIXER_GETLINEINFOF_DESTINATION) = MMSYSERR_NOERROR then begin
re.lines.add(''); re.lines.add(' - '+inttostr(iLine)+': '+line.szName+' ['+line.szShortName+']'); case line.Target.dwType of mixerline_targettype_aux: re.lines.add(' - TargetType: aux'); mixerline_targettype_midiin: re.lines.add(' - TargetType: midiin'); mixerline_targettype_midiout: re.lines.add(' - TargetType: midiout'); mixerline_targettype_undefined: re.lines.add(' - TargetType: undefined'); mixerline_targettype_wavein: re.lines.add(' - TargetType: wavein'); mixerline_targettype_waveout: re.lines.add(' - TargetType: waveout'); end; re.lines.add(' - Channels: '+inttostr(line.cChannels)); re.lines.add(' - Controls: '+inttostr(line.cControls));
ctrls.cbStruct:=sizeof(ctrls); ctrls.cControls:=line.cControls; ctrls.cbmxctrl:=sizeof(TMixerControl); GetMem(pctrl,SizeOf(TMixerControl)*line.cControls); ctrls.pamxctrl:=pctrl; if mixerGetLineControls(h,@ctrls,MIXER_GETLINECONTROLSF_ALL) = mmsyserr_noerror then for iCtrl:=0 to line.cControls-1 do begin re.lines.add(' - '+inttostr(iCtrl)+': '+pctrl^.szName); inc(pctrl); end; FreeMem(pCtrl);
re.lines.add(' - Connections: '+inttostr(line.cConnections)); line2.cbStruct:=sizeof(TMixerLine); line2.dwDestination:=line.dwDestination; for iCon:=0 to line.cConnections-1 do begin line2.dwSource:=iCon;
if mixerGetLineInfo(h,@line2,MIXER_GETLINEINFOF_SOURCE) = mmsyserr_noerror then begin re.Lines.add(' - '+inttostr(iCon)+': '+line2.szName+' | Channels:'+inttostr(line2.cChannels)+' | Controls:'+inttostr(line2.cControls));
ctrls.cbStruct:=sizeof(ctrls); ctrls.dwLineID:=line2.dwLineID; ctrls.cControls:=line2.cControls; ctrls.cbmxctrl:=sizeof(TMixerControl); GetMem(pctrl,sizeof(tmixercontrol)*line2.cControls); ctrls.pamxctrl:=pctrl; if mixerGetLineControls(h,@ctrls,MIXER_GETLINECONTROLSF_ALL) = mmsyserr_noerror then for iCtrl:=0 to ctrls.cControls-1 do begin re.lines.add(' - '+inttostr(iCtrl)+': '+pctrl^.szName); inc(pctrl); end; FreeMem(pctrl);
end; end; end; end; end;
mixerClose(h); end; end; |