亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? amixer.pas

?? delphi 多媒體聲音控制控件 AMixer
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
unit AMixer;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  MMSystem;

(*
 * TAudioMixer v1.15 (FREEWARE component)
 * -----------------
 * Released 17 May 1999
 *
 * This component can cache data from audio mixer. It has direct support for
 * getting/setting volume of any control (It can set also set state of that
 * "Selected" CheckBox in standard Windows Volume Control program). You can
 * better use other features of mixer, but that's more difficult than volume
 * setting and you must know something about audio mixer.
 *
 * The mixer has following structure (as it is in this component) :
 *
 * Destinations (destinations should be for example: Playback, Recording and Voice commands)
 *   |
 *   |--Destination[0]        (if you want to get volume of this call GeVolume (<ThisDestinationNum>,-1,...))
 *   |    |                                                                          (=0)           ----
 *   |    |--Data:TMixerLine
 *   |    |--Controls         (controls of the line, ex: Master volume, master mute)
 *   |    |    |
 *   |    |    |--Control[0]
 *   |    |    |--Control[1]
 *   |    |    |--Control[..]
 *   |    |
 *   |    |--Connections      (ex: Wave, MIDI, CD Audio, Line-In,...)
 *   |         |
 *   |         |--Connection[0]   (GetVolume (<ThisDestinationNum>,<ThisConnectionNumb>,...))
 *   |         |    |                               (=0)                 (=0)
 *   |         |    |--Data:TMixerLine
 *   |         |    |--Controls   (here can be volume and mute)
 *   |         |         |
 *   |         |         |--Control[0]
 *   |         |         |--Control[1]
 *   |         |         |--Control[..]
 *   |         |
 *   |         |--Connection[1]
 *   |         |--Connection[..]
 *   |
 *   |--Destination[1]
 *   |--Destination[..]
 *
 *
 * There are many types of controls - checkbox, list, slider,... they are
 * described in Windows help. Common ones are volume slider, mute checkbox or
 * volume meter.
 *
 * This component is universal, so you can work with all controls through it,
 * but this is difficult. You can simply get/set volume level by procedures
 * GetVolume or SetVolume (description is near their declaration; use - see
 * example program).
 *
 *
 * What's New
 * ----------
 * 1.15 (17 May 1999)
 *      - corrected "Windows couldn't be shut down while TAudioMixer is being used" problem
 *            (many thanks to Jean Carlo Solis Ubago, who fixed this)
 *      - added example showing how to set bass / treble
 * 1.12 (24 Mar 1999)
 *      - corrected setting "selected" state
 * 1.11 (4 Jan 1999)
 *      - now it supports also MIXERCONTROL_CONTROLTYPE_MUX flag
 *        (I got SB Live! for Christmas (:-)) and my component didn't work
 *         properly, this corrects that problem)
 * 1.1  (16 Nov 1998)
 *      - made compatible with Delphi 4
 *      - corrected memory leaks (by Ishida Wataru)
 *      - some another minor changes (by Ishida Wataru)
 *      - added another example
 *      - added AMixer.dcr
 * 1.0  (18 Aug 1998)
 *      - initial version
 *
 *
 * You can use this component freely in your programs. But if you do so, please
 * send me an e-mail. I would like to know if it is useful.
 *
 * (C) Vit Kovalcik
 *
 * e-mail: vkovalcik@iname.com
 * WWW: http://www.geocities.com/SiliconValley/Hills/1335/
 *)

{Note:
  When no mixer is present TAudioMixer.Destinations will be nil.
  If you then check Destinations.Count it will raise exception,
  so be sure to check TAudioMixer.MixerCount first.}

type
  TAudioMixer=class;

  TPListFreeItemNotify=procedure (Pntr:Pointer) of object;
  TMixerChange=procedure (Sender:TObject;MixerH:HMixer;ID:Integer) of object;
    {MixerH is handle of mixer, which sent this message.
     ID is ID of changed item (line or control).}

  TPointerList=class(TObject)
  private
    FOnFreeItem:TPListFreeItemNotify;
    Items:Tlist;
  protected
    function GetPointer (Ind:Integer):Pointer;
    function GetCount :integer;
  public
    constructor Create;
    destructor Destroy; override;
    procedure Clear;
    procedure Add (Pntr:Pointer);
    property Count:Integer read GetCount;
    property Pointer[Ind:Integer]:Pointer read GetPointer; default;
    property OnFreeItem:TPListFreeItemNotify read FOnFreeItem write FOnFreeItem;  end;

  TMixerControls=class(TObject)
  private
    heap:pointer;
    FControls:TPointerList;
  protected
    function GetControl (Ind:Integer):PMixerControl;
    function GetCount:Integer;
  public
    constructor Create (AMixer:TAudioMixer;AData:TMixerLine);
    destructor Destroy; override;
    property Control[Ind:Integer]:PMixerControl read GetControl; default;
    property Count:Integer read GetCount;
  end;

  TMixerConnection=class(TObject)
  private
    XMixer:TAudioMixer;
    FData:TMixerLine;
    FControls:TMixerControls;
  public
    constructor Create (AMixer:TAudioMixer;AData:TMixerLine);
    destructor Destroy; override;
    property Controls:TMixerControls read FControls;
    property Data:TMixerLine read FData;
  end;

  TMixerConnections=class(TObject)
  private
    XMixer:TAudioMixer;
    FConnections:TPointerList;
  protected
    procedure DoFreeItem (Pntr:Pointer);
    function GetConnection (Ind:Integer):TMixerConnection;
    function GetCount:Integer;
  public
    constructor Create (AMixer:TAudioMixer;AData:TMixerLine);
    destructor Destroy; override;
    property Connection[Ind:Integer]:TMixerConnection read GetConnection; default;
    property Count:Integer read GetCount;
  end;

  TMixerDestination=class(TObject)
  private
    XMixer:TAudioMixer;
    FData:TMixerLine;
    FControls:TMixerControls;
    FConnections:TMixerConnections;
  public
    constructor Create (AMixer:TAudioMixer;AData:TMixerLine);
    destructor Destroy; override;
    property Connections:TMixerConnections read FConnections;
    property Controls:TMixerControls read FControls;
    property Data:TMixerLine read FData;
  end;

  TMixerDestinations=class(TObject)
  private
    FDestinations:TPointerList;
  protected
    function GetDestination (Ind:Integer):TMixerDestination;
    procedure DoFreeItem (Pntr:Pointer);
    function GetCount:Integer;
  public
    constructor Create (AMixer:TAudioMixer);
    destructor Destroy; override;
    property Count:Integer read GetCount;
    property Destination[Ind:Integer]:TMixerDestination read GetDestination; default;
  end;

  TAudioMixer = class(TComponent)
  private
    XWndHandle:HWnd;

    FDestinations:TMixerDestinations;
    FMixersCount:Integer;
    FMixerHandle:HMixer;
    FMixerID:Integer;
    FMixerCaps:TMixerCaps;
    FOnLineChange:TMixerChange;
    FOnControlChange:TMixerChange;
  protected
    procedure SetMixerID (Value:Integer);
    procedure MixerCallBack (var Msg:TMessage);
    procedure CloseMixer;
  published
    constructor Create (AOwner:TComponent); override;
    destructor Destroy; override;
    property MixerID:Integer read FMixerID write SetMixerID;
      {Opened mixer - value must be in range 0..MixersCount-1
       If no mixer is opened this value is  -1}
    property OnLineChange:TMixerChange read FOnLineChange write FOnLineChange;
    property OnControlChange:TMixerChange read FOnControlChange write FOnControlChange;
  public
    function GetVolume (ADestination,AConnection:Integer;var LeftVol,RightVol,Mute:Integer;var VolDisabled,MuteDisabled:Boolean):Boolean;
      {This function return volume of selected Destination and Connection.
       ADestination must be from range 0..Destinations.Count-1
       AConnection must be in range 0..Destinations[ADestination].Connections.Count-1
       If you want to read master volume of some Destination, you have to
         set AConnection to -1.
       If LeftVol, RightVol or Mute is not supported by queried connection,
         it's return value will be -1.

       LeftVol and RightVol are in range 0..65536

       If Mute is non-zero then the connection is silent.
       If specified line is recording source then Mute specifies if programs will
         record from this connection (it is copy of "Select" Checkbox in
         standard Windows Volume Control program)
       VolDisabled or MuteDisabled is True when you cannot apply settings to this
         control (but can read it).

       Return value of the function is True if no error has occured,
         otherwise it returns False.}
    function SetVolume (ADestination,AConnection:Integer;LeftVol,RightVol,Mute:Integer):Boolean;
      {This function sets volume.
       If you set RightVol to -1 and connection is stereo then LeftVol will be
       copied to RightVol.
       If LeftVol or Mute is -1 then this value will not be set.

       Return value is True if ADestination and AConnection ar correct, otherwise False.}
    property Destinations:TMixerDestinations read FDestinations;
      {Ind must be in range 0..DestinationsCount-1}
    property MixerCaps:TMixerCaps read FMixerCaps;
    property MixerCount:Integer read FMixersCount;
      {Number of mixers present in system; mostly 1}
    property MixerHandle:HMixer read FMixerHandle;
      {Handle of opened mixer}
  end;

procedure Register;

implementation

{------------}
{TPointerList}
{------------}

constructor TPointerList.Create;
begin
  Items:=TList.Create;
end;

destructor TPointerList.Destroy;
begin
  Clear;
  Items.Free;
end;

procedure TPointerList.Add (Pntr:Pointer);
begin
  Items.Add(Pntr);
end;

function TPointerList.GetPointer (Ind:Integer):Pointer;
begin
  Result:=Items[Ind];
end;

procedure TPointerList.Clear;
var I:Integer;
begin
  for I:=0 to Items.Count-1 do begin
    If Assigned (FOnFreeItem) then
      FOnFreeItem (Items[I])
  end;
  Items.Clear;
end;

function TPointerList.GetCount:Integer;
begin
  Result:=Items.Count;
end;

{--------------}
{TMixerControls}
{--------------}

constructor TMixerControls.Create (AMixer:TAudioMixer;AData:TMixerLine);
var MLC:TMixerLineControls;
    A,B:Integer;
    P:PMixerControl;
begin
  FControls:=TPointerList.Create;
  MLC.cbStruct:=SizeOf(MLC);
  MLC.dwLineID:=AData.dwLineID;
  MLC.cControls:=AData.cControls;
  MLC.cbmxctrl:=SizeOf(TMixerControl);
  GetMem (P,SizeOf(TMixerControl)*AData.cControls);
  heap:=P;
  MLC.pamxctrl:=P;
  A:=MixerGetLineControls(AMixer.MixerHandle,@MLC, MIXER_GETLINECONTROLSF_ALL);
  If A=MMSYSERR_NOERROR then
  begin
    For B:=0 to AData.cControls-1 do
    begin
      FControls.Add (P);
      Inc (P);
    end;
  end;
end;

destructor TMixerControls.Destroy;
begin
  FControls.free;
  freemem(heap);
  inherited;
end;

function TMixerControls.GetControl (Ind:Integer):PMixerControl;
begin
  Result:=FControls.Pointer[Ind];
end;

function TMixerControls.GetCount:Integer;
begin
  Result:=FControls.Count;
end;

{----------------}
{TMixerConnection}
{----------------}

constructor TMixerConnection.Create (AMixer:TAudioMixer;AData:TMixerLine);
begin
  FData:=AData;
  XMixer:=AMixer;
  FControls:=TMixerControls.Create (AMixer,AData);
end;

destructor TMixerConnection.Destroy;
begin
  FControls.Free;
  inherited;
end;

{-----------------}
{TMixerConnections}
{-----------------}

constructor TMixerConnections.Create (AMixer:TAudioMixer;AData:TMixerLine);
var A,B:Integer;
    ML:TMixerLine;
begin
  XMixer:=AMixer;
  FConnections:=TPointerList.Create;
  FConnections.OnFreeItem:=Dofreeitem;
  ML.cbStruct:=SizeOf(TMixerLine);
  ML.dwDestination:=AData.dwDestination;
  For A:=0 to AData.cConnections-1 do
  begin
    ML.dwSource:=A;
    B:=MixerGetLineInfo (AMixer.MixerHandle,@ML,MIXER_GETLINEINFOF_SOURCE);
    If B=MMSYSERR_NOERROR then
      FConnections.Add(Pointer(TMixerConnection.Create (XMixer,ML)));
  end;
end;

destructor TMixerConnections.Destroy;
begin
  FConnections.Free;
  inherited;
end;

procedure TMixerConnections.DoFreeItem (Pntr:Pointer);
begin
  TMixerConnection(Pntr).Free;
end;

function TMixerConnections.GetConnection (Ind:Integer):TMixerConnection;
begin
  Result:=FConnections.Pointer[Ind];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人av资源| 伦理电影国产精品| 国产欧美精品在线观看| 日韩一区二区三区观看| 欧美日韩一区视频| 欧美性猛片aaaaaaa做受| 欧美天堂一区二区三区| 欧美色偷偷大香| 欧美精品色综合| 欧美一级高清片| 精品精品国产高清a毛片牛牛| 欧美一级日韩免费不卡| 精品裸体舞一区二区三区| 精品国产1区二区| 国产日产亚洲精品系列| 国产精品久久久久久久久果冻传媒 | 日韩免费高清av| 久久综合久色欧美综合狠狠| 久久精品一区八戒影视| 亚洲猫色日本管| 亚洲影院在线观看| 免费成人在线网站| 国产91色综合久久免费分享| 91亚洲永久精品| 91精品国产一区二区三区香蕉 | 国产午夜精品一区二区三区视频| 久久久精品中文字幕麻豆发布| 国产免费观看久久| 亚洲私人影院在线观看| 亚洲一区二区三区免费视频| 日韩av一区二| 不卡的电影网站| 69堂成人精品免费视频| 国产午夜亚洲精品不卡| 亚洲777理论| 成人一区二区三区在线观看| 在线一区二区观看| 国产欧美日产一区| 一区二区三区四区视频精品免费| 日韩国产成人精品| 不卡的电影网站| 精品国产乱码久久久久久浪潮 | 成人自拍视频在线| 欧美乱熟臀69xxxxxx| 国产精品午夜春色av| 免费成人av在线播放| 色综合久久久久综合体| 26uuu色噜噜精品一区二区| 亚洲免费观看视频| 丁香亚洲综合激情啪啪综合| 91精品国产综合久久精品图片| 国产精品家庭影院| 国产精品123| 日韩精品一区二区在线| 午夜成人免费电影| 欧美这里有精品| 亚洲日本va午夜在线影院| 国产一区二区免费视频| 欧美一区二区三区的| 亚洲综合一二三区| 色哟哟日韩精品| 国产精品热久久久久夜色精品三区| 久久精品国产成人一区二区三区| 欧美午夜精品久久久久久孕妇| 中文字幕一区二区三区av| 国产精品91一区二区| 欧美成人一级视频| 久久不见久久见免费视频7| 欧美日韩国产高清一区二区三区 | 日韩中文字幕麻豆| 欧美亚洲国产怡红院影院| 国产精品狼人久久影院观看方式| 国产成人综合自拍| 国产亚洲精久久久久久| 国产成人亚洲综合色影视| 欧美电视剧在线看免费| 激情五月婷婷综合| 久久日韩精品一区二区五区| 精油按摩中文字幕久久| 精品久久国产老人久久综合| 国产综合色视频| 国产日韩欧美麻豆| eeuss鲁一区二区三区| 国产精品欧美极品| 91视频一区二区| 一区二区成人在线| 欧美精品99久久久**| 免费不卡在线观看| 久久婷婷国产综合精品青草| 懂色av一区二区三区蜜臀| 国产精品久久久久久户外露出 | 精品91自产拍在线观看一区| 国产揄拍国内精品对白| 国产欧美综合色| 91精品福利视频| 蜜桃视频一区二区三区| 久久精品免费在线观看| 不卡一区二区在线| 午夜天堂影视香蕉久久| 精品日韩在线一区| 91亚洲大成网污www| 香蕉久久夜色精品国产使用方法| www国产成人免费观看视频 深夜成人网| 国产酒店精品激情| 亚洲柠檬福利资源导航| 日韩一级大片在线| 成人激情小说网站| 视频在线观看一区| 国产精品日韩成人| 777午夜精品视频在线播放| 精品一区二区日韩| 亚洲美女偷拍久久| 欧美tk—视频vk| 91视频国产资源| 秋霞国产午夜精品免费视频| 国产精品另类一区| 欧美日韩激情一区| 成人av动漫在线| 美女视频免费一区| 亚洲最大成人综合| 26uuu精品一区二区| 欧美性极品少妇| 成人a区在线观看| 香蕉影视欧美成人| 国产精品入口麻豆九色| 精品国产凹凸成av人网站| 欧美性三三影院| 99久久99久久精品免费看蜜桃| 奇米一区二区三区av| 一区二区三区产品免费精品久久75| 久久综合九色综合久久久精品综合| 色婷婷狠狠综合| 成人精品视频一区二区三区| 久久精品国产第一区二区三区| 亚洲国产视频在线| 一区二区三区影院| 亚洲欧美中日韩| 国产女人18毛片水真多成人如厕 | 国产色爱av资源综合区| 91.com在线观看| 欧美做爰猛烈大尺度电影无法无天| 国产精品夜夜爽| 国内精品国产三级国产a久久| 视频一区二区国产| 亚洲最新在线观看| 亚洲欧美视频在线观看| 综合亚洲深深色噜噜狠狠网站| 久久色.com| 国产欧美日韩在线| 欧美韩国日本一区| 久久五月婷婷丁香社区| 久久青草欧美一区二区三区| 久久久久久一级片| 国产欧美一区二区三区在线老狼| 韩国精品久久久| 蓝色福利精品导航| 中文字幕五月欧美| 欧美国产禁国产网站cc| 日韩一区和二区| 欧美精品日日鲁夜夜添| 白白色 亚洲乱淫| 国内不卡的二区三区中文字幕| 在线电影欧美成精品| 国产一区二区女| 国产精品白丝jk黑袜喷水| 国产成人精品综合在线观看 | 欧美在线你懂得| 日韩一区二区三区电影在线观看 | 最新日韩av在线| 日韩主播视频在线| 成人美女视频在线看| 欧美日韩中字一区| 久久久影视传媒| 日韩二区在线观看| 精品99一区二区| 中国av一区二区三区| 狠狠久久亚洲欧美| 欧美日韩国产综合久久| 亚洲黄色免费网站| 色94色欧美sute亚洲13| 久久久www成人免费毛片麻豆| 久久精品国产第一区二区三区| 欧美亚洲一区二区在线| 亚洲欧美日韩国产手机在线| 成人丝袜18视频在线观看| 欧美精品一区男女天堂| 免费精品视频在线| 欧美精品在线视频| 日韩国产在线观看一区| 成人av电影免费观看| 亚洲手机成人高清视频| 99精品热视频| 亚洲一区二区三区在线看| 欧美日韩精品系列| 亚洲第一主播视频| 欧美大片在线观看一区| 国产成人免费在线观看不卡| 亚洲精品菠萝久久久久久久| 欧美一区二区三区色| 激情伊人五月天久久综合|