Ignore:
Timestamp:
Oct 5, 2011, 12:40:56 PM (13 years ago)
Author:
george
Message:
  • Added: Support for play, stop, pause, seek of Windows mmsystem backend.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • CoolAudio/Demo/UMainForm.pas

    r279 r280  
    5454begin
    5555  AudioSystemManager.FillStringList(ComboBox1.Items);
    56   AudioSystem := TAudioSystemMPlayer.Create;
    57   TAudioSystemMPlayer(AudioSystem).Path := 'c:\Program Files\SMPlayer\mplayer\mplayer.exe';
    58   TAudioSystemMPlayer(AudioSystem).Path := TAudioSystemMPlayer(AudioSystem).FindPath;
    59   Player := TPlayerMPlayer.Create;
    60   Player.AudioSystem := AudioSystem;
     56  if ComboBox1.Items.Count > 0 then
     57    ComboBox1.ItemIndex := 0;
     58  ComboBox1Change(Self);
    6159end;
    6260
    6361procedure TMainForm.FormDestroy(Sender: TObject);
    6462begin
    65   Player.Free;
    66   AudioSystem.Free;
     63  FreeAndNil(Player);
     64  FreeAndNil(AudioSystem);
    6765end;
    6866
    6967procedure TMainForm.TimerPlaybackTimer(Sender: TObject);
    7068begin
    71   if Player.Playing then begin
     69  if Assigned(Player) and Player.Playing then begin
    7270    TrackBar1.OnChange := nil;
    7371    TrackBar1.Position := Trunc(Player.Position / Player.Length * TrackBar1.Max);
     
    9694procedure TMainForm.ComboBox1Change(Sender: TObject);
    9795begin
    98   Player.Free;
    99   AudioSystem.Free;
     96  FreeAndNil(Player);
     97  FreeAndNil(AudioSystem);
    10098  if ComboBox1.ItemIndex <> - 1 then begin
    10199    with TAudioSystemManagerItem(ComboBox1.Items.Objects[ComboBox1.ItemIndex]) do begin
     
    103101      Player := PlayerClass.Create;
    104102      Player.AudioSystem := AudioSystem;
     103      //Player.Active := True;
    105104    end;
    106105  end;
Note: See TracChangeset for help on using the changeset viewer.