home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 November / CDVD1105.ISO / Software / Freeware / programare / bass / Delphi / multi / Unit2.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2004-12-03  |  1.1 KB  |  58 lines

  1. unit Unit2;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, Bass;
  8.  
  9. type
  10.   TForm2 = class(TForm)
  11.     ListBox1: TListBox;
  12.     Button1: TButton;
  13.     procedure Button1Click(Sender: TObject);
  14.     procedure FormCreate(Sender: TObject);
  15.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  16.     procedure FormDestroy(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. var
  24.   Form2: TForm2;
  25.  
  26. implementation
  27.  
  28. {$R *.dfm}
  29.  
  30. procedure TForm2.Button1Click(Sender: TObject);
  31. begin
  32.   Form2.ModalResult := ListBox1.ItemIndex + 1;
  33. end;
  34.  
  35. procedure TForm2.FormCreate(Sender: TObject);
  36. var
  37.   i: Integer;
  38. begin
  39.   i := 1;
  40.   while (BASS_GetDeviceDescription(i) <> nil) do
  41.   begin
  42.     ListBox1.Items.Add(BASS_GetDeviceDescription(i));
  43.     i := i + 1;
  44.   end;
  45. end;
  46.  
  47. procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
  48. begin
  49.   Action := caFree;
  50. end;
  51.  
  52. procedure TForm2.FormDestroy(Sender: TObject);
  53. begin
  54.   Form2 := nil;
  55. end;
  56.  
  57. end.
  58.