⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basefiltereditor.pas

📁 Delphi数据库系统开发例子
💻 PAS
📖 第 1 页 / 共 4 页
字号:

    (*********************************************************************
     *  DSPack 2.3.3                                                     *
     *                                                                   *
     *  home page : http://www.progdigy.com                              *
     *  email     : hgourvest@progdigy.com                               *
     *   Thanks to Michael Andersen. (DSVideoWindowEx)                   *
     *                                                                   *
     *  date      : 21-02-2003                                           *
     *                                                                   *
     *  The contents of this file are used with permission, subject to   *
     *  the Mozilla Public License Version 1.1 (the "License"); you may  *
     *  not use this file except in compliance with the License. You may *
     *  obtain a copy of the License at                                  *
     *  http://www.mozilla.org/MPL/MPL-1.1.html                          *
     *                                                                   *
     *  Software distributed under the License is distributed on an      *
     *  "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or   *
     *  implied. See the License for the specific language governing     *
     *  rights and limitations under the License.                        *
     *                                                                   *
     *********************************************************************)

{$IFDEF VER140} {$WARN SYMBOL_DEPRECATED OFF} {$ENDIF}
{$IFDEF VER150}
  {$WARN SYMBOL_DEPRECATED OFF}
  {$WARN UNSAFE_CODE OFF}
  {$WARN UNSAFE_TYPE OFF}
  {$WARN UNSAFE_CAST OFF}
{$ENDIF}

unit BaseFilterEditor;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DSUTIL, DirectShow9, ComCtrls, DSPack, Menus, ExtCtrls,
  Buttons;

type
  TFormBaseFilter = class(TForm)
    btOK: TButton;
    btCancel: TButton;
    FilterGraph: TFilterGraph;
    Filter: TFilter;
    PopupMenu: TPopupMenu;
    PropertyPage: TMenuItem;
    VFWDisplay: TMenuItem;
    VFWFormat: TMenuItem;
    VFWSource: TMenuItem;
    VFWConfig: TMenuItem;
    VFWCapture: TMenuItem;
    Config1: TMenuItem;
    VFWAbout: TMenuItem;
    PinMenu: TPopupMenu;
    PinProperty: TMenuItem;
    PageControl1: TPageControl;
    SelectorSheet: TTabSheet;
    Label1: TLabel;
    Label2: TLabel;
    Label6: TLabel;
    Filters: TTreeView;
    Interfaces: TListBox;
    Pins: TListBox;
    PinsSheet: TTabSheet;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Pins1: TListBox;
    PinInterfaces: TListBox;
    MediaTypes: TListBox;
    MonikerTag: TMemo;
    InfoBtn: TSpeedButton;
    InfoSheet: TTabSheet;
    Panel1: TPanel;
    Panel2: TPanel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Image1: TImage;
    Image2: TImage;
    Image3: TImage;
    Image4: TImage;
    Image5: TImage;
    Image6: TImage;
    Image7: TImage;
    Label16: TLabel;
    Label17: TLabel;
    procedure FormShow(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure PopupMenuPopup(Sender: TObject);
    procedure PropertyPageClick(Sender: TObject);
    procedure VFWDisplayClick(Sender: TObject);
    procedure VFWFormatClick(Sender: TObject);
    procedure VFWSourceClick(Sender: TObject);
    procedure Config1Click(Sender: TObject);
    procedure VFWAboutClick(Sender: TObject);
    procedure PinMenuPopup(Sender: TObject);
    procedure PinPropertyClick(Sender: TObject);
    procedure PinsSheetShow(Sender: TObject);
    procedure Pins1Click(Sender: TObject);
    procedure InterfacesDblClick(Sender: TObject);
    procedure PinInterfacesDblClick(Sender: TObject);
    procedure PinsDrawItem(Control: TWinControl; Index: Integer;
      Rect: TRect; State: TOwnerDrawState);
    procedure FiltersChange(Sender: TObject; Node: TTreeNode);
    procedure PinsMeasureItem(Control: TWinControl; Index: Integer;
      var Height: Integer);
    procedure FiltersDblClick(Sender: TObject);
    procedure FiltersCustomDrawItem(Sender: TCustomTreeView;
      Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
    procedure InfoBtnClick(Sender: TObject);
  public
    SysDevEnum: TSysDevEnum;
    PinList: TPinList;
    InPinPic,
    OutPinPic : TBitmap;
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
    procedure RefreshTree;
//    procedure FiltersClick(Sender: TObject);
    procedure GetFilterInfo;
  end;

  TDSitf = record
    name : string;
    itf  : TGUID;
  end;

  pNodeItem = ^TNodeItem;
  TNodeItem = Record
    Index      : integer;
    Color      : TColor;
    MonikerStr : WideString;
  End;

const
  FilterColors : array[0..4] of TColor = (clBlack, clPurple, clBlue, clRed, clGreen);

  DSItfs : array[0..382] of TDSitf =
((name: 'IPin'; itf: '{56A86891-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IEnumPins'; itf: '{56A86892-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IEnumMediaTypes'; itf: '{89C31040-846B-11CE-97D3-00AA0055595A}'),
 (name: 'IFilterGraph'; itf: '{56A8689F-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IEnumFilters'; itf: '{56A86893-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IMediaFilter'; itf: '{56A86899-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IBaseFilter'; itf: '{56A86895-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IReferenceClock'; itf: '{56A86897-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IReferenceClock2'; itf: '{36B73885-C2C8-11CF-8B46-00805F6CEF60}'),
 (name: 'IMediaSample'; itf: '{56A8689A-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IMediaSample2'; itf: '{36B73884-C2C8-11CF-8B46-00805F6CEF60}'),
 (name: 'IMemAllocator'; itf: '{56A8689C-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IMemInputPin'; itf: '{56A8689D-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IAMovieSetup'; itf: '{A3D8CEC0-7E5A-11CF-BBC5-00805F6CEF20}'),
 (name: 'IMediaSeeking'; itf: '{36B73880-C2C8-11CF-8B46-00805F6CEF60}'),
 (name: 'IEnumRegFilters'; itf: '{56A868A4-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IFilterMapper'; itf: '{56A868A3-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IFilterMapper2'; itf: '{B79BB0B0-33C1-11D1-ABE1-00A0C905F375}'),
 (name: 'IQualityControl'; itf: '{56A868A5-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IOverlayNotify'; itf: '{56A868A0-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IOverlay'; itf: '{56A868A1-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IMediaEventSink'; itf: '{56A868A2-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IFileSourceFilter'; itf: '{56A868A6-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IFileSinkFilter'; itf: '{A2104830-7C70-11CF-8BCE-00AA00A3F1A6}'),
 (name: 'IFileSinkFilter2'; itf: '{00855B90-CE1B-11D0-BD4F-00A0C911CE86}'),
 (name: 'IFileAsyncIO'; itf: '{56A868A7-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IGraphBuilder'; itf: '{56A868A9-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'ICaptureGraphBuilder'; itf: '{BF87B6E0-8C27-11D0-B3F0-00AA003761C5}'),
 (name: 'IAMCopyCaptureFileProgress'; itf: '{670D1D20-A068-11D0-B3F0-00AA003761C5}'),
 (name: 'IFilterGraph2'; itf: '{36B73882-C2C8-11CF-8B46-00805F6CEF60}'),
 (name: 'IStreamBuilder'; itf: '{56A868BF-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IAsyncReader'; itf: '{56A868AA-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IGraphVersion'; itf: '{56A868AB-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IResourceConsumer'; itf: '{56A868AD-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IResourceManager'; itf: '{56A868AC-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IDistributorNotify'; itf: '{56A868AF-0AD4-11CE-B03A-0020AF0BA770}'),
 (name: 'IAMStreamControl'; itf: '{36B73881-C2C8-11CF-8B46-00805F6CEF60}'),
 (name: 'ISeekingPassThru'; itf: '{36B73883-C2C8-11CF-8B46-00805F6CEF60}'),
 (name: 'IAMStreamConfig'; itf: '{C6E13340-30AC-11D0-A18C-00A0C9118956}'),
 (name: 'IConfigInterleaving'; itf: '{BEE3D220-157B-11D0-BD23-00A0C911CE86}'),
 (name: 'IConfigAviMux'; itf: '{5ACD6AA0-F482-11CE-8B67-00AA00A3F1A6}'),
 (name: 'IAMVideoCompression'; itf: '{C6E13343-30AC-11D0-A18C-00A0C9118956}'),
 (name: 'IAMVfwCaptureDialogs'; itf: '{D8D715A0-6E5E-11D0-B3F0-00AA003761C5}'),
 (name: 'IAMVfwCompressDialogs'; itf: '{D8D715A3-6E5E-11D0-B3F0-00AA003761C5}'),
 (name: 'IAMDroppedFrames'; itf: '{C6E13344-30AC-11D0-A18C-00A0C9118956}'),
 (name: 'IAMAudioInputMixer'; itf: '{54C39221-8380-11D0-B3F0-00AA003761C5}'),
 (name: 'IAMAnalogVideoDecoder'; itf: '{C6E13350-30AC-11D0-A18C-00A0C9118956}'),
 (name: 'IAMVideoProcAmp'; itf: '{C6E13360-30AC-11D0-A18C-00A0C9118956}'),
 (name: 'IAMCameraControl'; itf: '{C6E13370-30AC-11D0-A18C-00A0C9118956}'),
 (name: 'IAMCrossbar'; itf: '{C6E13380-30AC-11D0-A18C-00A0C9118956}'),
 (name: 'IAMTuner'; itf: '{211A8761-03AC-11D1-8D13-00AA00BD8339}'),
 (name: 'IAMTunerNotification'; itf: '{211A8760-03AC-11D1-8D13-00AA00BD8339}'),
 (name: 'IAMTVTuner'; itf: '{211A8766-03AC-11D1-8D13-00AA00BD8339}'),
 (name: 'IBPCSatelliteTuner'; itf: '{211A8765-03AC-11D1-8D13-00AA00BD8339}'),
 (name: 'IAMTVAudio'; itf: '{83EC1C30-23D1-11D1-99E6-00A0C9560266}'),
 (name: 'IAMTVAudioNotification'; itf: '{83EC1C33-23D1-11D1-99E6-00A0C9560266}'),
 (name: 'IAMAnalogVideoEncoder'; itf: '{C6E133B0-30AC-11D0-A18C-00A0C9118956}'),
 (name: 'IMediaPropertyBag'; itf: '{6025A880-C0D5-11D0-BD4E-00A0C911CE86}'),
 (name: 'IPersistMediaPropertyBag'; itf: '{5738E040-B67F-11D0-BD4D-00A0C911CE86}'),
 (name: 'IAMPhysicalPinInfo'; itf: '{F938C991-3029-11CF-8C44-00AA006B6814}'),
 (name: 'IAMExtDevice'; itf: '{B5730A90-1A2C-11CF-8C23-00AA006B6814}'),
 (name: 'IAMExtTransport'; itf: '{A03CD5F0-3045-11CF-8C44-00AA006B6814}'),
 (name: 'IAMTimecodeReader'; itf: '{9B496CE1-811B-11CF-8C77-00AA006B6814}'),
 (name: 'IAMTimecodeGenerator'; itf: '{9B496CE0-811B-11CF-8C77-00AA006B6814}'),
 (name: 'IAMTimecodeDisplay'; itf: '{9B496CE2-811B-11CF-8C77-00AA006B6814}'),
 (name: 'IAMDevMemoryAllocator'; itf: '{C6545BF0-E76B-11D0-BD52-00A0C911CE86}'),
 (name: 'IAMDevMemoryControl'; itf: '{C6545BF1-E76B-11D0-BD52-00A0C911CE86}'),
 (name: 'IAMStreamSelect'; itf: '{C1960960-17F5-11D1-ABE1-00A0C905F375}'),
 (name: 'IAMovie'; itf: '{359ACE10-7688-11CF-8B23-00805F6CEF60}'),
 (name: 'ICreateDevEnum'; itf: '{29840822-5B84-11D0-BD3B-00A0C911CE86}'),
 (name: 'IDvdControl'; itf: '{A70EFE61-E2A3-11D0-A9BE-00AA0061BE93}'),
 (name: 'IDvdControl2'; itf: '{33BC7430-EEC0-11D2-8201-00A0C9D74842}'),
 (name: 'IDvdInfo'; itf: '{A70EFE60-E2A3-11D0-A9BE-00AA0061BE93}'),
 (name: 'IDvdInfo2'; itf: '{34151510-EEC0-11D2-8201-00A0C9D74842}'),
 (name: 'IDvdGraphBuilder'; itf: '{FCC152B6-F372-11D0-8E00-00C04FD7C08B}'),
 (name: 'IDvdState'; itf: '{86303D6D-1C4A-4087-AB42-F711167048EF}'),
 (name: 'IDvdCmd'; itf: '{5A4A97E4-94EE-4A55-9751-74B5643AA27D}'),
 (name: 'IVideoFrameStep'; itf: '{E46A9787-2B71-444D-A4B5-1FAB7B708D6A}'),
 (name: 'IFilterMapper3'; itf: '{B79BB0B1-33C1-11D1-ABE1-00A0C905F375}'),
 (name: 'IOverlayNotify2'; itf: '{680EFA10-D535-11D1-87C8-00A0C9223196}'),
 (name: 'ICaptureGraphBuilder2'; itf: '{93E5A4E0-2D50-11D2-ABFA-00A0C9C6E38D}'),
 (name: 'IMemAllocatorCallbackTemp'; itf: '{379A0CF0-C1DE-11D2-ABF5-00A0C905F375}'),
 (name: 'IMemAllocatorNotifyCallbackTemp'; itf: '{92980B30-C1DE-11D2-ABF5-00A0C905F375}'),
 (name: 'IAMVideoControl'; itf: '{6A2E0670-28E4-11D0-A18C-00A0C9118956}'),
 (name: 'IKsPropertySet'; itf: '{31EFAC30-515C-11D0-A9AA-00AA0061BE93}'),
 (name: 'IAMResourceControl'; itf: '{8389D2D0-77D7-11D1-ABE6-00A0C905F375}'),
 (name: 'IAMClockAdjust'; itf: '{4D5466B0-A49C-11D1-ABE8-00A0C905F375}'),
 (name: 'IAMFilterMiscFlags'; itf: '{2DD74950-A890-11D1-ABE8-00A0C905F375}'),
 (name: 'IDrawVideoImage'; itf: '{48EFB120-AB49-11D2-AED2-00A0C995E8D5}'),
 (name: 'IDecimateVideoImage'; itf: '{2E5EA3E0-E924-11D2-B6DA-00A0C995E8DF}'),
 (name: 'IAMVideoDecimationProperties'; itf: '{60D32930-13DA-11D3-9EC6-C4FCAEF5C7BE}'),
 (name: 'IAMLatency'; itf: '{62EA93BA-EC62-11D2-B770-00C04FB6BD3D}'),
 (name: 'IAMPushSource'; itf: '{F185FE76-E64E-11D2-B76E-00C04FB6BD3D}'),
 (name: 'IAMDeviceRemoval'; itf: '{F90A6130-B658-11D2-AE49-0000F8754B99}'),

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -