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

📄 main.pas

📁 DSPack is a set of Components and class to write Multimedia Applications using MS Direct Show and Di
💻 PAS
字号:
unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DSPack, StdCtrls, Menus;

type
  TMainForm = class(TForm)
    VideoWindow: TVideoWindow;
    FilterGraph: TFilterGraph;
    OpenDialog: TOpenDialog;
    MainMenu: TMainMenu;
    MenuFile: TMenuItem;
    MenuOpen: TMenuItem;
    procedure MenuOpenClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { D閏larations priv閑s }
  public
    { D閏larations publiques }
  end;

var
  MainForm: TMainForm;

implementation
uses Allocator;

{$R *.dfm}

procedure TMainForm.MenuOpenClick(Sender: TObject);
begin
  // Open and play a video file
  if OpenDialog.Execute then
  with FilterGraph do
  begin
    Active := False;
    Active := True;
    RenderFile(OpenDialog.FileName);
    Play;
  end;
end;

procedure TMainForm.FormCreate(Sender: TObject);
begin
  // Set the Allocator
  VideoWindow.SetAllocator(TAllocator, $ACDCACDC);
end;

procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  // Cleanup
  FilterGraph.Active := False;
end;

end.

⌨️ 快捷键说明

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