Changeset 280 for CoolAudio/Demo/UMainForm.pas
- Timestamp:
- Oct 5, 2011, 12:40:56 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolAudio/Demo/UMainForm.pas
r279 r280 54 54 begin 55 55 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); 61 59 end; 62 60 63 61 procedure TMainForm.FormDestroy(Sender: TObject); 64 62 begin 65 Player.Free;66 AudioSystem.Free;63 FreeAndNil(Player); 64 FreeAndNil(AudioSystem); 67 65 end; 68 66 69 67 procedure TMainForm.TimerPlaybackTimer(Sender: TObject); 70 68 begin 71 if Player.Playing then begin69 if Assigned(Player) and Player.Playing then begin 72 70 TrackBar1.OnChange := nil; 73 71 TrackBar1.Position := Trunc(Player.Position / Player.Length * TrackBar1.Max); … … 96 94 procedure TMainForm.ComboBox1Change(Sender: TObject); 97 95 begin 98 Player.Free;99 AudioSystem.Free;96 FreeAndNil(Player); 97 FreeAndNil(AudioSystem); 100 98 if ComboBox1.ItemIndex <> - 1 then begin 101 99 with TAudioSystemManagerItem(ComboBox1.Items.Objects[ComboBox1.ItemIndex]) do begin … … 103 101 Player := PlayerClass.Create; 104 102 Player.AudioSystem := AudioSystem; 103 //Player.Active := True; 105 104 end; 106 105 end;
Note:
See TracChangeset
for help on using the changeset viewer.