- Timestamp:
- Oct 4, 2011, 4:12:38 PM (13 years ago)
- Location:
- CoolAudio
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolAudio/CoolAudio.lpk
r276 r278 18 18 </Other> 19 19 </CompilerOptions> 20 <Files Count="1 0">20 <Files Count="11"> 21 21 <Item1> 22 22 <Filename Value="fmodintf/fmod.pas"/> … … 44 44 </Item6> 45 45 <Item7> 46 <Filename Value="UPlaylist.pas"/> 47 <UnitName Value="UPlaylist"/> 48 </Item7> 49 <Item8> 46 50 <Filename Value="Systems/UAudioSystemFMOD.pas"/> 47 51 <UnitName Value="UAudioSystemFMOD"/> 48 </Item7>49 <Item8>50 <Filename Value="UPlaylist.pas"/>51 <UnitName Value="UPlaylist"/>52 52 </Item8> 53 53 <Item9> … … 59 59 <UnitName Value="UAudioSystem"/> 60 60 </Item10> 61 <Item11> 62 <Filename Value="Systems/UAudioSystemWindows.pas"/> 63 <UnitName Value="UAudioSystemWindows"/> 64 </Item11> 61 65 </Files> 62 66 <Type Value="RunAndDesignTime"/> -
CoolAudio/CoolAudio.pas
r275 r278 8 8 9 9 uses 10 fmod, fmoddyn, fmoderrors, fmodpresets, fmodtypes, UCoolAudio, 11 UAudioSystemFMOD, U Playlist, UAudioSystemMPlayer, UAudioSystem,10 fmod, fmoddyn, fmoderrors, fmodpresets, fmodtypes, UCoolAudio, UPlaylist, 11 UAudioSystemFMOD, UAudioSystemMPlayer, UAudioSystem, UAudioSystemWindows, 12 12 LazarusPackageIntf; 13 13 -
CoolAudio/Demo/Demo.lpi
r277 r278 38 38 </Item2> 39 39 </RequiredPackages> 40 <Units Count="2 0">40 <Units Count="22"> 41 41 <Unit0> 42 42 <Filename Value="Demo.lpr"/> 43 43 <IsPartOfProject Value="True"/> 44 44 <UnitName Value="Demo"/> 45 <UsageCount Value=" 29"/>45 <UsageCount Value="33"/> 46 46 </Unit0> 47 47 <Unit1> … … 51 51 <ResourceBaseClass Value="Form"/> 52 52 <UnitName Value="UMainForm"/> 53 <IsVisibleTab Value="True"/>54 53 <EditorIndex Value="0"/> 55 54 <WindowIndex Value="0"/> 56 <TopLine Value=" 1"/>57 <CursorPos X="1 4" Y="3"/>58 <UsageCount Value=" 29"/>55 <TopLine Value="86"/> 56 <CursorPos X="1" Y="98"/> 57 <UsageCount Value="33"/> 59 58 <Loaded Value="True"/> 60 59 <LoadedDesigner Value="True"/> … … 63 62 <Filename Value="../UCoolAudio.pas"/> 64 63 <UnitName Value="UCoolAudio"/> 65 <WindowIndex Value="0"/> 66 <TopLine Value="1"/> 67 <CursorPos X="34" Y="6"/> 68 <UsageCount Value="10"/> 64 <EditorIndex Value="6"/> 65 <WindowIndex Value="0"/> 66 <TopLine Value="24"/> 67 <CursorPos X="30" Y="39"/> 68 <UsageCount Value="11"/> 69 <Loaded Value="True"/> 69 70 </Unit2> 70 71 <Unit3> 71 72 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 72 73 <UnitName Value="UAudioSystemFMOD"/> 73 <EditorIndex Value=" 6"/>74 <WindowIndex Value="0"/> 75 <TopLine Value=" 1"/>76 <CursorPos X=" 20" Y="111"/>77 <UsageCount Value="1 4"/>74 <EditorIndex Value="10"/> 75 <WindowIndex Value="0"/> 76 <TopLine Value="47"/> 77 <CursorPos X="1" Y="61"/> 78 <UsageCount Value="16"/> 78 79 <Loaded Value="True"/> 79 80 </Unit3> … … 84 85 <TopLine Value="1"/> 85 86 <CursorPos X="29" Y="8"/> 86 <UsageCount Value="2 2"/>87 <UsageCount Value="21"/> 87 88 </Unit4> 88 89 <Unit5> 89 90 <Filename Value="../fmodintf/fmoddyn.pas"/> 90 91 <UnitName Value="fmoddyn"/> 91 <WindowIndex Value="0"/> 92 <TopLine Value="46"/> 93 <CursorPos X="10" Y="63"/> 94 <UsageCount Value="12"/> 92 <IsVisibleTab Value="True"/> 93 <EditorIndex Value="11"/> 94 <WindowIndex Value="0"/> 95 <TopLine Value="577"/> 96 <CursorPos X="40" Y="592"/> 97 <UsageCount Value="11"/> 98 <Loaded Value="True"/> 95 99 </Unit5> 96 100 <Unit6> … … 100 104 <TopLine Value="158"/> 101 105 <CursorPos X="43" Y="178"/> 102 <UsageCount Value="1 2"/>106 <UsageCount Value="11"/> 103 107 </Unit6> 104 108 <Unit7> 105 109 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 106 110 <UnitName Value="UAudioSystemMPlayer"/> 107 <EditorIndex Value=" 3"/>108 <WindowIndex Value="0"/> 109 <TopLine Value=" 231"/>110 <CursorPos X=" 1" Y="243"/>111 <UsageCount Value="1 4"/>111 <EditorIndex Value="7"/> 112 <WindowIndex Value="0"/> 113 <TopLine Value="19"/> 114 <CursorPos X="3" Y="36"/> 115 <UsageCount Value="16"/> 112 116 <Loaded Value="True"/> 113 117 </Unit7> … … 118 122 <TopLine Value="1"/> 119 123 <CursorPos X="1" Y="1"/> 120 <UsageCount Value=" 10"/>124 <UsageCount Value="9"/> 121 125 </Unit8> 122 126 <Unit9> 123 127 <Filename Value="../Systems/UAudioSystem.pas"/> 124 128 <UnitName Value="UAudioSystem"/> 125 <EditorIndex Value=" 2"/>126 <WindowIndex Value="0"/> 127 <TopLine Value=" 17"/>128 <CursorPos X="5 6" Y="29"/>129 <UsageCount Value="2 4"/>129 <EditorIndex Value="5"/> 130 <WindowIndex Value="0"/> 131 <TopLine Value="54"/> 132 <CursorPos X="5" Y="66"/> 133 <UsageCount Value="26"/> 130 134 <Loaded Value="True"/> 131 135 </Unit9> … … 133 137 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/lcl/stdctrls.pp"/> 134 138 <UnitName Value="StdCtrls"/> 135 <WindowIndex Value="0"/> 136 <TopLine Value="1046"/> 137 <CursorPos X="17" Y="1067"/> 138 <UsageCount Value="10"/> 139 <EditorIndex Value="1"/> 140 <WindowIndex Value="0"/> 141 <TopLine Value="418"/> 142 <CursorPos X="18" Y="430"/> 143 <UsageCount Value="11"/> 144 <Loaded Value="True"/> 139 145 </Unit10> 140 146 <Unit11> 141 147 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/lcl/controls.pp"/> 142 148 <UnitName Value="Controls"/> 143 <EditorIndex Value=" 1"/>149 <EditorIndex Value="4"/> 144 150 <WindowIndex Value="0"/> 145 151 <TopLine Value="2427"/> 146 152 <CursorPos X="24" Y="2429"/> 147 <UsageCount Value="1 1"/>153 <UsageCount Value="13"/> 148 154 <Loaded Value="True"/> 149 155 </Unit11> … … 154 160 <TopLine Value="38"/> 155 161 <CursorPos X="32" Y="50"/> 156 <UsageCount Value=" 10"/>162 <UsageCount Value="9"/> 157 163 </Unit12> 158 164 <Unit13> … … 162 168 <TopLine Value="120"/> 163 169 <CursorPos X="16" Y="131"/> 164 <UsageCount Value=" 10"/>170 <UsageCount Value="9"/> 165 171 </Unit13> 166 172 <Unit14> … … 169 175 <TopLine Value="26"/> 170 176 <CursorPos X="18" Y="28"/> 171 <UsageCount Value=" 10"/>177 <UsageCount Value="9"/> 172 178 </Unit14> 173 179 <Unit15> … … 176 182 <TopLine Value="65"/> 177 183 <CursorPos X="17" Y="67"/> 178 <UsageCount Value=" 10"/>184 <UsageCount Value="9"/> 179 185 </Unit15> 180 186 <Unit16> … … 183 189 <TopLine Value="4280"/> 184 190 <CursorPos X="19" Y="4283"/> 185 <UsageCount Value=" 10"/>191 <UsageCount Value="9"/> 186 192 </Unit16> 187 193 <Unit17> … … 190 196 <TopLine Value="6307"/> 191 197 <CursorPos X="17" Y="6320"/> 192 <UsageCount Value=" 10"/>198 <UsageCount Value="9"/> 193 199 </Unit17> 194 200 <Unit18> 195 201 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/packages/fcl-process/src/process.pp"/> 196 202 <UnitName Value="process"/> 197 <EditorIndex Value=" 4"/>203 <EditorIndex Value="8"/> 198 204 <WindowIndex Value="0"/> 199 205 <TopLine Value="13"/> 200 206 <CursorPos X="21" Y="26"/> 201 <UsageCount Value="1 1"/>207 <UsageCount Value="13"/> 202 208 <Loaded Value="True"/> 203 209 </Unit18> … … 205 211 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/packages/libogcfpc/src/debug.pp"/> 206 212 <UnitName Value="debug"/> 207 <EditorIndex Value=" 5"/>213 <EditorIndex Value="9"/> 208 214 <WindowIndex Value="0"/> 209 215 <TopLine Value="1"/> 210 216 <CursorPos X="1" Y="1"/> 211 <UsageCount Value="1 1"/>217 <UsageCount Value="13"/> 212 218 <Loaded Value="True"/> 213 219 </Unit19> 220 <Unit20> 221 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/packages/winunits-base/src/mmsystem.pp"/> 222 <UnitName Value="mmsystem"/> 223 <EditorIndex Value="2"/> 224 <WindowIndex Value="0"/> 225 <TopLine Value="165"/> 226 <CursorPos X="10" Y="177"/> 227 <UsageCount Value="12"/> 228 <Loaded Value="True"/> 229 </Unit20> 230 <Unit21> 231 <Filename Value="../Systems/UAudioSystemWindows.pas"/> 232 <UnitName Value="UAudioSystemWindows"/> 233 <EditorIndex Value="3"/> 234 <WindowIndex Value="0"/> 235 <TopLine Value="1"/> 236 <CursorPos X="17" Y="17"/> 237 <UsageCount Value="22"/> 238 <Loaded Value="True"/> 239 </Unit21> 214 240 </Units> 215 241 <JumpHistory Count="30" HistoryIndex="29"> 216 242 <Position1> 217 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>218 <Caret Line=" 129" Column="1" TopLine="113"/>243 <Filename Value="../Systems/UAudioSystemWindows.pas"/> 244 <Caret Line="32" Column="1" TopLine="17"/> 219 245 </Position1> 220 246 <Position2> 221 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>222 <Caret Line=" 130" Column="1" TopLine="113"/>247 <Filename Value="../Systems/UAudioSystemWindows.pas"/> 248 <Caret Line="27" Column="11" TopLine="15"/> 223 249 </Position2> 224 250 <Position3> 225 <Filename Value=" ../Systems/UAudioSystemMPlayer.pas"/>226 <Caret Line=" 131" Column="1" TopLine="113"/>251 <Filename Value="UMainForm.pas"/> 252 <Caret Line="5" Column="11" TopLine="1"/> 227 253 </Position3> 228 254 <Position4> 229 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>230 <Caret Line=" 128" Column="1" TopLine="113"/>255 <Filename Value="../Systems/UAudioSystem.pas"/> 256 <Caret Line="69" Column="68" TopLine="55"/> 231 257 </Position4> 232 258 <Position5> 233 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>234 <Caret Line=" 129" Column="1" TopLine="113"/>259 <Filename Value="../Systems/UAudioSystem.pas"/> 260 <Caret Line="71" Column="34" TopLine="56"/> 235 261 </Position5> 236 262 <Position6> 237 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>238 <Caret Line=" 130" Column="1" TopLine="113"/>263 <Filename Value="../Systems/UAudioSystem.pas"/> 264 <Caret Line="93" Column="24" TopLine="85"/> 239 265 </Position6> 240 266 <Position7> 241 <Filename Value="../ Systems/UAudioSystemMPlayer.pas"/>242 <Caret Line="1 31" Column="1" TopLine="113"/>267 <Filename Value="../UCoolAudio.pas"/> 268 <Caret Line="16" Column="23" TopLine="1"/> 243 269 </Position7> 244 270 <Position8> 245 <Filename Value="../ Systems/UAudioSystemMPlayer.pas"/>246 <Caret Line="1 32" Column="1" TopLine="113"/>271 <Filename Value="../UCoolAudio.pas"/> 272 <Caret Line="12" Column="19" TopLine="10"/> 247 273 </Position8> 248 274 <Position9> 249 <Filename Value="../ Systems/UAudioSystemMPlayer.pas"/>250 <Caret Line=" 133" Column="1" TopLine="113"/>275 <Filename Value="../UCoolAudio.pas"/> 276 <Caret Line="25" Column="26" TopLine="10"/> 251 277 </Position9> 252 278 <Position10> 253 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>254 <Caret Line=" 134" Column="1" TopLine="114"/>279 <Filename Value="../Systems/UAudioSystem.pas"/> 280 <Caret Line="69" Column="59" TopLine="57"/> 255 281 </Position10> 256 282 <Position11> 257 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>258 <Caret Line=" 135" Column="1" TopLine="115"/>283 <Filename Value="../Systems/UAudioSystem.pas"/> 284 <Caret Line="60" Column="34" TopLine="51"/> 259 285 </Position11> 260 286 <Position12> 261 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>262 <Caret Line=" 136" Column="1" TopLine="116"/>287 <Filename Value="../Systems/UAudioSystem.pas"/> 288 <Caret Line="72" Column="25" TopLine="59"/> 263 289 </Position12> 264 290 <Position13> 265 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>266 <Caret Line=" 139" Column="1" TopLine="119"/>291 <Filename Value="../Systems/UAudioSystem.pas"/> 292 <Caret Line="86" Column="3" TopLine="85"/> 267 293 </Position13> 268 294 <Position14> 269 <Filename Value=" UMainForm.pas"/>270 <Caret Line=" 63" Column="1" TopLine="59"/>295 <Filename Value="../Systems/UAudioSystem.pas"/> 296 <Caret Line="73" Column="32" TopLine="72"/> 271 297 </Position14> 272 298 <Position15> 273 <Filename Value=" UMainForm.pas"/>274 <Caret Line=" 70" Column="1" TopLine="61"/>299 <Filename Value="../Systems/UAudioSystem.pas"/> 300 <Caret Line="68" Column="55" TopLine="49"/> 275 301 </Position15> 276 302 <Position16> 277 <Filename Value=" UMainForm.pas"/>278 <Caret Line=" 64" Column="10" TopLine="62"/>303 <Filename Value="../Systems/UAudioSystem.pas"/> 304 <Caret Line="91" Column="25" TopLine="89"/> 279 305 </Position16> 280 306 <Position17> 281 <Filename Value=" UMainForm.pas"/>282 <Caret Line=" 35" Column="19" TopLine="23"/>307 <Filename Value="../Systems/UAudioSystem.pas"/> 308 <Caret Line="93" Column="25" TopLine="79"/> 283 309 </Position17> 284 310 <Position18> 285 311 <Filename Value="../Systems/UAudioSystem.pas"/> 286 <Caret Line=" 54" Column="62" TopLine="33"/>312 <Caret Line="76" Column="1" TopLine="56"/> 287 313 </Position18> 288 314 <Position19> 289 315 <Filename Value="UMainForm.pas"/> 290 <Caret Line=" 35" Column="19" TopLine="23"/>316 <Caret Line="53" Column="33" TopLine="41"/> 291 317 </Position19> 292 318 <Position20> 293 <Filename Value=" UMainForm.pas"/>294 <Caret Line=" 64" Column="20" TopLine="52"/>319 <Filename Value="../Systems/UAudioSystem.pas"/> 320 <Caret Line="76" Column="50" TopLine="64"/> 295 321 </Position20> 296 322 <Position21> 297 <Filename Value=" ../Systems/UAudioSystemMPlayer.pas"/>298 <Caret Line=" 246" Column="16" TopLine="225"/>323 <Filename Value="UMainForm.pas"/> 324 <Caret Line="55" Column="24" TopLine="42"/> 299 325 </Position21> 300 326 <Position22> 301 <Filename Value=" ../Systems/UAudioSystemMPlayer.pas"/>302 <Caret Line=" 245" Column="1" TopLine="225"/>327 <Filename Value="UMainForm.pas"/> 328 <Caret Line="99" Column="28" TopLine="85"/> 303 329 </Position22> 304 330 <Position23> 305 <Filename Value=" ../Systems/UAudioSystemMPlayer.pas"/>306 <Caret Line=" 246" Column="1" TopLine="226"/>331 <Filename Value="UMainForm.pas"/> 332 <Caret Line="100" Column="10" TopLine="85"/> 307 333 </Position23> 308 334 <Position24> 309 <Filename Value=" ../Systems/UAudioSystemMPlayer.pas"/>310 <Caret Line=" 248" Column="1" TopLine="228"/>335 <Filename Value="UMainForm.pas"/> 336 <Caret Line="70" Column="7" TopLine="86"/> 311 337 </Position24> 312 338 <Position25> 313 339 <Filename Value="UMainForm.pas"/> 314 <Caret Line=" 64" Column="19" TopLine="50"/>340 <Caret Line="97" Column="1" TopLine="86"/> 315 341 </Position25> 316 342 <Position26> 317 <Filename Value=" ../Systems/UAudioSystem.pas"/>318 <Caret Line=" 54" Column="41" TopLine="42"/>343 <Filename Value="UMainForm.pas"/> 344 <Caret Line="98" Column="1" TopLine="86"/> 319 345 </Position26> 320 346 <Position27> 321 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>322 <Caret Line=" 36" Column="26" TopLine="29"/>347 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 348 <Caret Line="59" Column="1" TopLine="47"/> 323 349 </Position27> 324 350 <Position28> 325 <Filename Value="../Systems/UAudioSystem .pas"/>326 <Caret Line=" 29" Column="56" TopLine="17"/>351 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 352 <Caret Line="64" Column="1" TopLine="47"/> 327 353 </Position28> 328 354 <Position29> 329 <Filename Value="../Systems/UAudioSystem MPlayer.pas"/>330 <Caret Line=" 243" Column="1" TopLine="231"/>355 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 356 <Caret Line="60" Column="1" TopLine="47"/> 331 357 </Position29> 332 358 <Position30> 333 <Filename Value=" UMainForm.pas"/>334 <Caret Line="6 7" Column="35" TopLine="55"/>359 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 360 <Caret Line="61" Column="1" TopLine="47"/> 335 361 </Position30> 336 362 </JumpHistory> … … 360 386 </CompilerOptions> 361 387 <Debugging> 388 <BreakPoints Count="1"> 389 <Item1> 390 <Kind Value="bpkSource"/> 391 <Source Value="UMainForm.pas"/> 392 <Line Value="97"/> 393 </Item1> 394 </BreakPoints> 362 395 <Watches Count="1"> 363 396 <Item1> -
CoolAudio/Demo/UMainForm.lfm
r277 r278 32 32 Left = 11 33 33 Height = 25 34 Top = 6334 Top = 87 35 35 Width = 75 36 36 Caption = 'Play' … … 41 41 Left = 96 42 42 Height = 25 43 Top = 6443 Top = 88 44 44 Width = 75 45 45 Caption = 'Pause' … … 50 50 Left = 182 51 51 Height = 25 52 Top = 6452 Top = 88 53 53 Width = 75 54 54 Caption = 'Stop' … … 59 59 Left = 11 60 60 Height = 33 61 Top = 9061 Top = 114 62 62 Width = 417 63 63 Max = 100 … … 67 67 TabOrder = 5 68 68 end 69 object ComboBox1: TComboBox 70 Left = 80 71 Height = 21 72 Top = 46 73 Width = 128 74 ItemHeight = 13 75 OnChange = ComboBox1Change 76 Style = csDropDownList 77 TabOrder = 6 78 end 79 object Label1: TLabel 80 Left = 9 81 Height = 14 82 Top = 46 83 Width = 45 84 Caption = 'Backend:' 85 ParentColor = False 86 end 69 87 object OpenDialog1: TOpenDialog 70 88 Filter = 'Any file (*.*)|*.*|MP3 (*.mp3)|*.mp3|WAV (*.wav)|*.wav' 71 89 left = 296 72 top = 4890 top = 72 73 91 end 74 92 object TimerPlayback: TTimer -
CoolAudio/Demo/UMainForm.pas
r277 r278 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ExtCtrls, UAudioSystem, UAudioSystemFMOD, UAudioSystemMPlayer; 9 ComCtrls, ExtCtrls, UAudioSystem, UAudioSystemFMOD, UAudioSystemMPlayer, 10 UCoolAudio; 10 11 11 12 type … … 18 19 ButtonPlay: TButton; 19 20 ButtonPause: TButton; 21 ComboBox1: TComboBox; 20 22 Edit1: TEdit; 23 Label1: TLabel; 21 24 OpenDialog1: TOpenDialog; 22 25 TimerPlayback: TTimer; … … 26 29 procedure ButtonPlayClick(Sender: TObject); 27 30 procedure ButtonStopClick(Sender: TObject); 31 procedure ComboBox1Change(Sender: TObject); 28 32 procedure FormCreate(Sender: TObject); 29 33 procedure FormDestroy(Sender: TObject); … … 48 52 procedure TMainForm.FormCreate(Sender: TObject); 49 53 begin 54 AudioSystemManager.FillStringList(ComboBox1.Items); 50 55 AudioSystem := TAudioSystemMPlayer.Create; 51 56 TAudioSystemMPlayer(AudioSystem).Path := 'c:\Program Files\SMPlayer\mplayer\mplayer.exe'; … … 85 90 end; 86 91 92 procedure TMainForm.ComboBox1Change(Sender: TObject); 93 begin 94 Player.Free; 95 AudioSystem.Free; 96 if ComboBox1.ItemIndex <> - 1 then begin 97 with TAudioSystemManagerItem(ComboBox1.Items.Objects[ComboBox1.ItemIndex]) do begin 98 AudioSystem := SystemClass.Create; 99 Player := PlayerClass.Create; 100 Player.AudioSystem := AudioSystem; 101 end; 102 end; 103 end; 104 87 105 procedure TMainForm.ButtonPauseClick(Sender: TObject); 88 106 begin -
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 } -
CoolAudio/UCoolAudio.pas
r275 r278 3 3 {$mode Delphi}{$H+} 4 4 5 {$DEFINE AudioSystemWindows} 6 {$DEFINE AudioSystemMPlayer} 7 {$DEFINE AudioSystemFMOD} 8 5 9 interface 6 10 7 11 uses 8 Classes, SysUtils; 12 Classes, SysUtils, 13 {$IFDEF AudioSystemWindows} 14 UAudioSystemWindows, 15 {$ENDIF} 16 {$IFDEF AudioSystemMPlayer} 17 UAudioSystemMPlayer, 18 {$ENDIF} 19 {$IFDEF AudioSystemFMOD} 20 UAudioSystemFMOD, 21 {$ENDIF} 22 UAudioSystem; 23 24 var 25 AudioSystemManager: TAudioSystemManager; 9 26 10 27 implementation 11 28 29 initialization 30 31 AudioSystemManager := TAudioSystemManager.Create; 32 {$IFDEF AudioSystemWindows} 33 AudioSystemManager.Register('Windows', TAudioSystemWindows, TPlayerWindows); 34 {$ENDIF} 35 {$IFDEF AudioSystemMPlayer} 36 AudioSystemManager.Register('MPlayer', TAudioSystemMPlayer, TPlayerMPlayer); 37 {$ENDIF} 38 {$IFDEF AudioSystemFMOD} 39 AudioSystemManager.Register('FMOD', TAudioSystemFMOD, TPlayerFMOD); 40 {$ENDIF} 41 42 finalization 43 44 AudioSystemManager.Free; 45 12 46 end. 13 47
Note:
See TracChangeset
for help on using the changeset viewer.