Einzelnen Beitrag anzeigen

Benutzerbild von Der.Kaktus
Der.Kaktus

Registriert seit: 22. Jan 2008
Ort: Erfurt
958 Beiträge
 
Delphi 7 Enterprise
 
#8

Re: Audiomixer Monitoring EIN/AUS schalten

  Alt 29. Mär 2008, 12:10
Hallo DP'ler,

habe, Dank Wishmaster eine Lösung gefunden. Hier mal der Quelltext..vielleicht braucht es ja mal wer.

[code=delphi]

uses MMSystem;

function GetMonitoring(
Mixer: hMixerObj;
var Control: TMixerControl): MMResult;
// Returns True on success
var
Line: TMixerLine;
Controls: TMixerLineControls;
begin
ZeroMemory(@Line, SizeOf(Line));
Line.cbStruct := SizeOf(Line);
Line.dwComponentType := MIXERLINE_COMPONENTTYPE_SRC_LINE; //LineIN
Result := mixerGetLineInfo(Mixer, @Line,
MIXER_GETLINEINFOF_COMPONENTTYPE);
if Result = MMSYSERR_NOERROR then
begin
ZeroMemory(@Controls, SizeOf(Controls));
Controls.cbStruct := SizeOf(Controls);
Controls.dwLineID := Line.dwLineID;
Controls.cControls := 1;
Controls.dwControlType := MIXERCONTROL_CONTROLTYPE_ONOFF; //checkbox 1 Monitoring unter Erw.
Controls.cbmxctrl := SizeOf(Control);
Controls.pamxctrl := @Control;
Result := mixerGetLineControls(Mixer, @Controls,
MIXER_GETLINECONTROLSF_ONEBYTYPE);
end;
end;

procedure SetMonitoringValue(
Mixer: hMixerObj;
Value: Boolean);
var
Monitoring: TMixerControl;
Details: TMixerControlDetails;
BoolDetails: TMixerControlDetailsBoolean;
Code: MMResult;
begin
Code := GetMonitoring(0, Monitoring);
if Code = MMSYSERR_NOERROR then
begin
with Details do
begin
cbStruct := SizeOf(Details);
dwControlID := Monitoring.dwControlID;
cChannels := 1;
cMultipleItems := 0;
cbDetails := SizeOf(BoolDetails);
paDetails := @BoolDetails;
end;
LongBool(BoolDetails.fValue) := Value;
Code := mixerSetControlDetails(0, @Details,MIXER_SETCONTROLDETAILSF_VALUE);
end;
if Code <> MMSYSERR_NOERROR then
raise Exception.CreateFmt('SetMonitoringValue failure, '+
'multimedia system error #%d',
Code:
);
end;




procedure TForm1.Button1Click(Sender: TObject);
var
  Monitoring: TMixerControl;
  Code: MMResult;
begin
  SetMonitoringValue(0,True);//TRUE=ON FALSE=OFF
end;
Gruss Kaki

Repeat Until true=false;
  Mit Zitat antworten Zitat