Changeset 347 for CoolAudio


Ignore:
Timestamp:
Apr 20, 2012, 12:14:51 PM (13 years ago)
Author:
chronos
Message:
  • Modified: CoolAudio will be used as components in component palette.
Location:
CoolAudio
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CoolAudio/Systems/UAudioSystem.pas

    r284 r347  
    11unit UAudioSystem;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
     
    2020    procedure SetOutputMode(AValue: TOutputDriver); virtual;
    2121  public
    22     constructor Create; virtual;
     22    constructor Create(AOwner: TComponent); override;
    2323    destructor Destroy; override;
    2424    property OutputMode: TOutputDriver read FOutputDriver write SetOutputMode;
     
    6060    property Playing: Boolean read FPlaying write SetPlaying;
    6161    property Active: Boolean read FActive write SetActive;
    62     constructor Create; virtual;
     62    constructor Create(AOwner: TComponent); override;
    6363    destructor Destroy; override;
    6464  end;
     
    7676  { TAudioSystemManager }
    7777
    78   TAudioSystemManager = class
     78  TAudioSystemManager = class(TComponent)
    7979    Systems: TObjectList; // TListObject<TAudioSystem>
    8080    procedure Register(Name: string; SystemClass: TAudioSystemClass;
    8181      PlayerClass: TPlayerClass);
    8282    procedure FillStringList(StringList: TStrings);
    83     constructor Create;
     83    function SearchByName(Name: string): TAudioSystemManagerItem;
     84    constructor Create(AOwner: TComponent); override;
    8485    destructor Destroy; override;
    8586  end;
     
    104105  with TAudioSystemManagerItem(Systems[I]) do
    105106    StringList.AddObject(Name, Systems[I]);
     107end;
     108
     109function TAudioSystemManager.SearchByName(Name: string): TAudioSystemManagerItem;
     110var
     111  I: Integer;
     112begin
     113  I := 0;
     114  while (I < Systems.Count) and (TAudioSystemManagerItem(Systems[I]).Name <> Name) do Inc(I);
     115  if I < Systems.Count then Result := TAudioSystemManagerItem(Systems[I])
     116    else Result := nil;
    106117end;
    107118
     
    118129end;
    119130
    120 constructor TAudioSystemManager.Create;
    121 begin
     131constructor TAudioSystemManager.Create(AOwner: TComponent);
     132begin
     133  inherited;
    122134  Systems := TObjectList.Create;
    123135end;
     
    205217end;
    206218
    207 constructor TPlayer.Create;
    208 begin
     219constructor TPlayer.Create(AOwner: TComponent);
     220begin
     221  inherited;
    209222end;
    210223
     
    223236end;
    224237
    225 constructor TAudioSystem.Create;
    226 begin
     238constructor TAudioSystem.Create(AOwner: TComponent);
     239begin
     240  inherited;
    227241  {$IFDEF Windows}
    228242  FOutputDriver := omWin32;
  • CoolAudio/Systems/UAudioSystemFMOD.pas

    r276 r347  
    1616    procedure SetOutputMode(AValue: TOutputDriver); override;
    1717  public
    18     constructor Create; override;
     18    constructor Create(AOwner: TComponent); override;
    1919    destructor Destroy; override;
    2020  end;
     
    5656end;
    5757
    58 constructor TAudioSystemFMOD.Create;
     58constructor TAudioSystemFMOD.Create(AOwner: TComponent);
    5959begin
    60   inherited Create;
     60  inherited;
    6161  fmod_load('');
    6262  OutputMode := omALSA;
  • CoolAudio/Systems/UAudioSystemMPlayer.pas

    r284 r347  
    2727  public
    2828    function FindPath: string;
    29     constructor Create; override;
     29    constructor Create(AOwner: TComponent); override;
    3030    destructor Destroy; override;
    3131    property Path: string read FPath write FPath;
     
    5252    procedure Pause; override;
    5353    procedure Stop; override;
    54     constructor Create; override;
     54    constructor Create(AOwner: TComponent); override;
    5555    destructor Destroy; override;
    5656  end;
     
    115115end;
    116116
    117 constructor TAudioSystemMPlayer.Create;
    118 begin
    119   inherited Create;
     117constructor TAudioSystemMPlayer.Create(AOwner: TComponent);
     118begin
     119  inherited;
    120120  FPath := FindPath;
    121121end;
     
    290290end;
    291291
    292 constructor TPlayerMPlayer.Create;
    293 begin
    294   inherited Create;
     292constructor TPlayerMPlayer.Create(AOwner: TComponent);
     293begin
     294  inherited;
    295295  FProcess := TProcess.Create(nil);
    296296end;
  • CoolAudio/Systems/UAudioSystemWindows.pas

    r285 r347  
    4646    procedure Pause; override;
    4747    procedure Stop; override;
    48     constructor Create; override;
     48    constructor Create(AOwner: TComponent); override;
    4949    destructor Destroy; override;
    5050    property DeviceType: TMPDeviceTypes read FDeviceType write SetDeviceType;
     
    202202end;
    203203
    204 constructor TPlayerWindows.Create;
    205 begin
    206   inherited Create;
     204constructor TPlayerWindows.Create(AOwner: TComponent);
     205begin
     206  inherited;
    207207end;
    208208
  • CoolAudio/UCoolAudio.pas

    r279 r347  
    3131initialization
    3232
    33 AudioSystemManager := TAudioSystemManager.Create;
     33AudioSystemManager := TAudioSystemManager.Create(nil);
    3434{$IFDEF AudioSystemWindows}
    3535AudioSystemManager.Register('Windows', TAudioSystemWindows, TPlayerWindows);
  • CoolAudio/UPlaylist.pas

    r275 r347  
    11unit UPlaylist;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
     
    1515  { TPlaylist }
    1616
    17   TPlaylist = class
     17  TPlaylist = class(TComponent)
    1818    Items: TObjectList; // TObjectList<TPlaylistItem>
    19     constructor Create;
     19    constructor Create(AOwner: TComponent);
    2020    destructor Destroy; override;
    2121  end;
     
    2626{ TPlaylist }
    2727
    28 constructor TPlaylist.Create;
     28constructor TPlaylist.Create(AOwner: TComponent);
    2929begin
     30  inherited;
    3031  Items := TObjectList.Create;
    3132end;
Note: See TracChangeset for help on using the changeset viewer.