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/UPlaylist.pas

    r352 r353  
    1313  end;
    1414
    15   { TPlaylist }
     15  { TPlayList }
    1616
    17   TPlaylist = class(TComponent)
     17  TPlayList = class(TComponent)
     18  private
     19    FRandomOrder: Boolean;
     20    FRepeatInfinitely: Boolean;
    1821  public
    19     Player: TPlayer;
    20     Items: TObjectList; // TObjectList<TPlaylistItem>
    21     RandomOrder: Boolean;
    22     RepeatInfinitely: Boolean;
    2322    CurrentIndex: Integer;
    2423    procedure AddFile(FileName: string);
     
    2928    constructor Create(AOwner: TComponent);
    3029    destructor Destroy; override;
     30  published
     31    Player: TMediaPlayer;
     32    Items: TObjectList; // TObjectList<TPlaylistItem>
     33    property RandomOrder: Boolean read FRandomOrder write FRandomOrder;
     34    property RepeatInfinitely: Boolean read FRepeatInfinitely
     35      write FRepeatInfinitely;
    3136  end;
    3237
     
    3439implementation
    3540
    36 { TPlaylist }
     41{ TPlayList }
    3742
    38 procedure TPlaylist.AddFile(FileName: string);
     43procedure TPlayList.AddFile(FileName: string);
    3944var
    4045  NewItem: TPlaylistItem;
     
    4550end;
    4651
    47 procedure TPlaylist.Shuffle;
     52procedure TPlayList.Shuffle;
    4853begin
    4954
    5055end;
    5156
    52 procedure TPlaylist.Play;
     57procedure TPlayList.Play;
    5358begin
    5459  Player.FileName := TPlaylistItem(Items[CurrentIndex]).FileName;
     
    5661end;
    5762
    58 procedure TPlaylist.PlayNext;
     63procedure TPlayList.PlayNext;
    5964begin
    6065  Inc(CurrentIndex);
     
    6772end;
    6873
    69 procedure TPlaylist.PlayPrevious;
     74procedure TPlayList.PlayPrevious;
    7075begin
    7176  Dec(CurrentIndex);
     
    7681end;
    7782
    78 constructor TPlaylist.Create(AOwner: TComponent);
     83constructor TPlayList.Create(AOwner: TComponent);
    7984begin
    8085  inherited;
     
    8287end;
    8388
    84 destructor TPlaylist.Destroy;
     89destructor TPlayList.Destroy;
    8590begin
    8691  Items.Free;
Note: See TracChangeset for help on using the changeset viewer.