Ignore:
Timestamp:
Mar 26, 2024, 11:37:40 PM (7 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from CoolAudio unit names.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • CoolAudio/Demo/FormPlaylist.pas

    r568 r569  
    1 unit UFormPlaylist;
    2 
    3 {$mode objfpc}{$H+}
     1unit FormPlaylist;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, Menus, ActnList, UPlaylist;
     7  ComCtrls, Menus, ActnList, Playlist;
    108
    119type
     
    4745    procedure ListView1DblClick(Sender: TObject);
    4846    procedure ListView1KeyPress(Sender: TObject; var Key: char);
    49   private
    50     { private declarations }
    5147  public
    5248    procedure ReloadList;
     
    6157
    6258uses
    63   UAudioSystem, UFormMain;
     59  AudioSystem, FormMain;
    6460
    6561resourcestring
     
    7672procedure TFormPlaylist.AClearAllExecute(Sender: TObject);
    7773begin
    78   FormMain.PlayList.Items.Clear;
     74  FormMain.FormMain.PlayList.Items.Clear;
    7975  ReloadList;
    8076end;
     
    8480  I: Integer;
    8581begin
    86   with FormMain.PlayList, Items do begin
     82  with FormMain.FormMain.PlayList, Items do begin
    8783    for I := Count - 1 downto 0 do
    8884      if ListView1.Items[I].Selected then Delete(I);
     
    9490procedure TFormPlaylist.AItemPlayExecute(Sender: TObject);
    9591begin
    96   FormMain.PlayList.CurrentIndex := ListView1.Selected.Index;
    97   FormMain.PlayList.Play;
     92  FormMain.FormMain.PlayList.CurrentIndex := ListView1.Selected.Index;
     93  FormMain.FormMain.PlayList.Play;
    9894end;
    9995
     
    112108          NewItem := TPlaylistItem.Create;
    113109          NewItem.FileName := Dir + DirectorySeparator + sr.Name;
    114           FormMain.PlayList.Items.Add(NewItem);
     110          FormMain.FormMain.PlayList.Items.Add(NewItem);
    115111        end;
    116112      until FindNext(sr) <> 0;
     
    124120begin
    125121  if OpenDialog1.Execute then begin
    126     FormMain.PlayList.AddFile(OpenDialog1.FileName);
     122    FormMain.FormMain.PlayList.AddFile(OpenDialog1.FileName);
    127123    ReloadList;
    128124  end;
     
    145141procedure TFormPlaylist.ListView1Data(Sender: TObject; Item: TListItem);
    146142begin
    147   if (Item.Index >= 0) and (Item.Index < FormMain.PlayList.Items.Count) then
    148   with TPlaylistItem(FormMain.PlayList.Items[Item.Index]) do begin
     143  if (Item.Index >= 0) and (Item.Index < FormMain.FormMain.PlayList.Items.Count) then
     144  with TPlaylistItem(FormMain.FormMain.PlayList.Items[Item.Index]) do begin
    149145    Item.Caption := FileName;
    150     Item.Data := FormMain.PlayList.Items[Item.Index];
     146    Item.Data := FormMain.FormMain.PlayList.Items[Item.Index];
    151147  end;
    152148end;
     
    164160procedure TFormPlaylist.ReloadList;
    165161begin
    166   ListView1.Items.Count := FormMain.PlayList.Items.Count;
     162  ListView1.Items.Count := FormMain.FormMain.PlayList.Items.Count;
    167163  ListView1.Refresh;
    168164  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;
     165  if (FormMain.FormMain.PlayList.CurrentIndex >= 0) and
     166    (FormMain.FormMain.PlayList.CurrentIndex < ListView1.Items.Count) then
     167    ListView1.Items[FormMain.FormMain.PlayList.CurrentIndex].Selected := True;
    172168  UpdateInterface;
    173169end;
     
    178174  AItemPlay.Enabled := Assigned(ListView1.Selected);
    179175  AClearAll.Enabled := ListView1.Items.Count > 0;
    180   CheckBoxRandom.Checked := FormMain.PlayList.RandomOrder;
    181   CheckBoxRepeat.Checked := FormMain.PlayList.RepeatInfinitely;
     176  CheckBoxRandom.Checked := FormMain.FormMain.PlayList.RandomOrder;
     177  CheckBoxRepeat.Checked := FormMain.FormMain.PlayList.RepeatInfinitely;
    182178end;
    183179
Note: See TracChangeset for help on using the changeset viewer.