Форум: "Media";
Текущий архив: 2006.04.09;
Скачать: [xml.tar.bz2];
ВнизКак изменить значение громкости главного регулятора? Найти похожие ветки
← →
~SaM~ (2005-11-01 23:29) [0]День добрый.
Как изменить значение громкости главного регулятора? а не waveOut.
← →
Eraser © (2005-11-02 01:23) [1]auxSetVolume
← →
~SaM~ (2005-11-02 12:55) [2]auxGetNumDevs у меня 0 возвращает)
← →
Eraser © (2005-11-02 14:11) [3]
> ~SaM~ (02.11.05 12:55) [2]
Ну тогда не морочь голову, а делай через микшер, на этом сайте и на королевстве статьи есть по-моему. Там не очень сложно.
← →
Eraser © (2005-11-02 14:18) [4]http://www.delphimaster.ru/articles/mixer.html
← →
gera (2005-11-03 18:11) [5]unit Unit1;
interface
uses
Messages, Forms, MMSystem, Classes, Buttons, Gauges, Controls;
type
TForm1 = class(TForm)
Gauge1: TGauge;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
procedure MCC(var M:TMessage); message MM_MIXM_CONTROL_CHANGE;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
hmix:Integer;
MCD: TMixerControlDetails;
MCDU: TMixerControlDetails_Unsigned;
implementation
{$R *.dfm}
procedure Vol;
var
MH: HMixer;
ML: TMixerLine;
MLCS: TMixerLineControls;
MLC: TMixerControl;
begin
if mixerOpen(@MH, 0, 0, 0, 0) = MMSYSERR_NOERROR then
begin
ML.cbStruct := SizeOf(TMixerLine);
ML.dwComponentType := MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
if mixerGetLineInfo(MH, @ML, MIXER_OBJECTF_HMIXER or
MIXER_GETLINEINFOF_COMPONENTTYPE) = MMSYSERR_NOERROR then
begin
MLCS.cbStruct := SizeOf(TMixerLineControls);
MLCS.cbmxctrl := SizeOf(TMixerControl);
MLCS.dwLineID := ML.dwLineID;
// MLCS.dwControlType := MIXERCONTROL_CONTROLTYPE_MUTE;
MLCS.dwControlType := MIXERCONTROL_CONTROLTYPE_VOLUME;
MLCS.cControls := 1;
MLCS.pamxctrl := @MLC;
if (mixerGetLineControls(MH, @MLCS, MIXER_OBJECTF_HMIXER or
MIXER_GETLINECONTROLSF_ONEBYTYPE) = MMSYSERR_NOERROR) then
begin
MCD.cbStruct := SizeOf(TMixerControlDetails);
MCD.dwControlID := MLC.dwControlID;
MCD.cChannels := 1;
MCD.cMultipleItems := 0;
MCD.cbDetails := SizeOf(TMixerControlDetails_Unsigned);
MCD.paDetails := @MCDU;
end;
end;
end;
end;
procedure TForm1.MCC(var M:TMessage);
begin
mixerGetControlDetails(hmix, @MCD, MIXER_GETCONTROLDETAILSF_VALUE);
Gauge1.Progress:=MCDU.dwValue
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Vol;
MixerOpen(@hmix, 0, Handle, 0, MIXER_OBJECTF_MIXER or CALLBACK_WINDOW);
Gauge1.MaxValue:=65535;
mixerGetControlDetails(hmix, @MCD, MIXER_GETCONTROLDETAILSF_VALUE);
Gauge1.Progress:=MCDU.dwValue
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
MixerClose(hmix);
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Gauge1.Progress:=Gauge1.Progress-6554;
MCDU.dwValue:= Gauge1.Progress;
MixerSetControlDetails(hmix, @MCD, MIXER_SETCONTROLDETAILSF_VALUE);
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
Gauge1.Progress:=Gauge1.Progress+6554;
MCDU.dwValue:= Gauge1.Progress;
MixerSetControlDetails(hmix, @MCD, MIXER_SETCONTROLDETAILSF_VALUE);
end;
end.
Страницы: 1 вся ветка
Форум: "Media";
Текущий архив: 2006.04.09;
Скачать: [xml.tar.bz2];
Память: 0.46 MB
Время: 0.011 c