- Timestamp:
- Oct 4, 2011, 6:55:54 PM (13 years ago)
- Location:
- CoolAudio
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolAudio/Demo/Demo.lpi
r278 r279 38 38 </Item2> 39 39 </RequiredPackages> 40 <Units Count="2 2">40 <Units Count="23"> 41 41 <Unit0> 42 42 <Filename Value="Demo.lpr"/> 43 43 <IsPartOfProject Value="True"/> 44 44 <UnitName Value="Demo"/> 45 <EditorIndex Value="8"/> 46 <WindowIndex Value="0"/> 47 <TopLine Value="1"/> 48 <CursorPos X="1" Y="1"/> 45 49 <UsageCount Value="33"/> 50 <Loaded Value="True"/> 46 51 </Unit0> 47 52 <Unit1> … … 51 56 <ResourceBaseClass Value="Form"/> 52 57 <UnitName Value="UMainForm"/> 58 <IsVisibleTab Value="True"/> 53 59 <EditorIndex Value="0"/> 54 60 <WindowIndex Value="0"/> 55 <TopLine Value=" 86"/>56 <CursorPos X=" 1" Y="98"/>61 <TopLine Value="69"/> 62 <CursorPos X="39" Y="82"/> 57 63 <UsageCount Value="33"/> 58 64 <Loaded Value="True"/> … … 62 68 <Filename Value="../UCoolAudio.pas"/> 63 69 <UnitName Value="UCoolAudio"/> 64 <EditorIndex Value=" 6"/>65 <WindowIndex Value="0"/> 66 <TopLine Value=" 24"/>67 <CursorPos X=" 30" Y="39"/>70 <EditorIndex Value="3"/> 71 <WindowIndex Value="0"/> 72 <TopLine Value="16"/> 73 <CursorPos X="9" Y="7"/> 68 74 <UsageCount Value="11"/> 69 75 <Loaded Value="True"/> … … 72 78 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 73 79 <UnitName Value="UAudioSystemFMOD"/> 74 <EditorIndex Value=" 10"/>80 <EditorIndex Value="6"/> 75 81 <WindowIndex Value="0"/> 76 82 <TopLine Value="47"/> … … 90 96 <Filename Value="../fmodintf/fmoddyn.pas"/> 91 97 <UnitName Value="fmoddyn"/> 92 <IsVisibleTab Value="True"/> 93 <EditorIndex Value="11"/> 98 <EditorIndex Value="7"/> 94 99 <WindowIndex Value="0"/> 95 100 <TopLine Value="577"/> 96 <CursorPos X=" 40" Y="592"/>101 <CursorPos X="38" Y="581"/> 97 102 <UsageCount Value="11"/> 98 103 <Loaded Value="True"/> … … 109 114 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 110 115 <UnitName Value="UAudioSystemMPlayer"/> 111 <EditorIndex Value=" 7"/>112 <WindowIndex Value="0"/> 113 <TopLine Value=" 19"/>114 <CursorPos X=" 3" Y="36"/>116 <EditorIndex Value="4"/> 117 <WindowIndex Value="0"/> 118 <TopLine Value="254"/> 119 <CursorPos X="1" Y="276"/> 115 120 <UsageCount Value="16"/> 116 121 <Loaded Value="True"/> … … 127 132 <Filename Value="../Systems/UAudioSystem.pas"/> 128 133 <UnitName Value="UAudioSystem"/> 129 <EditorIndex Value=" 5"/>130 <WindowIndex Value="0"/> 131 <TopLine Value=" 54"/>132 <CursorPos X=" 5" Y="66"/>134 <EditorIndex Value="2"/> 135 <WindowIndex Value="0"/> 136 <TopLine Value="31"/> 137 <CursorPos X="15" Y="48"/> 133 138 <UsageCount Value="26"/> 134 139 <Loaded Value="True"/> … … 137 142 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/lcl/stdctrls.pp"/> 138 143 <UnitName Value="StdCtrls"/> 139 <EditorIndex Value="1"/>140 144 <WindowIndex Value="0"/> 141 145 <TopLine Value="418"/> 142 146 <CursorPos X="18" Y="430"/> 143 147 <UsageCount Value="11"/> 144 <Loaded Value="True"/>145 148 </Unit10> 146 149 <Unit11> 147 150 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/lcl/controls.pp"/> 148 151 <UnitName Value="Controls"/> 149 <EditorIndex Value="4"/>150 152 <WindowIndex Value="0"/> 151 153 <TopLine Value="2427"/> 152 154 <CursorPos X="24" Y="2429"/> 153 155 <UsageCount Value="13"/> 154 <Loaded Value="True"/>155 156 </Unit11> 156 157 <Unit12> … … 201 202 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/packages/fcl-process/src/process.pp"/> 202 203 <UnitName Value="process"/> 203 <EditorIndex Value="8"/>204 204 <WindowIndex Value="0"/> 205 205 <TopLine Value="13"/> 206 206 <CursorPos X="21" Y="26"/> 207 207 <UsageCount Value="13"/> 208 <Loaded Value="True"/>209 208 </Unit18> 210 209 <Unit19> 211 210 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/packages/libogcfpc/src/debug.pp"/> 212 211 <UnitName Value="debug"/> 213 <EditorIndex Value="9"/>214 212 <WindowIndex Value="0"/> 215 213 <TopLine Value="1"/> 216 214 <CursorPos X="1" Y="1"/> 217 215 <UsageCount Value="13"/> 218 <Loaded Value="True"/>219 216 </Unit19> 220 217 <Unit20> 221 218 <Filename Value="../../../../Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/packages/winunits-base/src/mmsystem.pp"/> 222 219 <UnitName Value="mmsystem"/> 223 <EditorIndex Value="2"/>224 220 <WindowIndex Value="0"/> 225 221 <TopLine Value="165"/> 226 222 <CursorPos X="10" Y="177"/> 227 223 <UsageCount Value="12"/> 228 <Loaded Value="True"/>229 224 </Unit20> 230 225 <Unit21> 231 226 <Filename Value="../Systems/UAudioSystemWindows.pas"/> 232 227 <UnitName Value="UAudioSystemWindows"/> 233 <EditorIndex Value=" 3"/>234 <WindowIndex Value="0"/> 235 <TopLine Value="1 "/>236 <CursorPos X="1 7" Y="17"/>228 <EditorIndex Value="1"/> 229 <WindowIndex Value="0"/> 230 <TopLine Value="13"/> 231 <CursorPos X="1" Y="46"/> 237 232 <UsageCount Value="22"/> 238 233 <Loaded Value="True"/> 239 234 </Unit21> 235 <Unit22> 236 <Filename Value="/usr/share/fpcsrc/2.4.2/rtl/objpas/sysutils/sysstrh.inc"/> 237 <EditorIndex Value="5"/> 238 <WindowIndex Value="0"/> 239 <TopLine Value="159"/> 240 <CursorPos X="10" Y="176"/> 241 <UsageCount Value="10"/> 242 <Loaded Value="True"/> 243 </Unit22> 240 244 </Units> 241 245 <JumpHistory Count="30" HistoryIndex="29"> 242 246 <Position1> 243 <Filename Value="../Systems/UAudioSystem Windows.pas"/>244 <Caret Line=" 32" Column="1" TopLine="17"/>247 <Filename Value="../Systems/UAudioSystem.pas"/> 248 <Caret Line="91" Column="25" TopLine="89"/> 245 249 </Position1> 246 250 <Position2> 247 <Filename Value="../Systems/UAudioSystem Windows.pas"/>248 <Caret Line=" 27" Column="11" TopLine="15"/>251 <Filename Value="../Systems/UAudioSystem.pas"/> 252 <Caret Line="93" Column="25" TopLine="79"/> 249 253 </Position2> 250 254 <Position3> 251 <Filename Value=" UMainForm.pas"/>252 <Caret Line=" 5" Column="11" TopLine="1"/>255 <Filename Value="../Systems/UAudioSystem.pas"/> 256 <Caret Line="76" Column="1" TopLine="56"/> 253 257 </Position3> 254 258 <Position4> 255 <Filename Value=" ../Systems/UAudioSystem.pas"/>256 <Caret Line=" 69" Column="68" TopLine="55"/>259 <Filename Value="UMainForm.pas"/> 260 <Caret Line="53" Column="33" TopLine="41"/> 257 261 </Position4> 258 262 <Position5> 259 263 <Filename Value="../Systems/UAudioSystem.pas"/> 260 <Caret Line="7 1" Column="34" TopLine="56"/>264 <Caret Line="76" Column="50" TopLine="64"/> 261 265 </Position5> 262 266 <Position6> 263 <Filename Value=" ../Systems/UAudioSystem.pas"/>264 <Caret Line=" 93" Column="24" TopLine="85"/>267 <Filename Value="UMainForm.pas"/> 268 <Caret Line="55" Column="24" TopLine="42"/> 265 269 </Position6> 266 270 <Position7> 267 <Filename Value=" ../UCoolAudio.pas"/>268 <Caret Line=" 16" Column="23" TopLine="1"/>271 <Filename Value="UMainForm.pas"/> 272 <Caret Line="99" Column="28" TopLine="85"/> 269 273 </Position7> 270 274 <Position8> 271 <Filename Value=" ../UCoolAudio.pas"/>272 <Caret Line="1 2" Column="19" TopLine="10"/>275 <Filename Value="UMainForm.pas"/> 276 <Caret Line="100" Column="10" TopLine="85"/> 273 277 </Position8> 274 278 <Position9> 275 <Filename Value=" ../UCoolAudio.pas"/>276 <Caret Line=" 25" Column="26" TopLine="10"/>279 <Filename Value="UMainForm.pas"/> 280 <Caret Line="97" Column="1" TopLine="86"/> 277 281 </Position9> 278 282 <Position10> 279 <Filename Value=" ../Systems/UAudioSystem.pas"/>280 <Caret Line=" 69" Column="59" TopLine="57"/>283 <Filename Value="UMainForm.pas"/> 284 <Caret Line="98" Column="1" TopLine="86"/> 281 285 </Position10> 282 286 <Position11> 283 <Filename Value="../Systems/UAudioSystem .pas"/>284 <Caret Line=" 60" Column="34" TopLine="51"/>287 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 288 <Caret Line="59" Column="1" TopLine="47"/> 285 289 </Position11> 286 290 <Position12> 287 <Filename Value="../Systems/UAudioSystem .pas"/>288 <Caret Line=" 72" Column="25" TopLine="59"/>291 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 292 <Caret Line="64" Column="1" TopLine="47"/> 289 293 </Position12> 290 294 <Position13> 291 <Filename Value="../Systems/UAudioSystem .pas"/>292 <Caret Line=" 86" Column="3" TopLine="85"/>295 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 296 <Caret Line="60" Column="1" TopLine="47"/> 293 297 </Position13> 294 298 <Position14> 295 <Filename Value="../Systems/UAudioSystem .pas"/>296 <Caret Line=" 73" Column="32" TopLine="72"/>299 <Filename Value="../Systems/UAudioSystemFMOD.pas"/> 300 <Caret Line="61" Column="1" TopLine="47"/> 297 301 </Position14> 298 302 <Position15> 299 303 <Filename Value="../Systems/UAudioSystem.pas"/> 300 <Caret Line="6 8" Column="55" TopLine="49"/>304 <Caret Line="66" Column="5" TopLine="54"/> 301 305 </Position15> 302 306 <Position16> 303 307 <Filename Value="../Systems/UAudioSystem.pas"/> 304 <Caret Line=" 91" Column="25" TopLine="89"/>308 <Caret Line="1" Column="1" TopLine="1"/> 305 309 </Position16> 306 310 <Position17> 307 <Filename Value="../ Systems/UAudioSystem.pas"/>308 <Caret Line=" 93" Column="25" TopLine="79"/>311 <Filename Value="../UCoolAudio.pas"/> 312 <Caret Line="39" Column="30" TopLine="13"/> 309 313 </Position17> 310 314 <Position18> 311 <Filename Value=" ../Systems/UAudioSystem.pas"/>312 <Caret Line=" 76" Column="1" TopLine="56"/>315 <Filename Value="UMainForm.pas"/> 316 <Caret Line="57" Column="85" TopLine="43"/> 313 317 </Position18> 314 318 <Position19> 315 <Filename Value=" UMainForm.pas"/>316 <Caret Line=" 53" Column="33" TopLine="41"/>319 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 320 <Caret Line="132" Column="30" TopLine="121"/> 317 321 </Position19> 318 322 <Position20> 319 <Filename Value="../Systems/UAudioSystem .pas"/>320 <Caret Line=" 76" Column="50" TopLine="64"/>323 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 324 <Caret Line="42" Column="14" TopLine="25"/> 321 325 </Position20> 322 326 <Position21> 323 <Filename Value=" UMainForm.pas"/>324 <Caret Line=" 55" Column="24" TopLine="42"/>327 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 328 <Caret Line="74" Column="17" TopLine="49"/> 325 329 </Position21> 326 330 <Position22> 327 331 <Filename Value="UMainForm.pas"/> 328 <Caret Line=" 99" Column="28" TopLine="85"/>332 <Caret Line="31" Column="50" TopLine="1"/> 329 333 </Position22> 330 334 <Position23> 331 335 <Filename Value="UMainForm.pas"/> 332 <Caret Line="10 0" Column="10" TopLine="85"/>336 <Caret Line="108" Column="1" TopLine="84"/> 333 337 </Position23> 334 338 <Position24> 335 <Filename Value=" UMainForm.pas"/>336 <Caret Line=" 70" Column="7" TopLine="86"/>339 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 340 <Caret Line="271" Column="1" TopLine="254"/> 337 341 </Position24> 338 342 <Position25> 339 <Filename Value=" UMainForm.pas"/>340 <Caret Line=" 97" Column="1" TopLine="86"/>343 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 344 <Caret Line="272" Column="1" TopLine="254"/> 341 345 </Position25> 342 346 <Position26> 343 <Filename Value=" UMainForm.pas"/>344 <Caret Line=" 98" Column="1" TopLine="86"/>347 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 348 <Caret Line="273" Column="1" TopLine="254"/> 345 349 </Position26> 346 350 <Position27> 347 <Filename Value="../Systems/UAudioSystem FMOD.pas"/>348 <Caret Line=" 59" Column="1" TopLine="47"/>351 <Filename Value="../Systems/UAudioSystemMPlayer.pas"/> 352 <Caret Line="276" Column="1" TopLine="254"/> 349 353 </Position27> 350 354 <Position28> 351 <Filename Value=" ../Systems/UAudioSystemFMOD.pas"/>352 <Caret Line=" 64" Column="1" TopLine="47"/>355 <Filename Value="UMainForm.pas"/> 356 <Caret Line="102" Column="17" TopLine="84"/> 353 357 </Position28> 354 358 <Position29> 355 <Filename Value=" ../Systems/UAudioSystemFMOD.pas"/>356 <Caret Line=" 60" Column="1" TopLine="47"/>359 <Filename Value="UMainForm.pas"/> 360 <Caret Line="94" Column="52" TopLine="84"/> 357 361 </Position29> 358 362 <Position30> 359 <Filename Value=" ../Systems/UAudioSystemFMOD.pas"/>360 <Caret Line=" 61" Column="1" TopLine="47"/>363 <Filename Value="UMainForm.pas"/> 364 <Caret Line="74" Column="29" TopLine="68"/> 361 365 </Position30> 362 366 </JumpHistory> … … 374 378 <Debugging> 375 379 <GenerateDebugInfo Value="True"/> 380 <DebugInfoType Value="dsStabs"/> 376 381 </Debugging> 377 382 <Options> … … 386 391 </CompilerOptions> 387 392 <Debugging> 388 <BreakPoints Count="1">389 <Item1>390 <Kind Value="bpkSource"/>391 <Source Value="UMainForm.pas"/>392 <Line Value="97"/>393 </Item1>394 </BreakPoints>395 393 <Watches Count="1"> 396 394 <Item1> -
CoolAudio/Demo/Demo.lpr
r275 r279 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UMainForm ;10 Forms, UMainForm, USystem; 11 11 12 12 {$R *.res} -
CoolAudio/Demo/UMainForm.lfm
r278 r279 69 69 object ComboBox1: TComboBox 70 70 Left = 80 71 Height = 2 171 Height = 25 72 72 Top = 46 73 73 Width = 128 74 ItemHeight = 1374 ItemHeight = 0 75 75 OnChange = ComboBox1Change 76 76 Style = csDropDownList … … 81 81 Height = 14 82 82 Top = 46 83 Width = 4583 Width = 52 84 84 Caption = 'Backend:' 85 ParentColor = False 86 end 87 object LabelPosition: TLabel 88 Left = 13 89 Height = 14 90 Top = 152 91 Width = 48 92 Caption = 'Position:' 85 93 ParentColor = False 86 94 end -
CoolAudio/Demo/UMainForm.pas
r278 r279 22 22 Edit1: TEdit; 23 23 Label1: TLabel; 24 LabelPosition: TLabel; 24 25 OpenDialog1: TOpenDialog; 25 26 TimerPlayback: TTimer; … … 55 56 AudioSystem := TAudioSystemMPlayer.Create; 56 57 TAudioSystemMPlayer(AudioSystem).Path := 'c:\Program Files\SMPlayer\mplayer\mplayer.exe'; 58 TAudioSystemMPlayer(AudioSystem).Path := TAudioSystemMPlayer(AudioSystem).FindPath; 57 59 Player := TPlayerMPlayer.Create; 58 60 Player.AudioSystem := AudioSystem; … … 70 72 TrackBar1.OnChange := nil; 71 73 TrackBar1.Position := Trunc(Player.Position / Player.Length * TrackBar1.Max); 74 Application.ProcessMessages; 72 75 TrackBar1.OnChange := TrackBar1Change; 76 LabelPosition.Caption := 'Position: ' + TimeToStr(Player.Position) + ' / ' + TimeToStr(Player.Length); 73 77 end; 74 78 end; -
CoolAudio/Systems/UAudioSystemMPlayer.pas
r277 r279 25 25 FPath: string; 26 26 procedure SetOutputMode(AValue: TOutputDriver); override; 27 public 27 28 function FindPath: string; 28 public29 29 constructor Create; override; 30 30 destructor Destroy; override; … … 64 64 implementation 65 65 66 function StrToFloatPoint(Value: string): Extended; 67 var 68 FPointSeparator: TFormatSettings; 69 begin 70 // Format seetings to convert a string to a float 71 FPointSeparator := DefaultFormatSettings; 72 FPointSeparator.DecimalSeparator := '.'; 73 FPointSeparator.ThousandSeparator := '#';// disable the thousand separator 74 Result := StrToFloat(Value, FPointSeparator); 75 end; 76 77 function FloatPointToStr(Value: Extended): string; 78 var 79 FPointSeparator: TFormatSettings; 80 begin 81 // Format seetings to convert a string to a float 82 FPointSeparator := DefaultFormatSettings; 83 FPointSeparator.DecimalSeparator := '.'; 84 FPointSeparator.ThousandSeparator := '#';// disable the thousand separator 85 Result := FloatToStr(Value, FPointSeparator); 86 end; 87 66 88 { TAudioSystemMPlayer } 67 89 … … 130 152 I := LastDelimiter('=', tmps); 131 153 if I > 0 then begin 132 Tmps := StringReplace(Tmps, '.', ',', [rfReplaceAll]); 133 Time := StrToFloat(Copy(tmps, I + 1, System.Length(tmps))); 154 Time := StrToFloatPoint(Copy(tmps, I + 1, System.Length(tmps))); 134 155 Result := Time * OneSecond; 135 156 end; … … 153 174 I := LastDelimiter('=', tmps); 154 175 if I > 0 then begin 155 Tmps := StringReplace(Tmps, '.', ',', [rfReplaceAll]); 156 Time := StrToFloat(Copy(tmps, I + 1, System.Length(tmps))); 176 Time := StrToFloatPoint(Copy(tmps, I + 1, System.Length(tmps))); 157 177 Result := Time * OneSecond; 158 178 end else Result := -1; … … 186 206 begin 187 207 if FPlaying and FProcess.Running then begin 188 SendCommand('set_property time_pos ' + StringReplace(FloatToStr(AValue / OneSecond), ',', '.', [rfReplaceAll]));208 SendCommand('set_property time_pos ' + FloatPointToStr(AValue / OneSecond)); 189 209 end; 190 210 end; -
CoolAudio/Systems/UAudioSystemWindows.pas
r278 r279 5 5 interface 6 6 7 {$IFDEF Windows} 7 8 uses 8 9 Classes, SysUtils, UAudioSystem, MMSystem; … … 18 19 procedure Stop; override; 19 20 end; 21 {$ENDIF} 20 22 21 23 implementation 24 25 {$IFDEF Windows} 22 26 23 27 { TPlayerWindows } … … 39 43 end; 40 44 45 {$ENDIF} 46 41 47 end. 42 48 -
CoolAudio/UCoolAudio.pas
r278 r279 3 3 {$mode Delphi}{$H+} 4 4 5 {$DEFINE AudioSystemWindows} 5 {$IFDEF Windows} 6 {$DEFINE AudioSystemWindows} 7 {$ENDIF} 6 8 {$DEFINE AudioSystemMPlayer} 7 9 {$DEFINE AudioSystemFMOD}
Note:
See TracChangeset
for help on using the changeset viewer.