Ok, ich habs jetzt rausgefunden!!!
Leider funkioniert es noch nicht so ganz wie es sollte
Die Funktion ergibt immer den Wert 0, egal wo der Switch (Kreuzchen) gesetzt ist...
Hier der Source-Code:
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: 90: 91:
| function GetRecorderDevice: Integer;
function Error(ResultA: Cardinal; const FunctionA: String = ''): Boolean; begin If ResultA <> 0 then begin Result := False; If FunctionA <> '' then raise Exception.CreateFmt('ERROR: [%s] returns [%d]!', [FunctionA, ResultA]) else raise Exception.CreateFmt('Error as a undefinied function!', []); end else Result := True; end;
var MixId: Cardinal; MixHandle: HMixer; DesFound: Boolean;
Destination: TMixerLine;
Caps: TMixerCaps; MixerControls: TMixerLineControls; Controls: array[0..9] of TMixerControl; Values: TMixerControlDetails; ValueMute: array[0..1] of MIXERCONTROLDETAILS_BOOLEAN;
i: Cardinal;
Ret: MMResult; begin MixId := 0; Ret := mixerOpen(@MixHandle, MixId, 0, 0, 0); Error(Ret);
Ret := mixerGetDevCaps(MixHandle, @Caps, SizeOf(Caps)); Error(Ret);
DesFound := False; for i := 0 to Caps.cDestinations do begin DesFound := False; Destination.cbStruct := SizeOf(Destination); Destination.dwDestination := i; Destination.dwSource := 0; Ret := mixerGetLineInfo(MixHandle, @Destination, MIXER_GETLINEINFOF_DESTINATION); Error(Ret); If Destination.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN then begin DesFound := True; Break; end; end; If DesFound = False then Error(1);
MixerControls.cbStruct := SizeOf(MixerControls); MixerControls.cControls := 10; MixerControls.cbmxctrl := SizeOf(TMixerControl); MixerControls.pamxctrl := @Controls; MixerControls.dwLineID := Destination.dwLineID;
Ret := mixerGetLineControls(MixHandle, @MixerControls, MIXER_GETLINECONTROLSF_ALL); Error(Ret);
i := 0; while Controls[i].dwControlType <> MIXERCONTROL_CONTROLTYPE_MUX do begin If i > 100 then begin Error(1); end; i := i +1; end;
Values.cbStruct := SizeOf(Values); Values.dwControlID := Controls[i].dwControlID; Values.cChannels := Destination.cChannels; Values.cMultipleItems := Controls[i].cMultipleItems; Values.cbDetails := SizeOf(ValueMute); Values.paDetails := @ValueMute;
Ret := mixerGetControlDetails(MixHandle, @Values, MIXER_GETCONTROLDETAILSF_VALUE); Error(Ret);
Result := ValueMute[1].fValue;
Ret := mixerClose(MixHandle); Error(Ret); end; |
Hat irgendwer ne ahnung, wieso da der Wert 0 zurückkommt??
MfG Syngel Kid