unit main;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  KsSkinEngine, KsControls, KsTrackBars, KsSkinTrackBars, KsHooks, KsForms,
  KsSkinForms, KsButtons, KsSkinButtons, ExtCtrls, KsProgress,
  KsSkinProgress, KsItems, KsSkinItems, Menus, KsMenus, KsSkinMenus;

type
  TForm1 = class(TForm)
    PlayerSkin: TSeSkinEngine;
    SkinForm: TSeSkinForm;
    Volume: TSeSkinTrackBar;
    PlayButton: TSeSkinButton;
    Seek: TSeSkinTrackBar;
    Prev: TSeSkinButton;
    Next: TSeSkinButton;
    Stop: TSeSkinButton;
    Pause: TSeSkinButton;
    Display1: TSeSkinProgressBar;
    Display2: TSeSkinProgressBar;
    Display3: TSeSkinProgressBar;
    Timer1: TTimer;
    Display4: TSeSkinProgressBar;
    procedure Timer1Timer(Sender: TObject);
    procedure PlayButtonClick(Sender: TObject);
    procedure PauseClick(Sender: TObject);
    procedure StopClick(Sender: TObject);
    procedure PrevClick(Sender: TObject);
    procedure NextClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    FPause: boolean;
    procedure Start;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  { Play similation }
  Seek.Position := Seek.Position + 1;

  Display1.Position := 10 + Random(100);
  Display2.Position := 10 + Random(100);
  Display3.Position := 10 + Random(100);
  Display4.Position := 10 + Random(100);
end;

procedure TForm1.Start;
begin
  Seek.Max := 2000 + Random(5000);
  Seek.Position := 0;
  Timer1.Enabled := true;
  Seek.Enabled := true;
end;

procedure TForm1.PlayButtonClick(Sender: TObject);
begin
  if not FPause then
    Start;
  Timer1.Enabled := true;
  Seek.Enabled := true;
end;

procedure TForm1.PauseClick(Sender: TObject);
begin
  FPause := true;
  Timer1.Enabled := false;
end;

procedure TForm1.StopClick(Sender: TObject);
begin
  FPause := false;
  Timer1.Enabled := false;
end;

procedure TForm1.PrevClick(Sender: TObject);
begin
  Start;
end;

procedure TForm1.NextClick(Sender: TObject);
begin
  Start;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Sender := Sender;
end;

end.
