Changeset 353
- Timestamp:
- Apr 23, 2012, 2:57:12 PM (13 years ago)
- Location:
- CoolAudio
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolAudio/CoolAudio.lpk
r352 r353 19 19 </Other> 20 20 </CompilerOptions> 21 <Description Value="CoolAudio"/> 21 <Description Value="Features: 22 - TMediaPlayer for playing sound files using different audio systems 23 - TPlayList for song list management"/> 22 24 <License Value="GNU/GPL"/> 23 <Version Minor=" 1"/>25 <Version Minor="2"/> 24 26 <Files Count="10"> 25 27 <Item1> 26 28 <Filename Value="UCoolAudio.pas"/> 29 <HasRegisterProc Value="True"/> 27 30 <UnitName Value="UCoolAudio"/> 28 31 </Item1> … … 61 64 <Item10> 62 65 <Filename Value="UCoolAudioConfig.inc"/> 66 <UnitName Value="UCoolAudioConfig"/> 63 67 </Item10> 64 68 </Files> -
CoolAudio/CoolAudio.pas
r352 r353 16 16 procedure Register; 17 17 begin 18 RegisterUnit('UCoolAudio', @UCoolAudio.Register); 18 19 end; 19 20 -
CoolAudio/Demo/Demo.lpi
r352 r353 38 38 </Item2> 39 39 </RequiredPackages> 40 <Units Count=" 31">40 <Units Count="45"> 41 41 <Unit0> 42 42 <Filename Value="Demo.lpr"/> 43 43 <IsPartOfProject Value="True"/> 44 44 <UnitName Value="Demo"/> 45 <EditorIndex Value="1 4"/>45 <EditorIndex Value="15"/> 46 46 <WindowIndex Value="0"/> 47 47 <TopLine Value="1"/> 48 48 <CursorPos X="34" Y="10"/> 49 <UsageCount Value="8 3"/>49 <UsageCount Value="85"/> 50 50 <Loaded Value="True"/> 51 51 </Unit0> … … 59 59 <EditorIndex Value="0"/> 60 60 <WindowIndex Value="0"/> 61 <TopLine Value="1 42"/>62 <CursorPos X=" 28" Y="150"/>63 <UsageCount Value="8 3"/>61 <TopLine Value="1"/> 62 <CursorPos X="47" Y="9"/> 63 <UsageCount Value="85"/> 64 64 <Loaded Value="True"/> 65 65 <LoadedDesigner Value="True"/> … … 70 70 <EditorIndex Value="12"/> 71 71 <WindowIndex Value="0"/> 72 <TopLine Value="2 7"/>73 <CursorPos X=" 20" Y="19"/>74 <UsageCount Value="3 5"/>72 <TopLine Value="22"/> 73 <CursorPos X="34" Y="37"/> 74 <UsageCount Value="36"/> 75 75 <Loaded Value="True"/> 76 76 </Unit2> … … 86 86 <Filename Value="../UPlaylist.pas"/> 87 87 <UnitName Value="UPlaylist"/> 88 <EditorIndex Value=" 2"/>89 <WindowIndex Value="0"/> 90 <TopLine Value=" 10"/>91 <CursorPos X=" 20" Y="26"/>92 <UsageCount Value="1 7"/>88 <EditorIndex Value="4"/> 89 <WindowIndex Value="0"/> 90 <TopLine Value="23"/> 91 <CursorPos X="31" Y="35"/> 92 <UsageCount Value="18"/> 93 93 <Loaded Value="True"/> 94 94 </Unit4> … … 120 120 <Filename Value="../CoolAudio.pas"/> 121 121 <UnitName Value="CoolAudio"/> 122 <EditorIndex Value="13"/> 122 123 <WindowIndex Value="0"/> 123 124 <TopLine Value="1"/> 124 <CursorPos X="1" Y="1"/> 125 <UsageCount Value="4"/> 125 <CursorPos X="45" Y="19"/> 126 <UsageCount Value="10"/> 127 <Loaded Value="True"/> 126 128 </Unit8> 127 129 <Unit9> 128 130 <Filename Value="../Systems/UAudioSystem.pas"/> 129 131 <UnitName Value="UAudioSystem"/> 130 <EditorIndex Value=" 11"/>131 <WindowIndex Value="0"/> 132 <TopLine Value="2 17"/>133 <CursorPos X="1 " Y="230"/>134 <UsageCount Value="5 0"/>132 <EditorIndex Value="5"/> 133 <WindowIndex Value="0"/> 134 <TopLine Value="27"/> 135 <CursorPos X="15" Y="40"/> 136 <UsageCount Value="51"/> 135 137 <Loaded Value="True"/> 136 138 </Unit9> … … 183 185 <Unit16> 184 186 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/lcl/include/control.inc"/> 185 <EditorIndex Value="8"/>186 187 <WindowIndex Value="0"/> 187 188 <TopLine Value="2275"/> 188 189 <CursorPos X="1" Y="2287"/> 189 190 <UsageCount Value="34"/> 190 <Loaded Value="True"/>191 191 </Unit16> 192 192 <Unit17> … … 216 216 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/packages/winunits-base/src/mmsystem.pp"/> 217 217 <UnitName Value="mmsystem"/> 218 <EditorIndex Value="9"/>219 218 <WindowIndex Value="0"/> 220 219 <TopLine Value="1781"/> 221 220 <CursorPos X="52" Y="1791"/> 222 221 <UsageCount Value="36"/> 223 <Loaded Value="True"/>224 222 </Unit20> 225 223 <Unit21> … … 240 238 <Unit23> 241 239 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/objpas/sysutils/osutilsh.inc"/> 242 <EditorIndex Value="1 3"/>240 <EditorIndex Value="14"/> 243 241 <WindowIndex Value="0"/> 244 242 <TopLine Value="23"/> 245 243 <CursorPos X="10" Y="23"/> 246 <UsageCount Value="3 4"/>244 <UsageCount Value="35"/> 247 245 <Loaded Value="True"/> 248 246 </Unit23> 249 247 <Unit24> 250 248 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/win/wininc/base.inc"/> 251 <EditorIndex Value="10"/>252 249 <WindowIndex Value="0"/> 253 250 <TopLine Value="148"/> 254 251 <CursorPos X="6" Y="159"/> 255 252 <UsageCount Value="11"/> 256 <Loaded Value="True"/>257 253 </Unit24> 258 254 <Unit25> … … 260 256 <IsPartOfProject Value="True"/> 261 257 <ComponentName Value="FormPlaylist"/> 258 <HasResources Value="True"/> 262 259 <ResourceBaseClass Value="Form"/> 263 260 <UnitName Value="UFormPlaylist"/> … … 266 263 <TopLine Value="155"/> 267 264 <CursorPos X="28" Y="168"/> 268 <UsageCount Value="2 3"/>265 <UsageCount Value="25"/> 269 266 <Loaded Value="True"/> 270 267 <LoadedDesigner Value="True"/> … … 273 270 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 274 271 <UnitName Value="UAudioSystemWindows"/> 275 <EditorIndex Value="5"/> 276 <WindowIndex Value="0"/> 277 <TopLine Value="62"/> 278 <CursorPos X="35" Y="75"/> 272 <IsVisibleTab Value="True"/> 273 <EditorIndex Value="6"/> 274 <WindowIndex Value="0"/> 275 <TopLine Value="163"/> 276 <CursorPos X="3" Y="167"/> 279 277 <UsageCount Value="11"/> 280 278 <Loaded Value="True"/> … … 282 280 <Unit27> 283 281 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/include/customform.inc"/> 284 <EditorIndex Value="1"/>285 282 <WindowIndex Value="0"/> 286 283 <TopLine Value="934"/> 287 284 <CursorPos X="1" Y="947"/> 288 <UsageCount Value="11"/> 289 <Loaded Value="True"/> 285 <UsageCount Value="10"/> 290 286 </Unit27> 291 287 <Unit28> 292 288 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/include/listitem.inc"/> 293 <EditorIndex Value="4"/>294 289 <WindowIndex Value="0"/> 295 290 <TopLine Value="725"/> 296 291 <CursorPos X="1" Y="738"/> 297 292 <UsageCount Value="10"/> 298 <Loaded Value="True"/>299 293 </Unit28> 300 294 <Unit29> 301 295 <Filename Value="../UCoolAudioConfig.inc"/> 302 <EditorIndex Value="6"/>303 296 <WindowIndex Value="0"/> 304 297 <TopLine Value="1"/> 305 298 <CursorPos X="1" Y="5"/> 306 299 <UsageCount Value="10"/> 307 <Loaded Value="True"/>308 300 </Unit29> 309 301 <Unit30> 310 302 <Filename Value="../Systems/FMOD/fmoddyn.pas"/> 311 303 <UnitName Value="fmoddyn"/> 312 <IsVisibleTab Value="True"/> 304 <WindowIndex Value="0"/> 305 <TopLine Value="576"/> 306 <CursorPos X="20" Y="594"/> 307 <UsageCount Value="10"/> 308 </Unit30> 309 <Unit31> 310 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/stdctrls.pp"/> 311 <UnitName Value="StdCtrls"/> 312 <WindowIndex Value="0"/> 313 <TopLine Value="1081"/> 314 <CursorPos X="3" Y="1085"/> 315 <UsageCount Value="10"/> 316 </Unit31> 317 <Unit32> 318 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/include/buttons.inc"/> 319 <WindowIndex Value="0"/> 320 <TopLine Value="280"/> 321 <CursorPos X="3" Y="285"/> 322 <UsageCount Value="10"/> 323 </Unit32> 324 <Unit33> 325 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/include/buttoncontrol.inc"/> 326 <WindowIndex Value="0"/> 327 <TopLine Value="59"/> 328 <CursorPos X="3" Y="61"/> 329 <UsageCount Value="10"/> 330 </Unit33> 331 <Unit34> 332 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/widgetset/wsstdctrls.pp"/> 333 <UnitName Value="WSStdCtrls"/> 334 <WindowIndex Value="0"/> 335 <TopLine Value="212"/> 336 <CursorPos X="3" Y="225"/> 337 <UsageCount Value="10"/> 338 </Unit34> 339 <Unit35> 340 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/widgetset/wsfactory.pas"/> 341 <UnitName Value="WSFactory"/> 342 <WindowIndex Value="0"/> 343 <TopLine Value="42"/> 344 <CursorPos X="1" Y="55"/> 345 <UsageCount Value="10"/> 346 </Unit35> 347 <Unit36> 348 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/controls.pp"/> 349 <UnitName Value="Controls"/> 350 <EditorIndex Value="2"/> 351 <WindowIndex Value="0"/> 352 <TopLine Value="1309"/> 353 <CursorPos X="15" Y="1310"/> 354 <UsageCount Value="10"/> 355 <Loaded Value="True"/> 356 </Unit36> 357 <Unit37> 358 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/include/control.inc"/> 359 <EditorIndex Value="1"/> 360 <WindowIndex Value="0"/> 361 <TopLine Value="3633"/> 362 <CursorPos X="47" Y="3641"/> 363 <UsageCount Value="10"/> 364 <Loaded Value="True"/> 365 </Unit37> 366 <Unit38> 367 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/lclclasses.pp"/> 368 <UnitName Value="LCLClasses"/> 369 <WindowIndex Value="0"/> 370 <TopLine Value="37"/> 371 <CursorPos X="13" Y="41"/> 372 <UsageCount Value="10"/> 373 </Unit38> 374 <Unit39> 375 <Filename Value="../../../../Lazarus/1.1_2.6.0/lcl/widgetset/wslclclasses.pp"/> 376 <UnitName Value="WSLCLClasses"/> 377 <WindowIndex Value="0"/> 378 <TopLine Value="61"/> 379 <CursorPos X="3" Y="74"/> 380 <UsageCount Value="10"/> 381 </Unit39> 382 <Unit40> 383 <Filename Value="../Systems/FMOD/UAudioSystemFMOD.pas"/> 384 <UnitName Value="UAudioSystemFMOD"/> 385 <EditorIndex Value="9"/> 386 <WindowIndex Value="0"/> 387 <TopLine Value="66"/> 388 <CursorPos X="25" Y="68"/> 389 <UsageCount Value="10"/> 390 <Loaded Value="True"/> 391 </Unit40> 392 <Unit41> 393 <Filename Value="../Systems/mplayer/UAudioSystemMPlayer.pas"/> 394 <UnitName Value="UAudioSystemMPlayer"/> 313 395 <EditorIndex Value="7"/> 314 396 <WindowIndex Value="0"/> 315 <TopLine Value="588"/> 316 <CursorPos X="5" Y="589"/> 317 <UsageCount Value="10"/> 318 <Loaded Value="True"/> 319 </Unit30> 397 <TopLine Value="130"/> 398 <CursorPos X="1" Y="134"/> 399 <UsageCount Value="10"/> 400 <Loaded Value="True"/> 401 </Unit41> 402 <Unit42> 403 <Filename Value="../../../../Lazarus/1.1_2.6.0/fpc/2.6.0/source/rtl/objpas/classes/classesh.inc"/> 404 <EditorIndex Value="11"/> 405 <WindowIndex Value="0"/> 406 <TopLine Value="1919"/> 407 <CursorPos X="11" Y="1932"/> 408 <UsageCount Value="10"/> 409 <Loaded Value="True"/> 410 </Unit42> 411 <Unit43> 412 <Filename Value="../Systems/DSP/UAudioSystemDSP.pas"/> 413 <UnitName Value="UAudioSystemDSP"/> 414 <EditorIndex Value="8"/> 415 <WindowIndex Value="0"/> 416 <TopLine Value="64"/> 417 <CursorPos X="25" Y="78"/> 418 <UsageCount Value="10"/> 419 <Loaded Value="True"/> 420 </Unit43> 421 <Unit44> 422 <Filename Value="../Systems/MAD/UAudioSystemMAD.pas"/> 423 <UnitName Value="UAudioSystemMAD"/> 424 <EditorIndex Value="10"/> 425 <WindowIndex Value="0"/> 426 <TopLine Value="23"/> 427 <CursorPos X="23" Y="37"/> 428 <UsageCount Value="10"/> 429 <Loaded Value="True"/> 430 </Unit44> 320 431 </Units> 321 432 <JumpHistory Count="30" HistoryIndex="29"> 322 433 <Position1> 323 <Filename Value=" UFormPlaylist.pas"/>324 <Caret Line=" 97" Column="25" TopLine="90"/>434 <Filename Value="../Systems/UAudioSystem.pas"/> 435 <Caret Line="240" Column="1" TopLine="227"/> 325 436 </Position1> 326 437 <Position2> 327 <Filename Value=" UFormPlaylist.pas"/>328 <Caret Line=" 96" Column="3" TopLine="94"/>438 <Filename Value="../Systems/UAudioSystem.pas"/> 439 <Caret Line="241" Column="1" TopLine="227"/> 329 440 </Position2> 330 441 <Position3> 331 <Filename Value=" UFormPlaylist.pas"/>332 <Caret Line=" 161" Column="24" TopLine="142"/>442 <Filename Value="../Systems/UAudioSystem.pas"/> 443 <Caret Line="381" Column="1" TopLine="368"/> 333 444 </Position3> 334 445 <Position4> 335 <Filename Value="UForm Playlist.pas"/>336 <Caret Line="1 46" Column="19" TopLine="144"/>446 <Filename Value="UFormMain.pas"/> 447 <Caret Line="121" Column="10" TopLine="111"/> 337 448 </Position4> 338 449 <Position5> 339 <Filename Value="UForm Playlist.pas"/>340 <Caret Line="1 61" Column="20" TopLine="155"/>450 <Filename Value="UFormMain.pas"/> 451 <Caret Line="125" Column="28" TopLine="112"/> 341 452 </Position5> 342 453 <Position6> 343 454 <Filename Value="UFormMain.pas"/> 344 <Caret Line=" 77" Column="53" TopLine="67"/>455 <Caret Line="122" Column="28" TopLine="112"/> 345 456 </Position6> 346 457 <Position7> 347 458 <Filename Value="UFormMain.pas"/> 348 <Caret Line="1 36" Column="1" TopLine="132"/>459 <Caret Line="164" Column="30" TopLine="159"/> 349 460 </Position7> 350 461 <Position8> 351 <Filename Value="UForm Playlist.pas"/>352 <Caret Line=" 151" Column="30" TopLine="145"/>462 <Filename Value="UFormMain.pas"/> 463 <Caret Line="51" Column="49" TopLine="27"/> 353 464 </Position8> 354 465 <Position9> 355 <Filename Value=" UFormMain.pas"/>356 <Caret Line=" 136" Column="1" TopLine="132"/>466 <Filename Value="../UPlaylist.pas"/> 467 <Caret Line="30" Column="1" TopLine="10"/> 357 468 </Position9> 358 469 <Position10> 359 <Filename Value=" UFormMain.pas"/>360 <Caret Line=" 150" Column="28" TopLine="142"/>470 <Filename Value="../UPlaylist.pas"/> 471 <Caret Line="35" Column="3" TopLine="15"/> 361 472 </Position10> 362 473 <Position11> 363 <Filename Value="../ Systems/WinAPI/UAudioSystemWindows.pas"/>364 <Caret Line="1 98" Column="7" TopLine="186"/>474 <Filename Value="../UPlaylist.pas"/> 475 <Caret Line="18" Column="10" TopLine="7"/> 365 476 </Position11> 366 477 <Position12> 367 <Filename Value="../Systems/ WinAPI/UAudioSystemWindows.pas"/>368 <Caret Line="1 90" Column="1" TopLine="185"/>478 <Filename Value="../Systems/UAudioSystem.pas"/> 479 <Caret Line="120" Column="68" TopLine="104"/> 369 480 </Position12> 370 481 <Position13> 371 <Filename Value="../Systems/ WinAPI/UAudioSystemWindows.pas"/>372 <Caret Line=" 191" Column="1" TopLine="185"/>482 <Filename Value="../Systems/UAudioSystem.pas"/> 483 <Caret Line="318" Column="3" TopLine="313"/> 373 484 </Position13> 374 485 <Position14> 375 <Filename Value="../ Systems/WinAPI/UAudioSystemWindows.pas"/>376 <Caret Line="1 92" Column="1" TopLine="185"/>486 <Filename Value="../UCoolAudio.pas"/> 487 <Caret Line="18" Column="49" TopLine="10"/> 377 488 </Position14> 378 489 <Position15> 379 <Filename Value="../ Systems/WinAPI/UAudioSystemWindows.pas"/>380 <Caret Line=" 196" Column="1" TopLine="185"/>490 <Filename Value="../UCoolAudio.pas"/> 491 <Caret Line="40" Column="1" TopLine="22"/> 381 492 </Position15> 382 493 <Position16> 383 <Filename Value="../Systems/ WinAPI/UAudioSystemWindows.pas"/>384 <Caret Line="1 97" Column="1" TopLine="185"/>494 <Filename Value="../Systems/UAudioSystem.pas"/> 495 <Caret Line="122" Column="39" TopLine="104"/> 385 496 </Position16> 386 497 <Position17> 387 <Filename Value="../ Systems/WinAPI/UAudioSystemWindows.pas"/>388 <Caret Line=" 202" Column="1" TopLine="185"/>498 <Filename Value="../UCoolAudio.pas"/> 499 <Caret Line="40" Column="1" TopLine="22"/> 389 500 </Position17> 390 501 <Position18> 391 <Filename Value=" ../Systems/WinAPI/UAudioSystemWindows.pas"/>392 <Caret Line="2 04" Column="19" TopLine="186"/>502 <Filename Value="UFormMain.pas"/> 503 <Caret Line="29" Column="32" TopLine="18"/> 393 504 </Position18> 394 505 <Position19> 395 <Filename Value=" ../Systems/WinAPI/UAudioSystemWindows.pas"/>396 <Caret Line=" 75" Column="1" TopLine="62"/>506 <Filename Value="UFormMain.pas"/> 507 <Caret Line="27" Column="18" TopLine="18"/> 397 508 </Position19> 398 509 <Position20> 399 510 <Filename Value="UFormPlaylist.pas"/> 400 <Caret Line="168" Column=" 59" TopLine="156"/>511 <Caret Line="168" Column="28" TopLine="155"/> 401 512 </Position20> 402 513 <Position21> 403 <Filename Value="../ ../../../Lazarus/1.1_2.6.0/lcl/include/listitem.inc"/>404 <Caret Line=" 738" Column="1" TopLine="725"/>514 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 515 <Caret Line="86" Column="48" TopLine="73"/> 405 516 </Position21> 406 517 <Position22> 407 <Filename Value=" UFormPlaylist.pas"/>408 <Caret Line=" 168" Column="28" TopLine="155"/>518 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 519 <Caret Line="213" Column="1" TopLine="200"/> 409 520 </Position22> 410 521 <Position23> 411 <Filename Value="../Systems/ WinAPI/UAudioSystemWindows.pas"/>412 <Caret Line=" 75" Column="1" TopLine="62"/>522 <Filename Value="../Systems/UAudioSystem.pas"/> 523 <Caret Line="422" Column="1" TopLine="409"/> 413 524 </Position23> 414 525 <Position24> 415 526 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 416 <Caret Line="2 02" Column="1" TopLine="183"/>527 <Caret Line="213" Column="1" TopLine="200"/> 417 528 </Position24> 418 529 <Position25> 419 <Filename Value="../Systems/ UAudioSystem.pas"/>420 <Caret Line=" 231" Column="39" TopLine="217"/>530 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 531 <Caret Line="86" Column="1" TopLine="73"/> 421 532 </Position25> 422 533 <Position26> 423 534 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 424 <Caret Line="21 6" Column="1" TopLine="203"/>535 <Caret Line="213" Column="1" TopLine="200"/> 425 536 </Position26> 426 537 <Position27> 427 538 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 428 <Caret Line=" 202" Column="1" TopLine="189"/>539 <Caret Line="86" Column="1" TopLine="73"/> 429 540 </Position27> 430 541 <Position28> 431 542 <Filename Value="../Systems/UAudioSystem.pas"/> 432 <Caret Line=" 230" Column="1" TopLine="217"/>543 <Caret Line="422" Column="1" TopLine="409"/> 433 544 </Position28> 434 545 <Position29> 435 546 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 436 <Caret Line="2 02" Column="1" TopLine="189"/>547 <Caret Line="227" Column="1" TopLine="214"/> 437 548 </Position29> 438 549 <Position30> 439 <Filename Value="../ UCoolAudioConfig.inc"/>440 <Caret Line=" 5" Column="1" TopLine="1"/>550 <Filename Value="../Systems/WinAPI/UAudioSystemWindows.pas"/> 551 <Caret Line="102" Column="3" TopLine="98"/> 441 552 </Position30> 442 553 </JumpHistory> -
CoolAudio/Demo/UFormMain.lfm
r352 r353 9 9 OnCreate = FormCreate 10 10 OnDestroy = FormDestroy 11 OnShow = FormShow 11 12 LCLVersion = '1.1' 12 13 object ButtonOpen: TButton … … 42 43 TabOrder = 3 43 44 end 44 object TrackBar 1: TTrackBar45 object TrackBarPosition: TTrackBar 45 46 Left = 0 46 47 Height = 33 … … 48 49 Width = 432 49 50 Max = 100 50 OnChange = TrackBar 1Change51 OnChange = TrackBarPositionChange 51 52 Position = 0 52 53 Anchors = [akTop, akLeft, akRight] … … 103 104 TabOrder = 8 104 105 end 106 object TrackBarVolume: TTrackBar 107 Left = 352 108 Height = 25 109 Top = 80 110 Width = 75 111 Max = 100 112 OnChange = TrackBarVolumeChange 113 Position = 0 114 TabOrder = 9 115 end 116 object Label2: TLabel 117 Left = 312 118 Height = 14 119 Top = 87 120 Width = 39 121 Caption = 'Volume:' 122 ParentColor = False 123 end 105 124 object OpenDialog1: TOpenDialog 106 125 Filter = 'Any file (*.*)|*.*|MP3 (*.mp3)|*.mp3|WAV (*.wav)|*.wav' 107 left = 272 108 top = 96 126 left = 168 109 127 end 110 128 object TimerPlayback: TTimer 111 129 OnTimer = TimerPlaybackTimer 112 left = 328 113 top = 88 130 left = 240 114 131 end 115 132 object ActionList1: TActionList 116 left = 208 117 top = 96 133 left = 104 118 134 object APlayNext: TAction 119 135 Caption = 'Next' … … 145 161 end 146 162 end 163 object MediaPlayer: TMediaPlayer 164 Volume = 0 165 Muted = False 166 Active = True 167 left = 312 168 end 169 object PlayList: TPlayList 170 RandomOrder = False 171 RepeatInfinitely = False 172 left = 375 173 top = 2 174 end 147 175 end -
CoolAudio/Demo/UFormMain.pas
r352 r353 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ExtCtrls, ActnList, UAudioSystem, UAudioSystemFMOD,10 U AudioSystemMPlayer, UCoolAudio, UPlaylist;9 ComCtrls, ExtCtrls, ActnList, UAudioSystem, 10 UCoolAudio, UPlaylist; 11 11 12 12 type … … 32 32 ComboBoxBackend: TComboBox; 33 33 Label1: TLabel; 34 Label2: TLabel; 34 35 LabelPosition: TLabel; 36 MediaPlayer: TMediaPlayer; 35 37 OpenDialog1: TOpenDialog; 38 PlayList: TPlayList; 36 39 TimerPlayback: TTimer; 37 TrackBar1: TTrackBar; 40 TrackBarPosition: TTrackBar; 41 TrackBarVolume: TTrackBar; 38 42 procedure AOpenExecute(Sender: TObject); 39 43 procedure APauseExecute(Sender: TObject); … … 46 50 procedure FormCreate(Sender: TObject); 47 51 procedure FormDestroy(Sender: TObject); 52 procedure FormShow(Sender: TObject); 48 53 procedure TimerPlaybackTimer(Sender: TObject); 49 procedure TrackBar1Change(Sender: TObject); 54 procedure TrackBarPositionChange(Sender: TObject); 55 procedure TrackBarVolumeChange(Sender: TObject); 50 56 private 51 { private declarations }52 57 public 53 AudioSystem: TAudioSystem;54 Player: TPlayer;55 Playlist: TPlaylist;56 58 procedure UpdateInterface; 57 59 end; … … 74 76 procedure TFormMain.FormCreate(Sender: TObject); 75 77 begin 76 Play list := TPlaylist.Create(nil);78 PlayList := TPlayList.Create(nil); 77 79 AudioSystemManager.FillStringList(ComboBoxBackend.Items); 78 80 if ComboBoxBackend.Items.Count > 0 then … … 83 85 procedure TFormMain.FormDestroy(Sender: TObject); 84 86 begin 85 FreeAndNil(Player); 86 FreeAndNil(AudioSystem); 87 FreeAndNil(Playlist); 87 FreeAndNil(PlayList); 88 end; 89 90 procedure TFormMain.FormShow(Sender: TObject); 91 begin 92 UpdateInterface; 88 93 end; 89 94 90 95 procedure TFormMain.TimerPlaybackTimer(Sender: TObject); 91 96 begin 92 if Assigned(Player) and Player.Playing then begin 93 TrackBar1.OnChange := nil; 94 TrackBar1.Position := Trunc(Player.Position / Player.Length * TrackBar1.Max); 97 if Assigned(MediaPlayer) and MediaPlayer.Playing then begin 98 TrackBarPosition.OnChange := nil; 99 TrackBarPosition.Position := Trunc(MediaPlayer.Position / MediaPlayer.Length * TrackBarPosition.Max); 100 TrackBarVolume.OnChange := nil; 101 TrackBarVolume.Position := Trunc(MediaPlayer.Volume * TrackBarVolume.Max); 95 102 Application.ProcessMessages; 96 TrackBar1.OnChange := TrackBar1Change; 97 LabelPosition.Caption := 'Position: ' + TimeToStr(Player.Position) + ' / ' + TimeToStr(Player.Length); 103 TrackBarPosition.OnChange := TrackBarPositionChange(); 104 TrackBarVolume.OnChange := TrackBarVolumeChange(); 105 LabelPosition.Caption := 'Position: ' + TimeToStr(MediaPlayer.Position) + ' / ' + TimeToStr(MediaPlayer.Length); 98 106 end; 99 107 end; 100 108 101 procedure TFormMain.TrackBar 1Change(Sender: TObject);109 procedure TFormMain.TrackBarPositionChange(Sender: TObject); 102 110 begin 103 Player.Position := TrackBar1.Position / TrackBar1.Max * Player.Length; 111 MediaPlayer.Position := TrackBarPosition.Position / TrackBarPosition.Max * MediaPlayer.Length; 112 end; 113 114 procedure TFormMain.TrackBarVolumeChange(Sender: TObject); 115 begin 116 MediaPlayer.Volume := TrackBarVolume.Position / TrackBarVolume.Max; 104 117 end; 105 118 106 119 procedure TFormMain.UpdateInterface; 107 120 begin 121 APlay.Enabled := not MediaPlayer.Playing; 122 APause.Enabled := MediaPlayer.Playing; 123 AStop.Enabled := MediaPlayer.Playing; 108 124 Caption := ApplicationTitle; 109 if Assigned( Player) then Caption :=Player.FileName + ' - ' + Caption;125 if Assigned(MediaPlayer) then Caption := MediaPlayer.FileName + ' - ' + Caption; 110 126 end; 111 127 112 128 procedure TFormMain.ComboBoxBackendChange(Sender: TObject); 113 129 begin 114 FreeAndNil(Player);115 FreeAndNil(AudioSystem);116 130 if ComboBoxBackend.ItemIndex <> - 1 then begin 117 131 with TAudioSystemManagerItem(ComboBoxBackend.Items.Objects[ComboBoxBackend.ItemIndex]) do begin 118 AudioSystem := SystemClass.Create(nil); 119 Player := PlayerClass.Create(nil); 120 Player.AudioSystem := AudioSystem; 121 Playlist.Player := Player; 122 //Player.Active := True; 132 DefaultAudioSystem := SystemClass.Create(nil); 133 MediaPlayer.AudioSystem := DefaultAudioSystem; 134 PlayList.Player := MediaPlayer; 135 //MediaPlayer.Active := True; 123 136 end; 124 137 end; … … 127 140 procedure TFormMain.APlayExecute(Sender: TObject); 128 141 begin 129 Player.Play; 142 MediaPlayer.Play; 143 UpdateInterface; 130 144 end; 131 145 132 146 procedure TFormMain.APlayNextExecute(Sender: TObject); 133 147 begin 134 Play list.PlayNext;148 PlayList.PlayNext; 135 149 FormPlaylist.ReloadList; 136 150 end; … … 138 152 procedure TFormMain.APlayPreviousExecute(Sender: TObject); 139 153 begin 140 Play list.PlayPrevious;154 PlayList.PlayPrevious; 141 155 end; 142 156 … … 148 162 procedure TFormMain.AStopExecute(Sender: TObject); 149 163 begin 150 Player.Stop; 164 MediaPlayer.Stop; 165 UpdateInterface; 151 166 end; 152 167 153 168 procedure TFormMain.APauseExecute(Sender: TObject); 154 169 begin 155 Player.Pause; 170 MediaPlayer.Pause; 171 UpdateInterface; 156 172 end; 157 173 … … 159 175 begin 160 176 if OpenDialog1.Execute then begin 161 Player.FileName := OpenDialog1.FileName; 162 Playlist.AddFile(OpenDialog1.FileName); 163 Player.Play; 177 MediaPlayer.FileName := OpenDialog1.FileName; 178 PlayList.AddFile(OpenDialog1.FileName); 179 MediaPlayer.Play; 180 UpdateInterface; 164 181 end; 165 182 end; -
CoolAudio/Demo/UFormPlaylist.lfm
r352 r353 1 1 object FormPlaylist: TFormPlaylist 2 Left = 3 103 Height = 3944 Top = 732 Left = 331 3 Height = 400 4 Top = 119 5 5 Width = 516 6 6 Caption = 'Playlist' 7 ClientHeight = 3947 ClientHeight = 400 8 8 ClientWidth = 516 9 9 OnCreate = FormCreate … … 14 14 Left = 160 15 15 Height = 25 16 Top = 36 016 Top = 366 17 17 Width = 49 18 18 Action = AItemDelete … … 23 23 Left = 80 24 24 Height = 25 25 Top = 36 025 Top = 366 26 26 Width = 73 27 27 Action = AAddDirectory … … 32 32 Left = 8 33 33 Height = 25 34 Top = 36 034 Top = 366 35 35 Width = 65 36 36 Action = AAddFile … … 40 40 object ListView1: TListView 41 41 Left = 8 42 Height = 3 4442 Height = 350 43 43 Top = 8 44 44 Width = 505 … … 65 65 Left = 216 66 66 Height = 25 67 Top = 36 067 Top = 366 68 68 Width = 49 69 69 Action = AClearAll … … 74 74 Left = 328 75 75 Height = 17 76 Top = 36 076 Top = 366 77 77 Width = 88 78 78 Anchors = [akLeft, akBottom] … … 83 83 Left = 432 84 84 Height = 17 85 Top = 36 085 Top = 366 86 86 Width = 55 87 Anchors = [akLeft, akBottom] 87 88 Caption = 'Repeat' 88 89 TabOrder = 6 … … 91 92 Left = 272 92 93 Height = 25 93 Top = 36 094 Top = 366 94 95 Width = 51 95 96 Action = AItemPlay 97 Anchors = [akLeft, akBottom] 96 98 TabOrder = 7 97 99 end -
CoolAudio/Demo/UFormPlaylist.pas
r352 r353 76 76 procedure TFormPlaylist.AClearAllExecute(Sender: TObject); 77 77 begin 78 FormMain.Play list.Items.Clear;78 FormMain.PlayList.Items.Clear; 79 79 ReloadList; 80 80 end; … … 84 84 I: Integer; 85 85 begin 86 with FormMain.Play list, Items do begin86 with FormMain.PlayList, Items do begin 87 87 for I := Count - 1 downto 0 do 88 88 if ListView1.Items[I].Selected then Delete(I); … … 94 94 procedure TFormPlaylist.AItemPlayExecute(Sender: TObject); 95 95 begin 96 FormMain.Play list.CurrentIndex := ListView1.Selected.Index;97 FormMain.Play list.Play;96 FormMain.PlayList.CurrentIndex := ListView1.Selected.Index; 97 FormMain.PlayList.Play; 98 98 end; 99 99 … … 112 112 NewItem := TPlaylistItem.Create; 113 113 NewItem.FileName := Dir + DirectorySeparator + sr.Name; 114 FormMain.Play list.Items.Add(NewItem);114 FormMain.PlayList.Items.Add(NewItem); 115 115 end; 116 116 until FindNext(sr) <> 0; … … 124 124 begin 125 125 if OpenDialog1.Execute then begin 126 FormMain.Play list.AddFile(OpenDialog1.FileName);126 FormMain.PlayList.AddFile(OpenDialog1.FileName); 127 127 ReloadList; 128 128 end; … … 145 145 procedure TFormPlaylist.ListView1Data(Sender: TObject; Item: TListItem); 146 146 begin 147 if (Item.Index >= 0) and (Item.Index < FormMain.Play list.Items.Count) then148 with TPlaylistItem(FormMain.Play list.Items[Item.Index]) do begin147 if (Item.Index >= 0) and (Item.Index < FormMain.PlayList.Items.Count) then 148 with TPlaylistItem(FormMain.PlayList.Items[Item.Index]) do begin 149 149 Item.Caption := FileName; 150 Item.Data := FormMain.Play list.Items[Item.Index];150 Item.Data := FormMain.PlayList.Items[Item.Index]; 151 151 end; 152 152 end; … … 164 164 procedure TFormPlaylist.ReloadList; 165 165 begin 166 ListView1.Items.Count := FormMain.Play list.Items.Count;166 ListView1.Items.Count := FormMain.PlayList.Items.Count; 167 167 ListView1.Refresh; 168 168 ListView1.Selected := nil; 169 if (FormMain.Play list.CurrentIndex >= 0) and170 (FormMain.Play list.CurrentIndex < ListView1.Items.Count) then171 ListView1.Items[FormMain.Play list.CurrentIndex].Selected := True;169 if (FormMain.PlayList.CurrentIndex >= 0) and 170 (FormMain.PlayList.CurrentIndex < ListView1.Items.Count) then 171 ListView1.Items[FormMain.PlayList.CurrentIndex].Selected := True; 172 172 UpdateInterface; 173 173 end; … … 178 178 AItemPlay.Enabled := Assigned(ListView1.Selected); 179 179 AClearAll.Enabled := ListView1.Items.Count > 0; 180 CheckBoxRandom.Checked := FormMain.Play list.RandomOrder;181 CheckBoxRepeat.Checked := FormMain.Play list.RepeatInfinitely;180 CheckBoxRandom.Checked := FormMain.PlayList.RandomOrder; 181 CheckBoxRepeat.Checked := FormMain.PlayList.RepeatInfinitely; 182 182 end; 183 183 -
CoolAudio/Systems/DSP/UAudioSystemDSP.pas
r352 r353 21 21 SampleRate: Integer; // Hz 22 22 BitsPerSample: Integer; 23 function GetMediaPlayerDriverClass: TMediaPlayerDriverClass; override; 23 24 procedure OpenDevice; 24 25 procedure CloseDevice; … … 74 75 75 76 { TAudioSystemDSP } 77 78 function TAudioSystemDSP.GetMediaPlayerDriverClass: TMediaPlayerDriverClass; 79 begin 80 Result := TPlayerDSP; 81 end; 76 82 77 83 procedure TAudioSystemDSP.OpenDevice; -
CoolAudio/Systems/FMOD/UAudioSystemFMOD.pas
r352 r353 18 18 procedure SetOutputMode(AValue: TOutputDriver); override; 19 19 public 20 function GetMediaPlayerDriverClass: TMediaPlayerDriverClass; override; 20 21 constructor Create(AOwner: TComponent); override; 21 22 destructor Destroy; override; … … 24 25 { TPlayerFMOD } 25 26 26 TPlayerFMOD = class(T Player)27 TPlayerFMOD = class(TMediaPlayerDriver) 27 28 private 28 29 FHandle: PFSoundStream; … … 61 62 end else raise EOpenOutputFailed.Create(SOpenOutputFailed); 62 63 {$endif} 64 end; 65 66 function TAudioSystemFMOD.GetMediaPlayerDriverClass: TMediaPlayerDriverClass; 67 begin 68 Result := TPlayerFMOD; 63 69 end; 64 70 -
CoolAudio/Systems/MAD/UAudioSystemMAD.pas
r352 r353 13 13 TAudioSystemMAD = class(TAudioSystem) 14 14 public 15 function GetMediaPlayerDriverClass: TMediaPlayerDriverClass; override; 15 16 end; 16 17 … … 29 30 30 31 {$IFDEF AudioSystemMAD} 32 33 { TAudioSystemMAD } 34 35 function TAudioSystemMAD.GetMediaPlayerDriverClass: TMediaPlayerDriverClass; 36 begin 37 Result := TPlayerMAD; 38 end; 31 39 32 40 { TPlayerMAD } -
CoolAudio/Systems/UAudioSystem.pas
r352 r353 9 9 10 10 type 11 TMediaPlayerDriverClass = class of TMediaPlayerDriver; 11 12 TOutputDriver = (omAlsa, omOSS, omDirectX, omWin32); 12 13 … … 22 23 constructor Create(AOwner: TComponent); override; 23 24 destructor Destroy; override; 25 function GetMediaPlayerDriverClass: TMediaPlayerDriverClass; virtual; 24 26 property OutputMode: TOutputDriver read FOutputDriver write SetOutputMode; 25 27 end; … … 27 29 TAudioSystemClass = class of TAudioSystem; 28 30 29 { T Player }30 31 T Player = class(TComponent)31 { TMediaPlayerDriver } 32 33 TMediaPlayerDriver = class 32 34 private 33 35 protected … … 60 62 property Playing: Boolean read FPlaying write SetPlaying; 61 63 property Active: Boolean read FActive write SetActive; 64 constructor Create; virtual; 65 destructor Destroy; override; 66 end; 67 68 TMediaPlayer = class(TComponent) 69 private 70 procedure CheckDriver; 71 function GetActive: Boolean; 72 function GetAudioSystem: TAudioSystem; 73 function GetFileName: string; 74 function GetLength: TDateTime; 75 function GetMuted: Boolean; 76 function GetPlaying: Boolean; 77 function GetPosition: TDateTime; 78 function GetVolume: Real; 79 procedure SetActive(AValue: Boolean); 80 procedure SetAudioSystem(AValue: TAudioSystem); 81 procedure SetFileName(AValue: string); 82 procedure SetMuted(AValue: Boolean); 83 procedure SetPlaying(AValue: Boolean); 84 procedure SetPosition(AValue: TDateTime); 85 procedure SetVolume(AValue: Real); 86 public 87 Driver: TMediaPlayerDriver; 88 procedure Play; 89 procedure Pause; 90 procedure Stop; 91 procedure Open; 92 procedure Close; 93 property Position: TDateTime read GetPosition write SetPosition; 94 property Length: TDateTime read GetLength; 95 property Playing: Boolean read GetPlaying write SetPlaying; 96 published 97 property Volume: Real read GetVolume write SetVolume; // 0..1 98 property Muted: Boolean read GetMuted write SetMuted; 99 property AudioSystem: TAudioSystem read GetAudioSystem write SetAudioSystem; 100 property FileName: string read GetFileName write SetFileName; 101 property Active: Boolean read GetActive write SetActive; 62 102 constructor Create(AOwner: TComponent); override; 63 103 destructor Destroy; override; 64 104 end; 65 105 66 TPlayerClass = class of T Player;106 TPlayerClass = class of TMediaPlayerDriver; 67 107 68 108 { TAudioSystemManagerItem } … … 71 111 Name: string; 72 112 SystemClass: TAudioSystemClass; 73 PlayerClass: TPlayerClass;113 Supported: Boolean; 74 114 end; 75 115 … … 78 118 TAudioSystemManager = class(TComponent) 79 119 Systems: TObjectList; // TListObject<TAudioSystem> 80 procedure Register(Name: string; SystemClass: TAudioSystemClass; 81 PlayerClass: TPlayerClass); 120 procedure Register(Name: string; SystemClass: TAudioSystemClass); 82 121 procedure FillStringList(StringList: TStrings); 83 function SearchByName(Name: string ): TAudioSystemManagerItem;122 function SearchByName(Name: string; SupportedOnly: Boolean = True): TAudioSystemManagerItem; 84 123 constructor Create(AOwner: TComponent); override; 85 124 destructor Destroy; override; … … 90 129 Mp3FileExt = '.mp3'; 91 130 131 var 132 DefaultAudioSystem: TAudioSystem; 133 92 134 resourcestring 93 135 SOpenOutputFailed = 'Failed opening audio output'; 136 SDefaultAudioSystemNotSet = 'Default audio system not set'; 137 SMediaPlayerDriverNotAssigned = 'Media player driver not assigned'; 94 138 95 139 96 140 implementation 141 142 { TMediaPlayer } 143 144 function TMediaPlayer.GetLength: TDateTime; 145 begin 146 CheckDriver; 147 Result := Driver.Length; 148 end; 149 150 procedure TMediaPlayer.CheckDriver; 151 begin 152 if not Assigned(Driver) then 153 raise Exception.Create(SMediaPlayerDriverNotAssigned); 154 end; 155 156 function TMediaPlayer.GetActive: Boolean; 157 begin 158 CheckDriver; 159 Result := Driver.Active; 160 end; 161 162 function TMediaPlayer.GetAudioSystem: TAudioSystem; 163 begin 164 CheckDriver; 165 Result := Driver.AudioSystem; 166 end; 167 168 function TMediaPlayer.GetFileName: string; 169 begin 170 CheckDriver; 171 Result := Driver.FileName; 172 end; 173 174 function TMediaPlayer.GetMuted: Boolean; 175 begin 176 CheckDriver; 177 Result := Driver.Muted; 178 end; 179 180 function TMediaPlayer.GetPlaying: Boolean; 181 begin 182 CheckDriver; 183 Result := Driver.Playing; 184 end; 185 186 function TMediaPlayer.GetPosition: TDateTime; 187 begin 188 CheckDriver; 189 Result := Driver.Position; 190 end; 191 192 function TMediaPlayer.GetVolume: Real; 193 begin 194 CheckDriver; 195 Result := Driver.Volume; 196 end; 197 198 procedure TMediaPlayer.SetActive(AValue: Boolean); 199 begin 200 CheckDriver; 201 Driver.Active := True; 202 end; 203 204 procedure TMediaPlayer.SetAudioSystem(AValue: TAudioSystem); 205 var 206 DriverClass: TMediaPlayerDriverClass; 207 begin 208 FreeAndNil(Driver); 209 DriverClass := AValue.GetMediaPlayerDriverClass; 210 Driver := DriverClass.Create; 211 Driver.AudioSystem := DefaultAudioSystem; 212 end; 213 214 procedure TMediaPlayer.SetFileName(AValue: string); 215 begin 216 CheckDriver; 217 Driver.FileName := AValue; 218 end; 219 220 procedure TMediaPlayer.SetMuted(AValue: Boolean); 221 begin 222 CheckDriver; 223 Driver.Muted := AValue; 224 end; 225 226 procedure TMediaPlayer.SetPlaying(AValue: Boolean); 227 begin 228 CheckDriver; 229 Driver.Playing := AValue; 230 end; 231 232 procedure TMediaPlayer.SetPosition(AValue: TDateTime); 233 begin 234 CheckDriver; 235 Driver.Position := AValue; 236 end; 237 238 procedure TMediaPlayer.SetVolume(AValue: Real); 239 begin 240 CheckDriver; 241 Driver.Volume := AValue; 242 end; 243 244 procedure TMediaPlayer.Play; 245 begin 246 CheckDriver; 247 Driver.Play; 248 end; 249 250 procedure TMediaPlayer.Pause; 251 begin 252 CheckDriver; 253 Driver.Pause; 254 end; 255 256 procedure TMediaPlayer.Stop; 257 begin 258 CheckDriver; 259 Driver.Stop; 260 end; 261 262 procedure TMediaPlayer.Open; 263 begin 264 CheckDriver; 265 Driver.Open; 266 end; 267 268 procedure TMediaPlayer.Close; 269 begin 270 CheckDriver; 271 Driver.Close; 272 end; 273 274 constructor TMediaPlayer.Create(AOwner: TComponent); 275 begin 276 inherited Create(AOwner); 277 if not Assigned(DefaultAudioSystem) then 278 raise Exception.Create(SDefaultAudioSystemNotSet); 279 AudioSystem := DefaultAudioSystem; 280 end; 281 282 destructor TMediaPlayer.Destroy; 283 begin 284 FreeAndNil(Driver); 285 inherited Destroy; 286 end; 97 287 98 288 { TAudioSystemManagerItem } … … 111 301 end; 112 302 113 function TAudioSystemManager.SearchByName(Name: string): TAudioSystemManagerItem; 303 function TAudioSystemManager.SearchByName(Name: string; SupportedOnly: Boolean = True): 304 TAudioSystemManagerItem; 114 305 var 115 306 I: Integer; 116 307 begin 117 308 I := 0; 118 while (I < Systems.Count) and (TAudioSystemManagerItem(Systems[I]).Name <> Name) do Inc(I); 309 while (I < Systems.Count) and 310 ((TAudioSystemManagerItem(Systems[I]).Name <> Name) or 311 (not TAudioSystemManagerItem(Systems[I]).Supported and SupportedOnly)) do Inc(I); 119 312 if I < Systems.Count then Result := TAudioSystemManagerItem(Systems[I]) 120 313 else Result := nil; … … 122 315 123 316 procedure TAudioSystemManager.Register(Name: string; 124 SystemClass: TAudioSystemClass ; PlayerClass: TPlayerClass);317 SystemClass: TAudioSystemClass); 125 318 var 126 319 NewItem: TAudioSystemManagerItem; … … 129 322 NewItem.Name := Name; 130 323 NewItem.SystemClass := SystemClass; 131 NewItem.PlayerClass := PlayerClass;132 324 Systems.Add(NewItem); 133 325 end; … … 145 337 end; 146 338 147 { T Player }148 149 procedure T Player.SetActive(AValue: Boolean);339 { TMediaPlayerDriver } 340 341 procedure TMediaPlayerDriver.SetActive(AValue: Boolean); 150 342 begin 151 343 if FActive = AValue then Exit; … … 153 345 end; 154 346 155 procedure T Player.SetPlaying(AValue: Boolean);347 procedure TMediaPlayerDriver.SetPlaying(AValue: Boolean); 156 348 begin 157 349 if FPlaying = AValue then Exit; … … 159 351 end; 160 352 161 function T Player.GetMuted: Boolean;353 function TMediaPlayerDriver.GetMuted: Boolean; 162 354 begin 163 355 Result := False; 164 356 end; 165 357 166 procedure T Player.SetMuted(AValue: Boolean);167 begin 168 end; 169 170 function T Player.GetLength: TDateTime;358 procedure TMediaPlayerDriver.SetMuted(AValue: Boolean); 359 begin 360 end; 361 362 function TMediaPlayerDriver.GetLength: TDateTime; 171 363 begin 172 364 Result := 0; 173 365 end; 174 366 175 function T Player.GetPosition: TDateTime;367 function TMediaPlayerDriver.GetPosition: TDateTime; 176 368 begin 177 369 Result := 0; 178 370 end; 179 371 180 function T Player.GetVolume: Real;372 function TMediaPlayerDriver.GetVolume: Real; 181 373 begin 182 374 Result := 0; 183 375 end; 184 376 185 procedure T Player.SetPosition(AValue: TDateTime);186 begin 187 end; 188 189 procedure T Player.SetVolume(AValue: Real);190 begin 191 end; 192 193 procedure T Player.SetFileName(AValue: string);377 procedure TMediaPlayerDriver.SetPosition(AValue: TDateTime); 378 begin 379 end; 380 381 procedure TMediaPlayerDriver.SetVolume(AValue: Real); 382 begin 383 end; 384 385 procedure TMediaPlayerDriver.SetFileName(AValue: string); 194 386 begin 195 387 if AValue = FFileName then Exit; … … 199 391 end; 200 392 201 procedure T Player.Play;202 begin 203 end; 204 205 procedure T Player.Pause;206 begin 207 end; 208 209 procedure T Player.Stop;210 begin 211 end; 212 213 procedure T Player.Open;393 procedure TMediaPlayerDriver.Play; 394 begin 395 end; 396 397 procedure TMediaPlayerDriver.Pause; 398 begin 399 end; 400 401 procedure TMediaPlayerDriver.Stop; 402 begin 403 end; 404 405 procedure TMediaPlayerDriver.Open; 214 406 begin 215 407 Active := True; 216 408 end; 217 409 218 procedure T Player.Close;410 procedure TMediaPlayerDriver.Close; 219 411 begin 220 412 Active := False; 221 413 end; 222 414 223 constructor T Player.Create(AOwner: TComponent);415 constructor TMediaPlayerDriver.Create; 224 416 begin 225 417 inherited; 226 418 end; 227 419 228 destructor T Player.Destroy;420 destructor TMediaPlayerDriver.Destroy; 229 421 begin 230 422 Stop; … … 257 449 end; 258 450 451 function TAudioSystem.GetMediaPlayerDriverClass: TMediaPlayerDriverClass; 452 begin 453 Result := TMediaPlayerDriver; 454 end; 455 456 initialization 457 458 DefaultAudioSystem := TAudioSystem.Create(nil); 459 460 finalization 461 462 FreeAndNil(DefaultAudioSystem); 463 259 464 end. 260 465 -
CoolAudio/Systems/WinAPI/UAudioSystemWindows.pas
r352 r353 11 11 12 12 type 13 14 { TAudioSystemWindows } 15 13 16 TAudioSystemWindows = class(TAudioSystem) 14 17 public 15 18 PlayerIndex: Integer; 19 function GetMediaPlayerDriverClass: TMediaPlayerDriverClass; override; 16 20 end; 17 21 … … 21 25 { TPlayerWindows } 22 26 23 TPlayerWindows = class(T Player)27 TPlayerWindows = class(TMediaPlayerDriver) 24 28 private 25 29 FHandle: HWND; … … 47 51 procedure Pause; override; 48 52 procedure Stop; override; 49 constructor Create (AOwner: TComponent); override;53 constructor Create; override; 50 54 destructor Destroy; override; 51 55 property DeviceType: TMPDeviceTypes read FDeviceType write SetDeviceType; … … 60 64 61 65 implementation 66 67 { TAudioSystemWindows } 68 69 function TAudioSystemWindows.GetMediaPlayerDriverClass: TMediaPlayerDriverClass; 70 begin 71 Result := TPlayerWindows; 72 end; 62 73 63 74 {$IFDEF Windows} … … 175 186 Parm: TMCI_Generic_Parms; 176 187 begin 177 if FPlaying then begin 178 CheckError(mciSendCommand(FDeviceID, mci_Pause, FFlags, Longint(@Parm))); 179 FPlaying := False; 180 end else begin 181 CheckError(mciSendCommand(FDeviceID, mci_Resume, FFlags, Longint(@Parm))); 182 FPlaying := True; 188 if FActive then begin 189 if FPlaying then begin 190 CheckError(mciSendCommand(FDeviceID, mci_Pause, FFlags, Longint(@Parm))); 191 FPlaying := False; 192 end else begin 193 CheckError(mciSendCommand(FDeviceID, mci_Resume, FFlags, Longint(@Parm))); 194 FPlaying := True; 195 end; 183 196 end; 184 197 end; … … 188 201 Parm: TMCI_Generic_Parms; 189 202 begin 190 if F Playing then begin203 if FActive and FPlaying then begin 191 204 FFlags := 0; 192 205 if FUseNotify then … … 206 219 end; 207 220 208 constructor TPlayerWindows.Create (AOwner: TComponent);221 constructor TPlayerWindows.Create; 209 222 begin 210 223 inherited; -
CoolAudio/Systems/mplayer/UAudioSystemMPlayer.pas
r352 r353 30 30 constructor Create(AOwner: TComponent); override; 31 31 destructor Destroy; override; 32 function GetMediaPlayerDriverClass: TMediaPlayerDriverClass; override; 32 33 property Path: string read FPath write FPath; 33 34 end; … … 35 36 { TPlayerMPlayer } 36 37 37 TPlayerMPlayer = class(T Player)38 TPlayerMPlayer = class(TMediaPlayerDriver) 38 39 private 39 40 FProcess: TProcess; … … 53 54 procedure Pause; override; 54 55 procedure Stop; override; 55 constructor Create (AOwner: TComponent); override;56 constructor Create; override; 56 57 destructor Destroy; override; 57 58 end; … … 127 128 end; 128 129 130 function TAudioSystemMPlayer.GetMediaPlayerDriverClass: TMediaPlayerDriverClass; 131 begin 132 Result := TPlayerMPlayer; 133 end; 134 129 135 { TPlayerMPlayer } 130 136 … … 291 297 end; 292 298 293 constructor TPlayerMPlayer.Create (AOwner: TComponent);299 constructor TPlayerMPlayer.Create; 294 300 begin 295 301 inherited; -
CoolAudio/UCoolAudio.pas
r352 r353 18 18 AudioSystemManager: TAudioSystemManager; 19 19 20 procedure Register; 21 22 20 23 implementation 24 25 uses 26 UPlayList; 27 28 procedure Register; 29 begin 30 RegisterComponents('CoolAudio', [TMediaPlayer, TPlayList]); 31 end; 21 32 22 33 initialization 23 34 24 35 AudioSystemManager := TAudioSystemManager.Create(nil); 25 {$IFDEF AudioSystemWindows}AudioSystemManager.Register('Windows', TAudioSystemWindows , TPlayerWindows);{$ENDIF}26 {$IFDEF AudioSystemMPlayer}AudioSystemManager.Register('MPlayer', TAudioSystemMPlayer , TPlayerMPlayer);{$ENDIF}27 {$IFDEF AudioSystemFMOD}AudioSystemManager.Register('FMOD', TAudioSystemFMOD , TPlayerFMOD);{$ENDIF}28 {$IFDEF AudioSystemMAD}AudioSystemManager.Register('MAD', TAudioSystemMAD , TPlayerMAD);{$ENDIF}29 {$IFDEF AudioSystemDSP}AudioSystemManager.Register('DSP', TAudioSystemDSP , TPlayerDSP);{$ENDIF}36 {$IFDEF AudioSystemWindows}AudioSystemManager.Register('Windows', TAudioSystemWindows);{$ENDIF} 37 {$IFDEF AudioSystemMPlayer}AudioSystemManager.Register('MPlayer', TAudioSystemMPlayer);{$ENDIF} 38 {$IFDEF AudioSystemFMOD}AudioSystemManager.Register('FMOD', TAudioSystemFMOD);{$ENDIF} 39 {$IFDEF AudioSystemMAD}AudioSystemManager.Register('MAD', TAudioSystemMAD);{$ENDIF} 40 {$IFDEF AudioSystemDSP}AudioSystemManager.Register('DSP', TAudioSystemDSP);{$ENDIF} 30 41 31 42 finalization -
CoolAudio/UPlaylist.pas
r352 r353 13 13 end; 14 14 15 { TPlay list }15 { TPlayList } 16 16 17 TPlaylist = class(TComponent) 17 TPlayList = class(TComponent) 18 private 19 FRandomOrder: Boolean; 20 FRepeatInfinitely: Boolean; 18 21 public 19 Player: TPlayer;20 Items: TObjectList; // TObjectList<TPlaylistItem>21 RandomOrder: Boolean;22 RepeatInfinitely: Boolean;23 22 CurrentIndex: Integer; 24 23 procedure AddFile(FileName: string); … … 29 28 constructor Create(AOwner: TComponent); 30 29 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; 31 36 end; 32 37 … … 34 39 implementation 35 40 36 { TPlay list }41 { TPlayList } 37 42 38 procedure TPlay list.AddFile(FileName: string);43 procedure TPlayList.AddFile(FileName: string); 39 44 var 40 45 NewItem: TPlaylistItem; … … 45 50 end; 46 51 47 procedure TPlay list.Shuffle;52 procedure TPlayList.Shuffle; 48 53 begin 49 54 50 55 end; 51 56 52 procedure TPlay list.Play;57 procedure TPlayList.Play; 53 58 begin 54 59 Player.FileName := TPlaylistItem(Items[CurrentIndex]).FileName; … … 56 61 end; 57 62 58 procedure TPlay list.PlayNext;63 procedure TPlayList.PlayNext; 59 64 begin 60 65 Inc(CurrentIndex); … … 67 72 end; 68 73 69 procedure TPlay list.PlayPrevious;74 procedure TPlayList.PlayPrevious; 70 75 begin 71 76 Dec(CurrentIndex); … … 76 81 end; 77 82 78 constructor TPlay list.Create(AOwner: TComponent);83 constructor TPlayList.Create(AOwner: TComponent); 79 84 begin 80 85 inherited; … … 82 87 end; 83 88 84 destructor TPlay list.Destroy;89 destructor TPlayList.Destroy; 85 90 begin 86 91 Items.Free;
Note:
See TracChangeset
for help on using the changeset viewer.