Changeset 665
- Timestamp:
- Jul 9, 2025, 4:45:12 PM (7 hours ago)
- Location:
- trunk
- Files:
-
- 6 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Music.pas
r664 r665 4 4 5 5 uses 6 Classes, SysUtils, Dialogs, uos_flat ;6 Classes, SysUtils, Dialogs, uos_flat, ctypes; 7 7 8 8 type … … 19 19 AutoPlayNext: Boolean; 20 20 procedure Initialize; 21 procedure EndPlay; 22 procedure LoopEndProc; 21 procedure EndPlay(PlayerIndex: cint32); 23 22 function GetNextPlaylistItem: string; 24 23 procedure PlayNext(Data: PtrInt); … … 46 45 procedure TMusicPlayer.Initialize; 47 46 var 48 res: Integer;49 47 SndFileFileName: string; 50 48 PortAudioFileName: string; … … 53 51 if Initialized then Exit; 54 52 53 {$IFDEF UNIX} 55 54 SndFileFileName := 'libsndfile.so.1'; 56 55 PortAudioFileName := 'libportaudio.so'; 57 56 XmpFileName := 'libxmp.so.4'; 57 {$ELSE} 58 {$if defined(cpu64)} 59 SndFileFileName := 'LibSndFile-64.dll'; 60 PortAudioFileName := 'LibPortaudio-64.dll'; 61 XmpFileName := 'libxmp-64.dll'; 62 {$ELSE} 63 SndFileFileName := 'LibSndFile-32.dll'; 64 PortAudioFileName := 'LibPortaudio-32.dll'; 65 XmpFileName := 'libxmp-32.dll'; 66 {$ENDIF} 67 {$ENDIF} 58 68 59 69 if (SndFileFileName <> 'system') and (SndFileFileName <> '') then … … 61 71 SndFileFileName := SndFileFileName + '.2'; 62 72 63 res := uos_LoadLib(PChar(PortAudioFileName), PChar(SndFileFileName), Nil, Nil, 64 Nil, Nil, PChar(XmpFileName)); 73 if uos_LoadLib(PChar(PortAudioFileName), PChar(SndFileFileName), Nil, Nil, 74 Nil, Nil, PChar(XmpFileName)) <> 0 then 75 raise Exception.Create('Error while loading audio libraries.'); 65 76 66 77 Initialized := True; 67 78 end; 68 79 69 procedure TMusicPlayer.EndPlay; 70 begin 71 if AutoPlayNext then Application.QueueAsyncCall(PlayNext, 0); 72 end; 73 74 procedure TMusicPlayer.LoopEndProc; 75 var 76 Position: Integer; 77 begin 78 Position := uos_InputPosition(PlayerIndex1, InputIndex1); 79 if Position >= InputLength then 80 Play; 80 procedure TMusicPlayer.EndPlay(PlayerIndex: cint32); 81 begin 82 if AutoPlayNext and (PlayerIndex = PlayerIndex1) then Application.QueueAsyncCall(PlayNext, 0); 81 83 end; 82 84 … … 152 154 153 155 AutoPlayNext := False; 154 //uos_Stop(PlayerIndex1); 155 uos_StopAndWait(PlayerIndex1); 156 157 //Inc(PlayerIndex1); 156 uos_Stop(PlayerIndex1); 157 158 Inc(PlayerIndex1); 158 159 159 160 uos_CreatePlayer(PlayerIndex1); -
trunk/Packages/Common/Languages/PixelPointer.cs.po
r593 r665 21 21 msgid "Wrong bitmap size [width: %d, height: %d]" 22 22 msgstr "Špatná velikost bitové mapy [šířka: %d, výška: %d]" 23 -
trunk/Packages/Common/Languages/Table.cs.po
r593 r665 15 15 msgid "Unsupported format" 16 16 msgstr "Nepodporovaný formát" 17 -
trunk/Packages/uos
-
Property svn:ignore
set to
lib
-
Property svn:ignore
set to
-
trunk/Packages/uos/uos.pas
r664 r665 575 575 {$else} 576 576 TProc = procedure of object; 577 TPlayerProc = procedure (PlayerIndex: cint32) of object; 577 578 {$endif} 578 579 … … 762 763 procedure DoTerminatePlayer; 763 764 procedure DoEndProc; 765 procedure EndProcExecute; 764 766 765 767 {$IF DEFINED (mse)} … … 795 797 796 798 // Procedure of object to execute at end of thread 797 EndProc: TP roc;799 EndProc: TPlayerProc; 798 800 799 801 // Procedure to execute at end of thread (not of object) … … 840 842 // Stop playing and free thread 841 843 procedure Stop (); 842 843 // Stop playing and free thread844 procedure StopAndWait ();845 844 846 845 // Pause playing … … 2471 2470 Status := 0; 2472 2471 end; 2473 end;2474 2475 procedure Tuos_Player.StopAndWait();2476 begin2477 Stop;2478 if Assigned(thethread) then thethread.WaitFor;2479 2472 end; 2480 2473 … … 9722 9715 {$IF not DEFINED (Library)} 9723 9716 if EndProc <> nil then 9724 thethread.{$IF DEFINED (usequeue)}Queue{$else}Synchronize{$endif} (thethread, EndProc);9717 thethread.{$IF DEFINED (usequeue)}Queue{$else}Synchronize{$endif} (thethread, @EndProcExecute); 9725 9718 9726 9719 {$elseif not DEFINED (java)} … … 9734 9727 end; 9735 9728 9729 procedure Tuos_Player.EndProcExecute; 9730 begin 9731 EndProc(Index); 9732 end; 9733 9736 9734 procedure Tuos_Player.DoTerminateNoFreePlayer; 9737 9735 var … … 9791 9789 if EndProc <> nil then 9792 9790 {$IF FPC_FULLVERSION>=20701} 9793 thethread.{$IF DEFINED (usequeue)}Queue{$else}Synchronize{$endif} (thethread, EndProc);9791 thethread.{$IF DEFINED (usequeue)}Queue{$else}Synchronize{$endif} (thethread, @EndProcExecute); 9794 9792 {$else} 9795 9793 thethread.{$IF DEFINED (usequeue)}Queue{$else}Synchronize{$endif} (thethread,EndProc); -
trunk/Packages/uos/uos_cdrom.pas
r664 r665 643 643 end; 644 644 645 Function CDROM_Close(var pCDROMI: PCDROMInfo): LongWord;645 Function CDROM_Close(var pCDROMI: PCDROMInfo): Integer; 646 646 Begin 647 647 Result := CDROM_UNKNOWNERR; -
trunk/Packages/uos/uos_flat.pas
r664 r665 197 197 {$else} 198 198 TProc = procedure of object; 199 TPlayerProc = procedure(PlayerIndex: cint32) of object; 199 200 {$endif} 200 201 … … 537 538 // PlayerIndex : Index of an existing Player 538 539 // InIndex : Index of an existing Input 539 procedure uos_EndProc(PlayerIndex: cint32; Proc: TP roc);540 procedure uos_EndProc(PlayerIndex: cint32; Proc: TPlayerProc); 540 541 541 542 // Assign the procedure (not of object) to execute at end, after loop … … 917 918 // Stop playing and free thread 918 919 procedure uos_Stop(PlayerIndex: cint32); 919 920 // Stop playing and free thread921 procedure uos_StopAndWait(PlayerIndex: cint32);922 920 923 921 // Pause playing … … 2299 2297 end; 2300 2298 2301 procedure uos_StopAndWait(PlayerIndex: cint32);2302 begin2303 if (length(uosPlayers) > 0) and (PlayerIndex < length(uosPlayers)) then2304 if uosPlayersStat[PlayerIndex] = 1 then2305 if Assigned(uosPlayers[PlayerIndex]) then2306 uosPlayers[PlayerIndex].StopAndWait()2307 {$IF DEFINED (mse)}2308 {$endif}2309 ;2310 end;2311 2312 2299 procedure uos_Pause(PlayerIndex: cint32);// Pause playing 2313 2300 begin … … 2328 2315 end; 2329 2316 2330 procedure uos_EndProc(PlayerIndex: cint32; Proc: TP roc);2317 procedure uos_EndProc(PlayerIndex: cint32; Proc: TPlayerProc); 2331 2318 // Assign the procedure of object to execute at end, after loop 2332 2319 // PlayerIndex : Index of an existing Player
Note:
See TracChangeset
for help on using the changeset viewer.