unit RobieForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, JvComponentBase, JvWavePlayer;

type
  TfRobie = class(TForm)
    SoundOn: TButton;
    SoundOff: TButton;
    Light: TButton;
    Bleep: TButton;
    Right: TButton;
    Left: TButton;
    Forward: TButton;
    Back: TButton;
    stat: TStatusBar;
    procedure ForwardMouseActivate(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
    procedure SoundStop(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    procedure BleepClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
    procedure LightClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
    procedure LeftClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
    procedure RightClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
    procedure BackClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
    procedure SoundOnClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
    procedure SoundOffClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
    procedure FormCreate(Sender: TObject);
  private
    wav: TJvWavePlayer;
  public
    { Public declarations }
  end;

var
  fRobie: TfRobie;

implementation

{$R *.dfm}

procedure TfRobie.LightClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
begin
    wav.FileName := 'wav5.wav';
    wav.Play;
end;

procedure TfRobie.BleepClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
begin
    wav.FileName := 'wav2.wav';
    wav.Play;
end;

procedure TfRobie.FormCreate(Sender: TObject);
begin
    wav := TJvWavePlayer.Create(self);
    wav.Loop := true;
end;

procedure TfRobie.ForwardMouseActivate(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y, HitTest: Integer;
  var MouseActivate: TMouseActivate);
begin
    wav.FileName := 'wav1.wav';
    wav.Play;
end;

procedure TfRobie.BackClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
begin
    wav.FileName := 'wav3.wav';
    wav.Play;
end;

procedure TfRobie.LeftClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
begin
    wav.FileName := 'wav6.wav';
    wav.Play;
end;

procedure TfRobie.RightClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
begin
    wav.FileName := 'wav4.wav';
    wav.Play;
end;

procedure TfRobie.SoundOnClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
begin
    wav.FileName := 'wav7.wav';
    wav.Play;
end;

procedure TfRobie.SoundOffClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y, HitTest: Integer; var MouseActivate: TMouseActivate);
begin
    wav.FileName := 'wav8.wav';
    wav.Play;
end;

procedure TfRobie.SoundStop(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
    stat.SimpleText := 'mouseup!';
    wav.Stop;
    wav.Filename := 'wav8.wav';
    wav.Play;
end;

end.
