Ignore:
Timestamp:
Apr 23, 2012, 2:57:12 PM (13 years ago)
Author:
chronos
Message:
  • Modified: TPlayList is now registred as component in group CoolAudio in Component pallete.
  • Added: Created placeholder component TMediaPlayer which can be switched to different audio systems in runtime without destruction/construction.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • CoolAudio/Demo/UFormPlaylist.pas

    r352 r353  
    7676procedure TFormPlaylist.AClearAllExecute(Sender: TObject);
    7777begin
    78   FormMain.Playlist.Items.Clear;
     78  FormMain.PlayList.Items.Clear;
    7979  ReloadList;
    8080end;
     
    8484  I: Integer;
    8585begin
    86   with FormMain.Playlist, Items do begin
     86  with FormMain.PlayList, Items do begin
    8787    for I := Count - 1 downto 0 do
    8888      if ListView1.Items[I].Selected then Delete(I);
     
    9494procedure TFormPlaylist.AItemPlayExecute(Sender: TObject);
    9595begin
    96   FormMain.Playlist.CurrentIndex := ListView1.Selected.Index;
    97   FormMain.Playlist.Play;
     96  FormMain.PlayList.CurrentIndex := ListView1.Selected.Index;
     97  FormMain.PlayList.Play;
    9898end;
    9999
     
    112112          NewItem := TPlaylistItem.Create;
    113113          NewItem.FileName := Dir + DirectorySeparator + sr.Name;
    114           FormMain.Playlist.Items.Add(NewItem);
     114          FormMain.PlayList.Items.Add(NewItem);
    115115        end;
    116116      until FindNext(sr) <> 0;
     
    124124begin
    125125  if OpenDialog1.Execute then begin
    126     FormMain.Playlist.AddFile(OpenDialog1.FileName);
     126    FormMain.PlayList.AddFile(OpenDialog1.FileName);
    127127    ReloadList;
    128128  end;
     
    145145procedure TFormPlaylist.ListView1Data(Sender: TObject; Item: TListItem);
    146146begin
    147   if (Item.Index >= 0) and (Item.Index < FormMain.Playlist.Items.Count) then
    148   with TPlaylistItem(FormMain.Playlist.Items[Item.Index]) do begin
     147  if (Item.Index >= 0) and (Item.Index < FormMain.PlayList.Items.Count) then
     148  with TPlaylistItem(FormMain.PlayList.Items[Item.Index]) do begin
    149149    Item.Caption := FileName;
    150     Item.Data := FormMain.Playlist.Items[Item.Index];
     150    Item.Data := FormMain.PlayList.Items[Item.Index];
    151151  end;
    152152end;
     
    164164procedure TFormPlaylist.ReloadList;
    165165begin
    166   ListView1.Items.Count := FormMain.Playlist.Items.Count;
     166  ListView1.Items.Count := FormMain.PlayList.Items.Count;
    167167  ListView1.Refresh;
    168168  ListView1.Selected := nil;
    169   if (FormMain.Playlist.CurrentIndex >= 0) and
    170     (FormMain.Playlist.CurrentIndex < ListView1.Items.Count) then
    171     ListView1.Items[FormMain.Playlist.CurrentIndex].Selected := True;
     169  if (FormMain.PlayList.CurrentIndex >= 0) and
     170    (FormMain.PlayList.CurrentIndex < ListView1.Items.Count) then
     171    ListView1.Items[FormMain.PlayList.CurrentIndex].Selected := True;
    172172  UpdateInterface;
    173173end;
     
    178178  AItemPlay.Enabled := Assigned(ListView1.Selected);
    179179  AClearAll.Enabled := ListView1.Items.Count > 0;
    180   CheckBoxRandom.Checked := FormMain.Playlist.RandomOrder;
    181   CheckBoxRepeat.Checked := FormMain.Playlist.RepeatInfinitely;
     180  CheckBoxRandom.Checked := FormMain.PlayList.RandomOrder;
     181  CheckBoxRepeat.Checked := FormMain.PlayList.RepeatInfinitely;
    182182end;
    183183
Note: See TracChangeset for help on using the changeset viewer.