home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / dragonfl / aaplayr1.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-05-27  |  20.3 KB  |  726 lines

  1. unit Aaplayr1;
  2.  
  3. { Delphi 2 Demo program for flic panel component }
  4. { 27th May 1998 }
  5.  
  6. { ------------------------------------------------------------------------- }
  7. interface
  8.  
  9. uses
  10.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  11.   Forms, Dialogs, ExtCtrls, StdCtrls, Spin, Menus, Gauges,
  12.   AAPlayr2, MMSystem, FlicPanel;
  13.  
  14. const
  15.    SYSTEM_PATH_LENGTH = 144;
  16.    USER_PATH_LENGTH = 255;
  17.  
  18. type
  19.   TForm1 = class(TForm)
  20.     MainMenu1: TMainMenu;
  21.     File1: TMenuItem;
  22.     Open1: TMenuItem;
  23.     Exit1: TMenuItem;
  24.     OpenDialog1: TOpenDialog;
  25.     Gauge1: TGauge;
  26.     Bevel3: TBevel;
  27.     OpenDialog2: TOpenDialog;
  28.     LoopPlay: TMenuItem;
  29.     N3: TMenuItem;
  30.     Exitprogram1: TMenuItem;
  31.     AnimGroupBox: TGroupBox;
  32.     Label3: TLabel;
  33.     WidthValue: TEdit;
  34.     HeightValue: TEdit;
  35.     FramesLabel: TLabel;
  36.     FramesValue: TEdit;
  37.     SpeedValue: TEdit;
  38.     Anim2GroupBox: TGroupBox;
  39.     Label5: TLabel;
  40.     SpeedEdit: TSpinEdit;
  41.     XEdit: TEdit;
  42.     YEdit: TEdit;
  43.     Label6: TLabel;
  44.     FramePanel: TPanel;
  45.     LoopPanel: TPanel;
  46.     Label4: TLabel;
  47.     NotifyGroupBox: TGroupBox;
  48.     CheckBox1: TCheckBox;
  49.     CheckBox2: TCheckBox;
  50.     CheckBox3: TCheckBox;
  51.     CheckBox4: TCheckBox;
  52.     CheckBox5: TCheckBox;
  53.     CheckBox6: TCheckBox;
  54.     CheckBox7: TCheckBox;
  55.     CheckBox8: TCheckBox;
  56.     CheckBox9: TCheckBox;
  57.     CheckBox10: TCheckBox;
  58.     OpenDialog3: TOpenDialog;
  59.     NotifyCancelButton: TButton;
  60.     Sound1: TMenuItem;
  61.     Associate1: TMenuItem;
  62.     ButtonPanel: TPanel;
  63.     Button1: TButton;
  64.     Button2: TButton;
  65.     Button3: TButton;
  66.     Button4: TButton;
  67.     Button5: TButton;
  68.     Button6: TButton;
  69.     Button7: TButton;
  70.     Button8: TButton;
  71.     procedure FormCreate(Sender: TObject);
  72.     procedure FormDestroy(Sender: TObject);
  73.     procedure SpeedEditChange(Sender: TObject);
  74.     procedure OpenFlicFile(AFilename: string);
  75.     procedure Open1Click(Sender: TObject);
  76.     procedure XEditChange(Sender: TObject);
  77.     procedure YEditChange(Sender: TObject);
  78.     procedure Associate1Click(Sender: TObject);
  79.     procedure NotifyCheckBoxClick(Sender: TObject);
  80.     procedure LoopPlayClick(Sender: TObject);
  81.     procedure NotifyCancelButtonClick(Sender: TObject);
  82.     procedure Exitprogram1Click(Sender: TObject);
  83.     procedure Help2Click(Sender: TObject);
  84.     procedure Button1Click(Sender: TObject);
  85.     procedure Button2Click(Sender: TObject);
  86.     procedure Button3Click(Sender: TObject);
  87.     procedure Button4Click(Sender: TObject);
  88.     procedure Button5Click(Sender: TObject);
  89.     procedure Button6Click(Sender: TObject);
  90.     procedure Button7Click(Sender: TObject);
  91.     procedure Button8Click(Sender: TObject);
  92.   private
  93.     { Private declarations }
  94.     SoundLoops: integer;
  95.     SoundPtrs: array[1..10] of PChar;
  96.     SoundFlags: array[1..10] of Boolean;
  97.   public
  98.     { Public declarations }
  99.    protected
  100.     { Protected declarations }
  101.     procedure WndProc(var Message: TMessage); override;
  102.   end;
  103.  
  104. var
  105.   Form1: TForm1;
  106.   { The following two are needed because trying to access the message
  107.       numbers in the flic panel component in a form's WndProc
  108.       causes a GPF when WndProc is called during form (and hence
  109.       flic panel) creation: }
  110.    NotifyMessageNum: word;
  111.    StopMessageNum: word;
  112.    FrameMessageNum: word;
  113.    RedimMessageNum: word;
  114.  
  115. { ------------------------------------------------------------------------- }
  116. implementation
  117.  
  118. {$R *.DFM}
  119.  
  120. { ------------------------------------------------------------------------- }
  121. procedure TForm1.FormCreate(Sender: TObject);
  122.  
  123. var
  124.    tempp: integer;
  125.  
  126. begin
  127.  
  128.    for tempp := 1 to 10 do
  129.       begin
  130.       GetMem(SoundPtrs[tempp], SYSTEM_PATH_LENGTH);
  131.       end;
  132.  
  133.    for tempp := 1 to 10 do
  134.       begin
  135.       SoundFlags[tempp] := FALSE;
  136.       end;
  137.  
  138. end;
  139.  
  140. { ------------------------------------------------------------------------- }
  141. procedure TForm1.FormDestroy(Sender: TObject);
  142.  
  143. var
  144.    tempp: integer;
  145.  
  146. begin
  147.  
  148.    for tempp := 1 to 10 do
  149.       begin
  150.       FreeMem(SoundPtrs[tempp], SYSTEM_PATH_LENGTH);
  151.       end;
  152.  
  153. end;
  154.  
  155. { ------------------------------------------------------------------------- }
  156. procedure TForm1.Open1Click(Sender: TObject);
  157.  
  158. begin
  159.  
  160.    if OpenDialog1.Execute then
  161.       begin
  162.       OpenFlicFile(OpenDialog1.Filename);
  163.       Open1.enabled := FALSE;
  164.       end;
  165.  
  166. end;
  167.  
  168. { ------------------------------------------------------------------------- }
  169. procedure TForm1.OpenFlicFile(AFilename: string);
  170.  
  171. var
  172.    tempstr: string[12];
  173.  
  174. begin
  175.    form2.Enabled := TRUE;
  176.    form2.visible := TRUE;
  177.    { If these are in Form1's constructor, causes GPF }
  178.    NotifyMessageNum := form2.flicpanel1.NotifyMessageNum;
  179.    StopMessageNum := form2.flicpanel1.StopMessageNum;
  180.    FrameMessageNum := form2.flicpanel1.FrameMessageNum;
  181.    RedimMessageNum := form2.flicpanel1.RedimMessageNum;
  182.  
  183.    with form2.flicpanel1 do
  184.       begin
  185.       FileName := AFileName;
  186.       CallbackHandle := Form1.handle;
  187. //      Stretchable := TRUE;
  188.       Open;
  189.       str(FlicWidth, tempstr);
  190.       WidthValue.Text := tempstr;
  191.       str(FlicHeight, tempstr);
  192.       HeightValue.Text := tempstr;
  193.       str(FlicFrames, tempstr);
  194.       FramesValue.Text := tempstr;
  195.       str(DesignSpeed, tempstr);
  196.       SpeedValue.Text := tempstr;
  197.       SpeedEdit.Value := Speed;
  198.       SpeedEdit.Enabled := TRUE;
  199.       XEdit.Enabled := TRUE;
  200.       YEdit.Enabled := TRUE;
  201.       Gauge1.progress := 1;
  202.       FramePanel.Caption := '1';
  203.       LoopPanel.Caption := '1';
  204.       Gauge1.maxvalue := FlicFrames;
  205.       Associate1.enabled := TRUE;
  206.       LoopPlay.Enabled := TRUE;           { turn on play looping menu }
  207.       X := 4;                             { to let the panel border show }
  208.       Y := 4;
  209.       PlayLoops := 0;                     { play animation once }
  210.       PlayFrames := FlicFrames;
  211.       end;
  212.  
  213. //   form2.flicpanel1.width := form2.flicpanel1.flicwidth * 2;
  214. //   form2.flicpanel1.paint;
  215.    form2.Width := form2.flicpanel1.Width + 16;
  216.    form2.Height := form2.flicpanel1.Height + 33;
  217.    form2.Caption := ExtractFilename(AFilename);
  218.    CheckBox1.Enabled := TRUE;
  219.    CheckBox2.Enabled := TRUE;
  220.    CheckBox3.Enabled := TRUE;
  221.    CheckBox4.Enabled := TRUE;
  222.    CheckBox5.Enabled := TRUE;
  223.    CheckBox6.Enabled := TRUE;
  224.    CheckBox7.Enabled := TRUE;
  225.    CheckBox8.Enabled := TRUE;
  226.    CheckBox9.Enabled := TRUE;
  227.    CheckBox10.Enabled := TRUE;
  228.    Associate1.Enabled := TRUE;      { turn on sound association button }
  229. end;
  230.  
  231. { ------------------------------------------------------------------------- }
  232. procedure TForm1.SpeedEditChange(Sender: TObject);
  233.  
  234. begin
  235.    form2.flicpanel1.Speed := SpeedEdit.Value;
  236. end;
  237.  
  238.  
  239. { ------------------------------------------------------------------------- }
  240. procedure TForm1.Associate1Click(Sender: TObject);
  241.  
  242. begin
  243.  
  244.    if OpenDialog2.Execute then
  245.       begin
  246.       form2.flicpanel1.Sound := OpenDialog2.Filename;
  247.       Caption := ExtractFilename(form2.flicpanel1.Filename) + ' + ' +
  248.                                     ExtractFilename(OpenDialog2.Filename);
  249.       end;
  250.  
  251. end;
  252.  
  253.  
  254. { ------------------------------------------------------------------------- }
  255. procedure TForm1.XEditChange(Sender: TObject);
  256.  
  257. var
  258.    temp, temp2: integer;
  259.  
  260. begin
  261.  
  262.    if Sender = XEdit then
  263.       begin
  264.       val(XEdit.Text, temp2, temp);
  265.  
  266.       if (temp = 0) and (temp2 > -1) then
  267.          begin
  268.          form2.flicpanel1.X := temp2;
  269.          end;
  270.  
  271.       end;
  272.  
  273. end;
  274.  
  275. { ------------------------------------------------------------------------- }
  276. procedure TForm1.YEditChange(Sender: TObject);
  277.  
  278. var
  279.    temp, temp2: integer;
  280.  
  281. begin
  282.  
  283.    if Sender = YEdit then
  284.       begin
  285.       val(YEdit.Text, temp2, temp);
  286.  
  287.       if (temp = 0) and (temp2 > -1) then
  288.          begin
  289.          form2.flicpanel1.Y := temp2;
  290.          end;
  291.  
  292.       end;
  293.  
  294. end;
  295.  
  296.  
  297. { ------------------------------------------------------------------------- }
  298. procedure TForm1.NotifyCheckBoxClick(Sender: TObject);
  299.  
  300. var
  301.    temp, temp2: integer;
  302.  
  303. begin
  304.    val(TCheckBox(Sender).Caption, temp2, temp);
  305.  
  306.    if ((SoundFlags[temp2] = FALSE) and (form2.flicpanel1.FlicLoaded = TRUE)) then
  307.       begin
  308.  
  309.       if OpenDialog3.Execute then
  310.          begin
  311.  
  312.          with form2.flicpanel1 do
  313.             Notify(0, CurrentFrame, temp2);
  314.  
  315.          SoundPtrs[temp2] := StrPLCopy(SoundPtrs[temp2], OpenDialog3.Filename,
  316.                                                       SYSTEM_PATH_LENGTH);
  317.          TCheckBox(Sender).Enabled := FALSE;
  318.          SoundFlags[temp2] := TRUE;
  319.          end
  320.       else
  321.          begin
  322.          TCheckBox(Sender).Checked := FALSE;   { user cancelled }
  323.          end;
  324.  
  325.       end;
  326.  
  327. end;
  328.  
  329. { ------------------------------------------------------------------------- }
  330. procedure TForm1.LoopPlayClick(Sender: TObject);
  331.  
  332. begin
  333.  
  334.    if LoopPlay.Checked = TRUE then
  335.       begin
  336.       form2.flicpanel1.PlayFrames := form2.flicpanel1.FlicFrames;
  337.       form2.flicpanel1.PlayLoops := 0;
  338.       LoopPlay.Checked := FALSE;
  339.       end
  340.    else
  341.       begin
  342.       form2.flicpanel1.PlayLoops := 0;
  343.       form2.flicpanel1.PlayFrames := 0;
  344.       LoopPlay.Checked := TRUE;
  345.       end;
  346.  
  347. end;
  348.  
  349. { ------------------------------------------------------------------------- }
  350. procedure TForm1.NotifyCancelButtonClick(Sender: TObject);
  351.  
  352. var
  353.    tempp: integer;
  354.  
  355. begin
  356.  
  357.    if (form2.flicpanel1.FlicLoaded = TRUE) then
  358.       begin
  359.       form2.flicpanel1.CancelAll;
  360.       CheckBox1.Enabled := FALSE;
  361.       CheckBox2.Enabled := FALSE;
  362.       CheckBox3.Enabled := FALSE;
  363.       CheckBox4.Enabled := FALSE;
  364.       CheckBox5.Enabled := FALSE;
  365.       CheckBox6.Enabled := FALSE;
  366.       CheckBox7.Enabled := FALSE;
  367.       CheckBox8.Enabled := FALSE;
  368.       CheckBox9.Enabled := FALSE;
  369.       CheckBox10.Enabled := FALSE;
  370.       CheckBox1.Checked := FALSE;
  371.       CheckBox2.Checked := FALSE;
  372.       CheckBox3.Checked := FALSE;
  373.       CheckBox4.Checked := FALSE;
  374.       CheckBox5.Checked := FALSE;
  375.       CheckBox6.Checked := FALSE;
  376.       CheckBox7.Checked := FALSE;
  377.       CheckBox8.Checked := FALSE;
  378.       CheckBox9.Checked := FALSE;
  379.       CheckBox10.Checked := FALSE;
  380.       CheckBox1.Enabled := TRUE;
  381.       CheckBox2.Enabled := TRUE;
  382.       CheckBox3.Enabled := TRUE;
  383.       CheckBox4.Enabled := TRUE;
  384.       CheckBox5.Enabled := TRUE;
  385.       CheckBox6.Enabled := TRUE;
  386.       CheckBox7.Enabled := TRUE;
  387.       CheckBox8.Enabled := TRUE;
  388.       CheckBox9.Enabled := TRUE;
  389.       CheckBox10.Enabled := TRUE;
  390.       end;
  391.  
  392.    for tempp := 1 to 10 do
  393.       begin
  394.       SoundFlags[tempp] := FALSE;
  395.       end;
  396.  
  397. end;
  398.  
  399. { ------------------------------------------------------------------------- }
  400. procedure TForm1.Exitprogram1Click(Sender: TObject);
  401.  
  402. begin
  403.    Application.Terminate;
  404. end;
  405.  
  406. { ------------------------------------------------------------------------- }
  407. procedure TForm1.Help2Click(Sender: TObject);
  408.  
  409. var
  410.    tempb: bool;
  411.  
  412. begin
  413.    tempb := WinHelp(Form1.handle, 'flicpanel.hlp', HELP_CONTENTS, 0);
  414. end;
  415.  
  416. { ------------------------------------------------------------------------- }
  417. procedure TForm1.WndProc(var Message: TMessage);
  418.  
  419. var
  420.    retcode: boolean;
  421.  
  422. begin
  423.  
  424.    with Message do
  425.       begin
  426.  
  427.       if Msg = NotifyMessageNum then
  428.          begin
  429.  
  430.          if (lParam > 0) and (lParam < 11) then
  431.             begin
  432.             retcode := sndPlaySound(SoundPtrs[lParam], SND_ASYNC + SND_NODEFAULT);
  433.             end;
  434.  
  435.          end
  436.       else
  437.          begin
  438.  
  439.          if Msg = StopMessageNum then
  440.             begin
  441.             if SoundFlags[1] = FALSE then
  442.                CheckBox1.Enabled := TRUE;
  443.             if SoundFlags[2] = FALSE then
  444.                CheckBox2.Enabled := TRUE;
  445.             if SoundFlags[3] = FALSE then
  446.                CheckBox3.Enabled := TRUE;
  447.             if SoundFlags[4] = FALSE then
  448.                CheckBox4.Enabled := TRUE;
  449.             if SoundFlags[5] = FALSE then
  450.                CheckBox5.Enabled := TRUE;
  451.             if SoundFlags[6] = FALSE then
  452.                CheckBox6.Enabled := TRUE;
  453.             if SoundFlags[7] = FALSE then
  454.                CheckBox7.Enabled := TRUE;
  455.             if SoundFlags[8] = FALSE then
  456.                CheckBox8.Enabled := TRUE;
  457.             if SoundFlags[9] = FALSE then
  458.                CheckBox9.Enabled := TRUE;
  459.             if SoundFlags[10] = FALSE then
  460.                CheckBox10.Enabled := TRUE;
  461.            end
  462.          else
  463.             begin
  464.  
  465.             if Msg = FrameMessageNum then
  466.                begin
  467.  
  468.                with form2.flicpanel1 do
  469.                   begin
  470.                   Gauge1.progress := lParam;
  471.                   Form1.FramePanel.Caption := inttostr(lParam);
  472.                   Form1.LoopPanel.Caption := inttostr(wParam);
  473.                   end;
  474.  
  475.                end//if Msg = FrameMessageNum
  476.             else
  477.                begin
  478.  
  479.                if Msg = RedimMessageNum then
  480.                   begin
  481.                   messagedlg('Notification array has redimensioned.'+#13+'New size is '+
  482.                               inttostr(lParam),mtInformation,[mbOK],0);
  483.                   end;
  484.  
  485.                end;
  486.  
  487.             end;
  488.  
  489.          end;
  490.  
  491.       end;
  492.  
  493.    inherited WndProc(Message);
  494. end;
  495.  
  496. { ------------------------------------------------------------------------- }
  497. procedure TForm1.Button1Click(Sender: TObject);
  498.  
  499. begin
  500.    form2.flicpanel1.Play;
  501.    CheckBox1.Enabled := FALSE;
  502.    CheckBox2.Enabled := FALSE;
  503.    CheckBox3.Enabled := FALSE;
  504.    CheckBox4.Enabled := FALSE;
  505.    CheckBox5.Enabled := FALSE;
  506.    CheckBox6.Enabled := FALSE;
  507.    CheckBox7.Enabled := FALSE;
  508.    CheckBox8.Enabled := FALSE;
  509.    CheckBox9.Enabled := FALSE;
  510.    CheckBox10.Enabled := FALSE;
  511. end;
  512.  
  513. { ------------------------------------------------------------------------- }
  514. procedure TForm1.Button2Click(Sender: TObject);
  515.  
  516. var
  517.    tempstr: string;
  518.  
  519. begin
  520.  
  521.    if form2.flicpanel1.status = AA_PLAYING then
  522.       begin
  523.       form2.flicpanel1.Pause;
  524.  
  525.          if SoundFlags[1] = FALSE then
  526.             CheckBox1.Enabled := TRUE;
  527.          if SoundFlags[2] = FALSE then
  528.             CheckBox2.Enabled := TRUE;
  529.          if SoundFlags[3] = FALSE then
  530.             CheckBox3.Enabled := TRUE;
  531.          if SoundFlags[4] = FALSE then
  532.             CheckBox4.Enabled := TRUE;
  533.          if SoundFlags[5] = FALSE then
  534.             CheckBox5.Enabled := TRUE;
  535.          if SoundFlags[6] = FALSE then
  536.             CheckBox6.Enabled := TRUE;
  537.          if SoundFlags[7] = FALSE then
  538.             CheckBox7.Enabled := TRUE;
  539.          if SoundFlags[8] = FALSE then
  540.             CheckBox8.Enabled := TRUE;
  541.          if SoundFlags[9] = FALSE then
  542.             CheckBox9.Enabled := TRUE;
  543.          if SoundFlags[10] = FALSE then
  544.             CheckBox10.Enabled := TRUE;
  545.          Gauge1.progress := form2.flicpanel1.CurrentFrame;
  546.          str(form2.flicpanel1.CurrentFrame, tempstr);
  547.          FramePanel.Caption := tempstr;
  548.          str(form2.flicpanel1.CurrentLoop, tempstr);
  549.          LoopPanel.Caption := tempstr;
  550.       end
  551.    else
  552.  
  553.       if form2.flicpanel1.status = AA_PAUSED then
  554.          begin
  555.       form2.flicpanel1.Resume;
  556.  
  557.             CheckBox1.Enabled := FALSE;
  558.             CheckBox2.Enabled := FALSE;
  559.             CheckBox3.Enabled := FALSE;
  560.             CheckBox4.Enabled := FALSE;
  561.             CheckBox5.Enabled := FALSE;
  562.             CheckBox6.Enabled := FALSE;
  563.             CheckBox7.Enabled := FALSE;
  564.             CheckBox8.Enabled := FALSE;
  565.             CheckBox9.Enabled := FALSE;
  566.             CheckBox10.Enabled := FALSE;
  567.          end;
  568.  
  569. end;
  570.  
  571. { ------------------------------------------------------------------------- }
  572. procedure TForm1.Button3Click(Sender: TObject);
  573.  
  574. var
  575.    tempstr: string;
  576.  
  577. begin
  578.          form2.flicpanel1.Stop;
  579.  
  580.          if SoundFlags[1] = FALSE then
  581.             CheckBox1.Enabled := TRUE;
  582.          if SoundFlags[2] = FALSE then
  583.             CheckBox2.Enabled := TRUE;
  584.          if SoundFlags[3] = FALSE then
  585.             CheckBox3.Enabled := TRUE;
  586.          if SoundFlags[4] = FALSE then
  587.             CheckBox4.Enabled := TRUE;
  588.          if SoundFlags[5] = FALSE then
  589.             CheckBox5.Enabled := TRUE;
  590.          if SoundFlags[6] = FALSE then
  591.             CheckBox6.Enabled := TRUE;
  592.          if SoundFlags[7] = FALSE then
  593.             CheckBox7.Enabled := TRUE;
  594.          if SoundFlags[8] = FALSE then
  595.             CheckBox8.Enabled := TRUE;
  596.          if SoundFlags[9] = FALSE then
  597.             CheckBox9.Enabled := TRUE;
  598.          if SoundFlags[10] = FALSE then
  599.             CheckBox10.Enabled := TRUE;
  600.          Gauge1.progress := form2.flicpanel1.CurrentFrame;
  601.          str(form2.flicpanel1.CurrentFrame, tempstr);
  602.          FramePanel.Caption := tempstr;
  603.          str(form2.flicpanel1.CurrentLoop, tempstr);
  604.          LoopPanel.Caption := tempstr;
  605. end;
  606.  
  607. { ------------------------------------------------------------------------- }
  608. procedure TForm1.Button4Click(Sender: TObject);
  609.  
  610. var
  611.    tempstr:string;
  612.  
  613. begin
  614.          form2.flicpanel1.Previous;
  615.          str(form2.flicpanel1.CurrentFrame, tempstr);
  616.          FramePanel.Caption := tempstr;
  617.          str(form2.flicpanel1.CurrentLoop, tempstr);
  618.          LoopPanel.Caption := tempstr;
  619.          Gauge1.progress := form2.flicpanel1.CurrentFrame;
  620. end;
  621.  
  622. { ------------------------------------------------------------------------- }
  623. procedure TForm1.Button5Click(Sender: TObject);
  624.  
  625. var
  626.    tempstr: string;
  627.  
  628. begin
  629.          form2.flicpanel1.Back;
  630.          str(form2.flicpanel1.CurrentFrame, tempstr);
  631.          FramePanel.Caption := tempstr;
  632.          str(form2.flicpanel1.CurrentLoop, tempstr);
  633.          LoopPanel.Caption := tempstr;
  634.          Gauge1.progress := form2.flicpanel1.CurrentFrame;
  635. end;
  636.  
  637. { ------------------------------------------------------------------------- }
  638. procedure TForm1.Button6Click(Sender: TObject);
  639.  
  640. var
  641.    tempstr: string;
  642.    
  643. begin
  644.          form2.flicpanel1.Step;
  645.          str(form2.flicpanel1.CurrentFrame, tempstr);
  646.          FramePanel.Caption := tempstr;
  647.          str(form2.flicpanel1.CurrentLoop, tempstr);
  648.          LoopPanel.Caption := tempstr;
  649.          Gauge1.progress := form2.flicpanel1.CurrentFrame;
  650. end;
  651.  
  652. { ------------------------------------------------------------------------- }
  653. procedure TForm1.Button7Click(Sender: TObject);
  654.  
  655. var
  656.    tempstr: string;
  657.  
  658. begin
  659.          form2.flicpanel1.Next;
  660.          str(form2.flicpanel1.CurrentFrame, tempstr);
  661.          FramePanel.Caption := tempstr;
  662.          str(form2.flicpanel1.CurrentLoop, tempstr);
  663.          LoopPanel.Caption := tempstr;
  664.          Gauge1.progress := form2.flicpanel1.CurrentFrame;
  665. end;
  666.  
  667. { ------------------------------------------------------------------------- }
  668. procedure TForm1.Button8Click(Sender: TObject);
  669.  
  670. var
  671.    tempp: integer;
  672.  
  673. begin
  674.          form2.flicpanel1.Eject;
  675.          WidthValue.Text := '';
  676.          HeightValue.Text := '';
  677.          FramesValue.Text := '';
  678.          SpeedValue.Text := '';
  679.          SpeedEdit.Value := 0;
  680.          XEdit.Text := '4';
  681.          YEdit.Text := '4';
  682.          SpeedEdit.Enabled := FALSE;
  683.          XEdit.Enabled := FALSE;
  684.          YEdit.Enabled := FALSE;
  685.          Gauge1.Progress := 0;
  686.          FramePanel.Caption := '';
  687.          LoopPanel.Caption := '';
  688.          form2.Enabled := FALSE;
  689.          form2.Visible := FALSE;
  690.          Associate1.Enabled := FALSE;     // disable associate sound menu
  691.          LoopPlay.Checked := FALSE;       // turn off play looping menu
  692.          LoopPlay.Enabled := FALSE;       // turn off play looping menu 
  693.          CheckBox1.Checked := FALSE;
  694.          CheckBox2.Checked := FALSE;
  695.          CheckBox3.Checked := FALSE;
  696.          CheckBox4.Checked := FALSE;
  697.          CheckBox5.Checked := FALSE;
  698.          CheckBox6.Checked := FALSE;
  699.          CheckBox7.Checked := FALSE;
  700.          CheckBox8.Checked := FALSE;
  701.          CheckBox9.Checked := FALSE;
  702.          CheckBox10.Checked := FALSE;
  703.          CheckBox1.Enabled := FALSE;
  704.          CheckBox2.Enabled := FALSE;
  705.          CheckBox3.Enabled := FALSE;
  706.          CheckBox4.Enabled := FALSE;
  707.          CheckBox5.Enabled := FALSE;
  708.          CheckBox6.Enabled := FALSE;
  709.          CheckBox7.Enabled := FALSE;
  710.          CheckBox8.Enabled := FALSE;
  711.          CheckBox9.Enabled := FALSE;
  712.          CheckBox10.Enabled := FALSE;
  713.          Open1.enabled := TRUE;
  714.  
  715.          for tempp := 1 to 10 do
  716.             begin
  717.             SoundFlags[tempp] := FALSE;
  718.             end;
  719.  
  720. end;
  721.  
  722.  
  723. end.
  724. { ------------------------------------------------------------------------- }
  725.  
  726.