|
|
unit u_main;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, StdCtrls, OleCtnrs, MPlayer, ExtCtrls, bsSkinData,
|
|
|
BusinessSkinForm, bsSkinCtrls, Menus, ComCtrls, XPMenu;
|
|
|
|
|
|
type
|
|
|
Tfrm_main = class(TForm)
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
bsSkinData1: TbsSkinData;
|
|
|
bsStoredSkin1: TbsStoredSkin;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
MediaPlayer1: TMediaPlayer;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinSpeedButton1: TbsSkinSpeedButton;
|
|
|
bsSkinSpeedButton2: TbsSkinSpeedButton;
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
N1: TMenuItem;
|
|
|
Timer1: TTimer;
|
|
|
bsSkinSpeedButton3: TbsSkinSpeedButton;
|
|
|
bsSkinSpeedButton4: TbsSkinSpeedButton;
|
|
|
bsSkinSpeedButton5: TbsSkinSpeedButton;
|
|
|
XPMenu1: TXPMenu;
|
|
|
bsSkinSpeedButton6: TbsSkinSpeedButton;
|
|
|
ListBox1: TListBox;
|
|
|
bsSkinTrackBar1: TbsSkinTrackBar;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
Label1: TLabel;
|
|
|
Label2: TLabel;
|
|
|
procedure bsSkinSpeedButton2Click(Sender: TObject);
|
|
|
procedure bsSkinPanel2Resize(Sender: TObject);
|
|
|
procedure bsSkinSpeedButton1Click(Sender: TObject);
|
|
|
procedure N1Click(Sender: TObject);
|
|
|
procedure bsSkinTrackBar1Change(Sender: TObject);
|
|
|
procedure Timer1Timer(Sender: TObject);
|
|
|
procedure bsSkinSpeedButton3Click(Sender: TObject);
|
|
|
procedure bsSkinSpeedButton4Click(Sender: TObject);
|
|
|
procedure bsSkinSpeedButton5Click(Sender: TObject);
|
|
|
procedure bsSkinSpeedButton6Click(Sender: TObject);
|
|
|
procedure bsSkinPanel1MouseDown(Sender: TObject; Button: TMouseButton;
|
|
|
Shift: TShiftState; X, Y: Integer);
|
|
|
procedure ListBox1DblClick(Sender: TObject);
|
|
|
procedure bsSkinTrackBar1MouseDown(Sender: TObject;
|
|
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_main: Tfrm_main;
|
|
|
modify,do_view:boolean;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_close;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_main.bsSkinSpeedButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinPanel2Resize(Sender: TObject);
|
|
|
begin
|
|
|
MediaPlayer1.DisplayRect:=bsSkinPanel2.ClientRect;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinSpeedButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
bsSkinPanel1.Visible:=false;
|
|
|
frm_main.WindowState:=wsMaximized;
|
|
|
bsSkinSpeedButton1.Enabled:=false;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.N1Click(Sender: TObject);
|
|
|
begin
|
|
|
WindowState:=wsNormal;
|
|
|
bsSkinPanel1.Visible:=true;
|
|
|
bsSkinSpeedButton1.Enabled:=true;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinTrackBar1Change(Sender: TObject);
|
|
|
begin
|
|
|
if (modify=false) and do_view then
|
|
|
begin
|
|
|
MediaPlayer1.Position:=bsSkinTrackBar1.Value;
|
|
|
MediaPlayer1.play;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.Timer1Timer(Sender: TObject);
|
|
|
var
|
|
|
i,j:integer;
|
|
|
begin
|
|
|
try
|
|
|
if do_view then
|
|
|
begin
|
|
|
modify:=true;
|
|
|
bsSkinTrackBar1.Value:=MediaPlayer1.Position;
|
|
|
i:=round(MediaPlayer1.Position/360);
|
|
|
j:=round((MediaPlayer1.Position-round(MediaPlayer1.Position/360)*360)/6);
|
|
|
if j<0 then
|
|
|
begin
|
|
|
i:=i-1;
|
|
|
j:=60+j;
|
|
|
end;
|
|
|
Label2.caption:='<27><>ǰ<EFBFBD><C7B0><EFBFBD>ȣ<EFBFBD>'+inttostr(i)+'<27><>:'+inttostr(j)+'<27><>';
|
|
|
|
|
|
if bsSkinTrackBar1.MaxValue=MediaPlayer1.Position then
|
|
|
begin
|
|
|
N1Click(Sender);
|
|
|
bsSkinSpeedButton6Click(Sender);
|
|
|
do_view:=false;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
modify:=false;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinSpeedButton3Click(Sender: TObject);
|
|
|
var
|
|
|
i,j:integer;
|
|
|
begin
|
|
|
if ListBox1.ItemIndex=-1 then
|
|
|
begin
|
|
|
showmessage('<27><>ѡ<EFBFBD><D1A1>Ҫ<EFBFBD><D2AA><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
MediaPlayer1.Close;
|
|
|
MediaPlayer1.FileName:=ExtractFilePath(application.ExeName)+ListBox1.Items[ListBox1.ItemIndex]+'.avi';
|
|
|
MediaPlayer1.open;
|
|
|
bsSkinTrackBar1.MaxValue:=MediaPlayer1.Length;
|
|
|
bsSkinTrackBar1.Value:=0;
|
|
|
MediaPlayer1.Play;
|
|
|
MediaPlayer1.DisplayRect:=bsSkinPanel2.ClientRect;
|
|
|
bsSkinSpeedButton3.Enabled:=false;
|
|
|
bsSkinSpeedButton4.Enabled:=true;
|
|
|
bsSkinSpeedButton5.Enabled:=false;
|
|
|
bsSkinSpeedButton1.Enabled:=true;
|
|
|
bsSkinSpeedButton6.Enabled:=true;
|
|
|
do_view:=true;
|
|
|
i:=round(MediaPlayer1.Length/360);
|
|
|
j:=round((MediaPlayer1.Length-round(MediaPlayer1.Length/360)*360)/6);
|
|
|
if j<0 then
|
|
|
begin
|
|
|
i:=i-1;
|
|
|
j:=60+j;
|
|
|
end;
|
|
|
Label1.caption:='ӰƬ<D3B0><C6AC><EFBFBD>ȣ<EFBFBD>'+inttostr(i)+'<27><>:'+inttostr(j)+'<27><>';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinSpeedButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
MediaPlayer1.PauseOnly;
|
|
|
bsSkinSpeedButton3.Enabled:=false;
|
|
|
bsSkinSpeedButton4.Enabled:=false;
|
|
|
bsSkinSpeedButton5.Enabled:=true;
|
|
|
bsSkinSpeedButton1.Enabled:=false;
|
|
|
bsSkinSpeedButton6.Enabled:=true;
|
|
|
do_view:=false;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinSpeedButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
MediaPlayer1.Play;
|
|
|
bsSkinSpeedButton3.Enabled:=false;
|
|
|
bsSkinSpeedButton4.Enabled:=true;
|
|
|
bsSkinSpeedButton5.Enabled:=false;
|
|
|
bsSkinSpeedButton1.Enabled:=true;
|
|
|
bsSkinSpeedButton6.Enabled:=true;
|
|
|
do_view:=true;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinSpeedButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
MediaPlayer1.close;
|
|
|
bsSkinSpeedButton3.Enabled:=true;
|
|
|
bsSkinSpeedButton4.Enabled:=false;
|
|
|
bsSkinSpeedButton5.Enabled:=false;
|
|
|
bsSkinSpeedButton1.Enabled:=false;
|
|
|
bsSkinSpeedButton6.Enabled:=false;
|
|
|
do_view:=false;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinPanel1MouseDown(Sender: TObject;
|
|
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
|
begin
|
|
|
releasecapture;
|
|
|
perform(wm_syscommand,$f012,0);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.ListBox1DblClick(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinSpeedButton3.Enabled then
|
|
|
bsSkinSpeedButton3Click(Sender);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.bsSkinTrackBar1MouseDown(Sender: TObject;
|
|
|
Button: TMouseButton; Shift: TShiftState; X,Y: Integer);
|
|
|
begin
|
|
|
if x>=bsSkinTrackBar1.Value/bsSkinTrackBar1.MaxValue*bsSkinTrackBar1.Width then
|
|
|
begin
|
|
|
if (bsSkinTrackBar1.MaxValue-bsSkinTrackBar1.Value)>120 then
|
|
|
begin
|
|
|
bsSkinTrackBar1.Value:=bsSkinTrackBar1.Value+120;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if (bsSkinTrackBar1.Value-120)>0 then
|
|
|
begin
|
|
|
bsSkinTrackBar1.Value:=bsSkinTrackBar1.Value-120;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_main.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
ListBox1.Items.LoadFromFile(ExtractFilePath(application.ExeName)+'LIST.TXT');
|
|
|
ListBox1.ItemIndex:=0;
|
|
|
end;
|
|
|
|
|
|
end.
|