Changeset 463 for branches/highdpi/Packages/CevoComponents/Sound.pas
- Timestamp:
- Nov 29, 2023, 2:35:44 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/CevoComponents/Sound.pas
r405 r463 4 4 5 5 uses 6 UDpiControls, SysUtils, Classes, Graphics, Controls, Forms, fgl, FileUtil,6 UDpiControls, SysUtils, Classes, Graphics, Controls, Forms, Generics.Collections, FileUtil, 7 7 StringTables, Directories, LCLType 8 8 {$IFDEF WINDOWS}, MMSystem, Windows{$ENDIF} 9 {$IFDEF LINUX}, Process, AsyncProcess2{$ENDIF};9 {$IFDEF UNIX}, Process, AsyncProcess2{$ENDIF}; 10 10 11 11 type … … 29 29 TSound = class 30 30 private 31 {$IFDEF LINUX}31 {$IFDEF UNIX} 32 32 PlayCommand: string; 33 33 SoundPlayerAsyncProcess: TAsyncProcess; … … 55 55 SoundMode: TSoundMode; 56 56 SoundPlayer: TSoundPlayer; 57 SoundList: T FPGObjectList<TSound>;57 SoundList: TObjectList<TSound>; 58 58 PlayingSound: TSound; 59 59 … … 63 63 {$R *.lfm} 64 64 65 {$IFDEF LINUX}65 {$IFDEF UNIX} 66 66 resourcestring 67 67 SUnableToPlay = 'PlayStyle=%s: Unable to play %s Message:%s'; … … 88 88 end 89 89 {$ENDIF} 90 {$IFDEF LINUX}90 {$IFDEF UNIX} 91 91 PlayCommand := GetNonWindowsPlayCommand; 92 92 FDeviceID := 1; … … 100 100 mciSendCommand(FDeviceID, MCI_CLOSE, MCI_WAIT, 0); 101 101 {$ENDIF} 102 {$IFDEF LINUX}102 {$IFDEF UNIX} 103 103 FreeAndNil(SoundPlayerSyncProcess); 104 104 FreeAndNil(SoundPlayerAsyncProcess); … … 162 162 PlayParm: TMCI_Play_Parms; 163 163 {$ENDIF} 164 {$IFDEF LINUX}164 {$IFDEF UNIX} 165 165 var 166 166 L: TStringList; … … 175 175 end 176 176 {$ENDIF} 177 {$IFDEF LINUX}177 {$IFDEF UNIX} 178 178 // How to play in Linux? Use generic Linux commands 179 179 // Use asyncprocess to play sound as SND_ASYNC … … 232 232 mciSendCommand(FDeviceID, MCI_STOP, 0, 0); 233 233 {$ENDIF} 234 {$IFDEF LINUX}234 {$IFDEF UNIX} 235 235 if SoundPlayerSyncProcess <> nil then SoundPlayerSyncProcess.Terminate(1); 236 236 if SoundPlayerAsyncProcess <> nil then SoundPlayerAsyncProcess.Terminate(1); … … 280 280 begin 281 281 Result := 0; 282 while (Result < SoundList.Count) and (SoundList[ result].FFileName <> FileName) do282 while (Result < SoundList.Count) and (SoundList[Result].FFileName <> FileName) do 283 283 Inc(Result); 284 284 if Result = SoundList.Count then begin … … 333 333 procedure UnitInit; 334 334 begin 335 SoundList := T FPGObjectList<TSound>.Create;335 SoundList := TObjectList<TSound>.Create; 336 336 PlayingSound := nil; 337 337 SoundPlayer := nil;
Note:
See TracChangeset
for help on using the changeset viewer.