Changeset 278 for CoolAudio/Systems
- Timestamp:
- Oct 4, 2011, 4:12:38 PM (13 years ago)
- Location:
- CoolAudio/Systems
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolAudio/Systems/UAudioSystem.pas
r277 r278 6 6 7 7 uses 8 Classes, SysUtils ;8 Classes, SysUtils, Contnrs; 9 9 10 10 type … … 24 24 property OutputMode: TOutputDriver read FOutputDriver write SetOutputMode; 25 25 end; 26 27 TAudioSystemClass = class of TAudioSystem; 26 28 27 29 { TPlayer } … … 56 58 end; 57 59 60 TPlayerClass = class of TPlayer; 61 62 { TAudioSystemManagerItem } 63 64 TAudioSystemManagerItem = class 65 Name: string; 66 SystemClass: TAudioSystemClass; 67 PlayerClass: TPlayerClass; 68 end; 69 70 { TAudioSystemManager } 71 72 TAudioSystemManager = class 73 Systems: TObjectList; // TListObject<TAudioSystem> 74 procedure Register(Name: string; SystemClass: TAudioSystemClass; 75 PlayerClass: TPlayerClass); 76 procedure FillStringList(StringList: TStrings); 77 constructor Create; 78 destructor Destroy; override; 79 end; 80 58 81 resourcestring 59 82 SOpenOutputFailed = 'Failed opening audio output'; … … 61 84 62 85 implementation 86 87 { TAudioSystemManagerItem } 88 89 90 { TAudioSystemManager } 91 92 procedure TAudioSystemManager.FillStringList(StringList: TStrings); 93 var 94 I: Integer; 95 begin 96 StringList.Clear; 97 for I := 0 to Systems.Count - 1 do 98 with TAudioSystemManagerItem(Systems[I]) do 99 StringList.AddObject(Name, Systems[I]); 100 end; 101 102 procedure TAudioSystemManager.Register(Name: string; 103 SystemClass: TAudioSystemClass; PlayerClass: TPlayerClass); 104 var 105 NewItem: TAudioSystemManagerItem; 106 begin 107 NewItem := TAudioSystemManagerItem.Create; 108 NewItem.Name := Name; 109 NewItem.SystemClass := SystemClass; 110 NewItem.PlayerClass := PlayerClass; 111 Systems.Add(NewItem); 112 end; 113 114 constructor TAudioSystemManager.Create; 115 begin 116 Systems := TObjectList.Create; 117 end; 118 119 destructor TAudioSystemManager.Destroy; 120 begin 121 Systems.Free; 122 inherited Destroy; 123 end; 63 124 64 125 { TPlayer }
Note:
See TracChangeset
for help on using the changeset viewer.