Changeset 303 for branches/highdpi/Packages/CevoComponents/Sound.pas
- Timestamp:
- Mar 9, 2021, 9:19:49 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/CevoComponents/Sound.pas
r210 r303 5 5 uses 6 6 UDpiControls, SysUtils, Classes, Graphics, Controls, Forms, fgl, FileUtil, 7 StringTables, Directories 7 StringTables, Directories, LCLType 8 8 {$IFDEF WINDOWS}, MMSystem, Windows{$ENDIF} 9 {$IFDEF LINUX}, Process, AsyncProcess {$ENDIF};9 {$IFDEF LINUX}, Process, AsyncProcess2{$ENDIF}; 10 10 11 11 type … … 40 40 constructor Create(const FileName: string); 41 41 destructor Destroy; override; 42 procedure Play(H WND: DWORD);42 procedure Play(Handle: HWND); 43 43 procedure Stop; 44 44 procedure Reset; … … 68 68 {$R *.lfm} 69 69 70 {$IFDEF LINUX} 70 71 resourcestring 71 72 SUnableToPlay = 'PlayStyle=%s: Unable to play %s Message:%s'; 72 73 SPlayCommandNotWork = 'The play command %s does not work on your system'; 74 {$ENDIF} 73 75 74 76 constructor TSound.Create(const FileName: string); … … 113 115 begin 114 116 Result := ''; 117 // Try ffplay 118 if (Result = '') then 119 if (FindDefaultExecutablePath('ffplay') <> '') then 120 Result := 'ffplay -autoexit -nodisp -loglevel quiet'; 115 121 // Try play 116 if (FindDefaultExecutablePath('play') <> '') then 117 Result := 'play'; 122 if (Result = '') then 123 if (FindDefaultExecutablePath('play') <> '') then 124 Result := 'play -q'; 118 125 // Try aplay 119 if ( result = '') then126 if (Result = '') then 120 127 if (FindDefaultExecutablePath('aplay') <> '') then 121 128 Result := 'aplay -q'; … … 136 143 if (FindDefaultExecutablePath('pacat') <> '') then 137 144 Result := 'pacat -p'; 138 // Try ffplay139 if (Result = '') then140 if (FindDefaultExecutablePath('ffplay') <> '') then141 result := 'ffplay -autoexit -nodisp';142 145 // Try cvlc 143 146 if (Result = '') then 144 147 if (FindDefaultExecutablePath('cvlc') <> '') then 145 result := 'cvlc -q --play-and-exit';148 Result := 'cvlc -q --play-and-exit'; 146 149 // Try canberra-gtk-play 147 150 if (Result = '') then … … 155 158 156 159 157 procedure TSound.Play(H WND: DWORD);160 procedure TSound.Play(Handle: HWND); 158 161 {$IFDEF WINDOWS} 159 162 var … … 169 172 if FDeviceID <> 0 then 170 173 begin 171 PlayParm.dwCallback := H WND;174 PlayParm.dwCallback := Handle; 172 175 mciSendCommand(FDeviceID, MCI_PLAY, MCI_NOTIFY, DWORD_PTR(@PlayParm)); 173 176 end … … 217 220 end; 218 221 finally 219 L.Free;222 FreeAndNil(L); 220 223 end; 221 224 end
Note:
See TracChangeset
for help on using the changeset viewer.