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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? balancer.pas

?? TBalncer 音頻聲道均衡控件 基于 DSPack 的音頻均衡控件,可以設(shè)置左右聲道. 因?yàn)樵?DSPack 里是沒有對(duì)左右聲道作選擇的,要選擇左右聲道只能通過一邊的喇叭出聲,另一邊沒聲.
?? PAS
?? 第 1 頁 / 共 2 頁
字號(hào):
unit Balancer;

interface


uses Classes, BaseClass, ActiveX, DirectShow9, MMSystem, Windows, DSUTil,
  DSPack;

const
  Name_Balancer = 'Audio Balancer by Style.Chen';
  CLSID_Balancer: TGUID = '{BD8A846D-95A3-4916-AFEC-951C6A469363}';
  IID_BalancerChannel: TGUID = '{01F2EFF9-722A-4D84-A93D-53CF6CD47384}';

type
  TAudioChannel = (acStereo, acLeft, acRight);

type

  TBalancerFilterGraph = class(TFilterGraph)
  public
    procedure InsertFilter(AFilter: IFilter);
    procedure RemoveFilter(AFilter: IFilter);
  end;

  IBalancerChannel = interface(IunKnown)
    ['{BF88E3D0-573E-4D9B-9794-FC18B93E346B}']
    function put_MediaType(mt: PAMMediaType): HRESULT; stdcall;
    function get_MediaType(out mt: TAMMediaType): HRESULT; stdcall;
    function get_IPin(out Pin: IPin): HRESULT; stdcall;
    function get_State(out State: TFilterState): HRESULT; stdcall;
    function SetAudioChannel(AudioChannel: TAudioChannel): HRESULT; stdcall;
  end;

const
  MEDIATYPE_Audio: TGUID = (D1: $73647561; D2: $0000; D3: $0010; D4: ($80, $00, $00, $AA, $00, $38, $9B, $71));
  MEDIASUBTYPE_PCM: TGUID = (D1: $00000001; D2: $0000; D3: $0010; D4: ($80, $00, $00, $AA, $00, $38, $9B, $71));


var
  InstanceCount: integer = 0;

type
  TBalancer = class;

  TBalancerFilter = class(TBCTransInPlaceFilter, IBalancerChannel, IPersist)
    FThisInstance: integer;
    FPreferred: TAMMediaType;
    FBalancerLock: TBCCritSec;
    FCurrentChannel: TAudioChannel;
    FParent: TBalancer;
  private
    function AudioChannelMix(PBuffer: PByte; Size: Integer;
      AudioChannel:
      TAudioChannel; AudioBits: Integer): HRESULT;
  public
    function StartStreaming: HRESULT; override;
    function CheckInputType(mtIn: PAMMediaType): HRESULT; override;
    function put_MediaType(mt: PAMMediaType): HRESULT; stdcall;
    function get_MediaType(out mt: TAMMediaType): HRESULT; stdcall;
    function get_IPin(out Pin: IPin): HRESULT; stdcall;
    function get_State(out State: TFilterState): HRESULT; stdcall;

    function GetPages(out pages: TCAGUID): HResult; stdcall;

    constructor Create(ObjName: string; unk: IUnKnown; out hr: HRESULT);
    constructor CreateFromFactory(Factory: TBCClassFactory; const Controller:
      IUnknown); override;
    destructor Destroy; override;

    function Transform(Sample: IMediaSample): HRESULT; override;
    function SetAudioChannel(AudioChannel: TAudioChannel): HRESULT; stdcall;
    property Parent: TBalancer read FParent write FParent;
  end;

  TBalancer = class(TComponent, IFilter)
  private
    FFilter: TBalancerFilter;
    FFilterGraph: TFilterGraph;
    FBaseFilter: IBaseFilter;
    FAudioChannel: TAudioChannel;
    function GetFilter: IBaseFilter;
    function GetName: string;
    procedure NotifyFilter(operation: TFilterOperation; Param: integer = 0);
    procedure SetFilterGraph(AFilterGraph: TFilterGraph);
    procedure SetAudioChannel(AAudioChannel: TAudioChannel);
  protected
    procedure Notification(AComponent: TComponent; Operation: TOperation);
      override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    function QueryInterface(const IID: TGUID; out Obj): HResult; override;
      stdcall;
  published
    property FilterGraph: TFilterGraph read FFilterGraph write SetFilterGraph;
    property AudioChannel: TAudioChannel read FAudioChannel write
      SetAudioChannel;
  end;

procedure Register;

implementation

procedure TBalancerFilterGraph.InsertFilter(AFilter: IFilter);
begin
  inherited InsertFilter(AFilter);
end;

procedure TBalancerFilterGraph.RemoveFilter(AFilter: IFilter);
begin
  inherited RemoveFilter(AFilter);
end;

function TBalancerFilter.AudioChannelMix(PBuffer: PByte; Size: Integer;
  AudioChannel:
  TAudioChannel; AudioBits: Integer): HRESULT;
var
  i: Integer;
begin
  Result := S_OK;
  try
    if AudioBits = 8 then
    begin
      case AudioChannel of
        acRight:
          begin
            for i := 0 to Size - 1 do
            begin
              if (i mod 2) = 0 then
              begin
                PByte(Integer(PBuffer) + i + 1)^ :=
                  PByte(Integer(PBuffer) +
                  i)^;
              end;
            end;
          end;
        acLeft:
          begin
            for i := 0 to Size - 1 do
            begin
              if (i mod 2) = 0 then
              begin
                PByte(Integer(PBuffer) + i)^ :=
                  PByte(Integer(PBuffer) + i +
                  1)^;
              end;
            end;
          end;
      end;
      Exit;
    end;
    if AudioBits = 16 then
    begin
      case AudioChannel of
        acRight:
          begin
            for i := 0 to Size - 1 do
            begin
              if (i mod 4) = 0 then
              begin
                PByte(Integer(PBuffer) + i + 2)^ :=
                  PByte(Integer(PBuffer) +
                  i)^;
                PByte(Integer(PBuffer) + i + 3)^ :=
                  PByte(Integer(PBuffer) + i +
                  1)^;
              end;
            end;
          end;
        acLeft:
          begin
            for i := 0 to Size - 1 do
            begin
              if (i mod 4) = 0 then
              begin
                PByte(Integer(PBuffer) + i)^ := PByte(Integer(PBuffer) + i +
                  2)^;
                PByte(Integer(PBuffer) + i + 1)^ := PByte(Integer(PBuffer) + i +
                  3)^;
              end;
            end;
          end;
      end;
      Exit;
    end;
    if AudioBits = 24 then
    begin
      case AudioChannel of
        acRight:
          begin
            for i := 0 to Size - 1 do
            begin
              if (i mod 6) = 0 then
              begin
                PByte(Integer(PBuffer) + i + 3)^ :=
                  PByte(Integer(PBuffer) +
                  i)^;
                PByte(Integer(PBuffer) + i + 4)^ :=
                  PByte(Integer(PBuffer) + i +
                  1)^;
                PByte(Integer(PBuffer) + i + 5)^ :=
                  PByte(Integer(PBuffer) + i +
                  2)^;
              end;
            end;
          end;
        acLeft:
          begin
            for i := 0 to Size - 1 do
            begin
              if (i mod 6) = 0 then
              begin
                PByte(Integer(PBuffer) + i)^ :=
                  PByte(Integer(PBuffer) +
                  i + 3)^;
                PByte(Integer(PBuffer) + i + 1)^ :=
                  PByte(Integer(PBuffer) + i +
                  4)^;
                PByte(Integer(PBuffer) + i + 2)^ :=
                  PByte(Integer(PBuffer) + i +
                  5)^;
              end;
            end;
          end;
      end;
      Exit;
    end;
    if AudioBits = 32 then
    begin
      case AudioChannel of
        acRight:
          begin
            for i := 0 to Size - 1 do
            begin
              if (i mod 8) = 0 then
              begin
                PByte(Integer(PBuffer) + i + 4)^ :=
                  PByte(Integer(PBuffer) +
                  i)^;
                PByte(Integer(PBuffer) + i + 5)^ :=
                  PByte(Integer(PBuffer) + i +
                  1)^;
                PByte(Integer(PBuffer) + i + 6)^ :=
                  PByte(Integer(PBuffer) +
                  2)^;
                PByte(Integer(PBuffer) + i + 7)^ :=
                  PByte(Integer(PBuffer) + i +
                  3)^;
              end;
            end;
          end;
        acLeft:
          begin
            for i := 0 to Size - 1 do
            begin
              if (i mod 4) = 0 then
              begin
                PByte(Integer(PBuffer) + i)^ := PByte(Integer(PBuffer) + i +
                  4)^;
                PByte(Integer(PBuffer) + i + 1)^ := PByte(Integer(PBuffer) + i +
                  5)^;
                PByte(Integer(PBuffer) + i + 2)^ := PByte(Integer(PBuffer) + i +
                  6)^;
                PByte(Integer(PBuffer) + i + 3)^ := PByte(Integer(PBuffer) + i +
                  7)^;
              end;
            end;
          end;
      end;
      Exit;
    end;
    Result := S_OK;
  except
    Result := S_FALSE;
  end;
end;

function TBalancerFilter.StartStreaming: HRESULT;
var
  MpegAudioDecoder: IMpegAudioDecoder;
  IntDecode: LongWord;
  ppEnum: IEnumFilters;
  ppFilter: IBaseFilter;
begin
  if FParent.FFilterGraph <> nil then
  begin
    (FParent.FFilterGraph as IFilterGraph).EnumFilters(ppEnum);
    while ppEnum.Next(1, ppFilter, nil) = S_OK do
    begin
      ppFilter.QueryInterface(IMpegAudioDecoder, MpegAudioDecoder);
      if MpegAudioDecoder <> nil then
      begin
        MpegAudioDecoder.get_DualMode(IntDecode);
        MpegAudioDecoder.put_DualMode(0);
      end;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日日噜噜夜夜狠狠视频欧美人| 久久蜜桃av一区二区天堂 | 石原莉奈在线亚洲三区| 欧美午夜一区二区三区免费大片| 亚洲一区二区三区在线播放| 欧美日韩在线一区二区| 日韩高清在线不卡| www国产亚洲精品久久麻豆| 国产精品中文字幕欧美| 国产精品乱码久久久久久| aa级大片欧美| 亚洲bt欧美bt精品777| 日韩欧美成人午夜| 国产高清精品网站| 亚洲老司机在线| 91精品国产免费| 国产99久久久久| 一区二区成人在线视频| 日韩午夜精品视频| 成人免费视频国产在线观看| 亚洲午夜精品在线| 精品国产乱码久久久久久浪潮| 国产成人在线视频播放| 亚洲va在线va天堂| 欧美精品一区二区三区视频| 99久久精品国产毛片| 天堂在线一区二区| 中文字幕欧美三区| 欧美日本在线看| 白白色 亚洲乱淫| 五月婷婷色综合| 国产午夜精品理论片a级大结局| 日本高清不卡视频| 国产一区二区女| 亚洲一区二区三区中文字幕在线| 久久免费偷拍视频| 欧美日韩国产影片| 成人综合在线观看| 日本女优在线视频一区二区| 国产精品进线69影院| 欧美一区二区成人6969| 色婷婷精品大视频在线蜜桃视频| 久久激情综合网| 亚洲国产精品人人做人人爽| 国产视频911| 日韩西西人体444www| 在线精品视频一区二区三四| 国产一区在线精品| 日韩制服丝袜av| 一区二区理论电影在线观看| 国产农村妇女毛片精品久久麻豆 | 亚洲女同一区二区| 久久久久国产精品人| 在线播放日韩导航| 91麻豆swag| 成人国产精品免费观看视频| 久久不见久久见中文字幕免费| 亚洲成人在线网站| 一区二区三区在线影院| 中文成人综合网| 国产免费成人在线视频| 欧美mv日韩mv国产网站app| 在线观看91av| 欧美日韩的一区二区| 精品视频全国免费看| 91网上在线视频| k8久久久一区二区三区| 国产成人在线色| 粉嫩绯色av一区二区在线观看| 国产综合一区二区| 久久国产免费看| 久久精品国产精品亚洲综合| 麻豆一区二区三| 免费看欧美女人艹b| 日韩二区在线观看| 免费看欧美美女黄的网站| 日韩国产欧美三级| 午夜精品久久久久久久99水蜜桃| 亚洲制服丝袜av| 亚洲曰韩产成在线| 亚洲成人综合视频| 日本va欧美va瓶| 婷婷开心激情综合| 久久激情五月婷婷| 国产成人在线视频网站| eeuss鲁一区二区三区| 99久久精品国产网站| 欧美最猛黑人xxxxx猛交| 在线精品视频免费观看| 欧美精选一区二区| 日韩无一区二区| 久久久www成人免费无遮挡大片| 国产人成一区二区三区影院| 国产精品丝袜久久久久久app| 中文字幕一区免费在线观看| 亚洲天堂精品视频| 亚洲午夜久久久久久久久电影网| 免费人成精品欧美精品| 国产精选一区二区三区| 99久久综合狠狠综合久久| 久久久久久久久久久久久久久99| 久久精品无码一区二区三区| 国产精品拍天天在线| 亚洲日本电影在线| 视频一区免费在线观看| 国产乱国产乱300精品| av成人免费在线观看| 欧美精品v国产精品v日韩精品| 日韩欧美中文字幕精品| 日本一区二区三级电影在线观看| 亚洲永久免费视频| 激情图区综合网| 色综合天天视频在线观看 | 精品午夜久久福利影院| 大胆欧美人体老妇| 欧美伦理视频网站| 国产免费成人在线视频| 婷婷夜色潮精品综合在线| 国产精品18久久久久| 欧美最猛性xxxxx直播| 久久综合国产精品| 亚洲影视在线播放| 国产福利精品一区| 欧美日韩国产综合久久| 中文字幕欧美激情一区| 丝袜亚洲另类欧美| eeuss鲁片一区二区三区 | 久久综合久色欧美综合狠狠| 亚洲黄色尤物视频| 国产99精品国产| 亚洲最新视频在线观看| 国产盗摄一区二区| 在线综合视频播放| 亚洲精品中文在线| 国产精品一二三区在线| 欧美丰满美乳xxx高潮www| 国产精品黄色在线观看| 韩国v欧美v亚洲v日本v| 欧美色精品在线视频| 国产精品美日韩| 久久99久久99小草精品免视看| 色国产精品一区在线观看| 久久久久久久久久电影| 日韩成人一级片| 欧美中文字幕一区| 亚洲欧美电影院| 99久久99久久综合| 国产欧美一区二区三区在线老狼| 日韩va亚洲va欧美va久久| 在线观看日韩精品| 亚洲欧洲av在线| 成人一级视频在线观看| 精品国产99国产精品| 日韩国产精品久久| 欧美日韩小视频| 一区二区三区精品| 91亚洲精华国产精华精华液| 日本一区二区三区在线观看| 国产九九视频一区二区三区| 精品乱人伦一区二区三区| 免费在线成人网| 欧美一卡2卡三卡4卡5免费| 五月天激情综合网| 欧美精品三级日韩久久| 亚洲bt欧美bt精品| 欧美日韩亚洲另类| 亚洲777理论| 欧美喷潮久久久xxxxx| 视频一区中文字幕国产| 欧美精品1区2区3区| 五月婷婷激情综合| 欧美日韩国产一二三| 午夜精品成人在线视频| 欧美一级电影网站| 久久精品国产一区二区三区免费看| 精品少妇一区二区三区| 九九九精品视频| 国产欧美一区二区精品忘忧草| 国产成人av一区| 国产精品久久二区二区| 91国偷自产一区二区三区成为亚洲经典| 亚洲精品综合在线| 欧美日本在线一区| 激情亚洲综合在线| 中文字幕av一区二区三区高 | 亚洲国产精品一区二区久久| 欧美日韩成人综合| 另类综合日韩欧美亚洲| 2020国产精品| 91日韩精品一区| 婷婷成人综合网| 一区二区三区中文字幕电影| 精品国产一区二区三区忘忧草| 色婷婷激情久久| 久久久精品中文字幕麻豆发布| 在线欧美一区二区| 欧美中文字幕一区二区三区亚洲| 懂色av一区二区在线播放| 91在线视频在线| 99精品欧美一区二区三区综合在线|