��ο���ϵͳ�����������ܵ��ÿ�����壿
来源:互联网 发布:ubuntu 16.04 qq2017 编辑:程序博客网 时间:2024/04/25 00:35
���������ȱ�дһ�������������࣬Ȼ���ڴ�����Uses����࣬��������TrackBar���ֱ�Ϊ����������Min:=0;Max=255��������CheckBox�����������Ƿ��������������ͬ������Ȼ���д����Ϳ����ˡ�
// --[Yoyoworks]---------------------------------------------------------------- // �������ƣ�prjPowerFlashPlayer // ������ƣ�iPowerFlashPlayer // ��Ԫ���ߣ����ӽ� // ��ʼ���ڣ�2004��03��14�գ�14:31:16 // ��Ԫ���ܣ����������������ࡣ // -----------------------------------------------------------[SHANGHAi|CHiNA]-- Unit untTVolume; Interface Uses MMSystem, SysUtils; Type TVolume = Class(TObject) Private FVolume: LongInt; //�洢������ FIsMute: Boolean; //�洢����ֵ�� Procedure SetLeftVolume(Volume: Integer); //������������������ Function GetLeftVolume: Integer; //����������������� Procedure SetRightVolume(Volume: Integer); //������������������ Function GetRightVolume: Integer; //����������������� Procedure SetIsMute(IsMute: Boolean); //�����Ƿ���� Public Constructor Create; Destructor Destroy; Override; Published Property LeftVolume: Integer Read GetLeftVolume Write SetLeftVolume; Property RightVolume: Integer Read GetRightVolume Write SetRightVolume; Property Mute: Boolean Read FIsMute Write SetIsMute; End; Implementation // ----------------------------------------------------------------------------- // �������� TVolume.Create // ������ �� // ����ֵ�� �� // ----------------------------------------------------------------------------- Constructor TVolume.Create; Begin Inherited Create; FVolume := 0; FIsMute := False; //��ʼ������ waveOutGetVolume(0, @FVolume); //�õ��������� End; // ----------------------------------------------------------------------------- // �������� TVolume.Destroy // ������ �� // ����ֵ�� �� // ----------------------------------------------------------------------------- Destructor TVolume.Destroy; Begin Inherited Destroy; End; // ----------------------------------------------------------------------------- // �������� TVolume.SetLeftVolume // ������ Volume: Integer // ����ֵ�� �� // ----------------------------------------------------------------------------- Procedure TVolume.SetLeftVolume(Volume: Integer); Begin If (Volume < 0) Or (Volume > 255) Then Raise Exception.Create('Range error of the left channel [0 to 255].'); //�����Volume����������0��255�ķ�Χ����׳��쳣�� If FIsMute = False Then Begin waveOutGetVolume(0, @FVolume); //@ʾָ�����Volume��ָ�루32λ�������ô˺�����������ǵõ���������ֵ�������ڵ�����������ʱ�