Ignore:
Timestamp:
Nov 29, 2023, 2:35:44 PM (6 months ago)
Author:
chronos
Message:
  • Modified: HighDpi branch updated to trunk version.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/Sound.pas

    r405 r463  
    44
    55uses
    6   UDpiControls, SysUtils, Classes, Graphics, Controls, Forms, fgl, FileUtil,
     6  UDpiControls, SysUtils, Classes, Graphics, Controls, Forms, Generics.Collections, FileUtil,
    77  StringTables, Directories, LCLType
    88  {$IFDEF WINDOWS}, MMSystem, Windows{$ENDIF}
    9   {$IFDEF LINUX}, Process, AsyncProcess2{$ENDIF};
     9  {$IFDEF UNIX}, Process, AsyncProcess2{$ENDIF};
    1010
    1111type
     
    2929  TSound = class
    3030  private
    31     {$IFDEF LINUX}
     31    {$IFDEF UNIX}
    3232    PlayCommand: string;
    3333    SoundPlayerAsyncProcess: TAsyncProcess;
     
    5555  SoundMode: TSoundMode;
    5656  SoundPlayer: TSoundPlayer;
    57   SoundList: TFPGObjectList<TSound>;
     57  SoundList: TObjectList<TSound>;
    5858  PlayingSound: TSound;
    5959
     
    6363{$R *.lfm}
    6464
    65 {$IFDEF LINUX}
     65{$IFDEF UNIX}
    6666resourcestring
    6767  SUnableToPlay = 'PlayStyle=%s: Unable to play %s Message:%s';
     
    8888  end
    8989  {$ENDIF}
    90   {$IFDEF LINUX}
     90  {$IFDEF UNIX}
    9191  PlayCommand := GetNonWindowsPlayCommand;
    9292  FDeviceID := 1;
     
    100100    mciSendCommand(FDeviceID, MCI_CLOSE, MCI_WAIT, 0);
    101101  {$ENDIF}
    102   {$IFDEF LINUX}
     102  {$IFDEF UNIX}
    103103  FreeAndNil(SoundPlayerSyncProcess);
    104104  FreeAndNil(SoundPlayerAsyncProcess);
     
    162162  PlayParm: TMCI_Play_Parms;
    163163{$ENDIF}
    164 {$IFDEF LINUX}
     164{$IFDEF UNIX}
    165165var
    166166  L: TStringList;
     
    175175  end
    176176  {$ENDIF}
    177   {$IFDEF LINUX}
     177  {$IFDEF UNIX}
    178178  // How to play in Linux? Use generic Linux commands
    179179  // Use asyncprocess to play sound as SND_ASYNC
     
    232232  mciSendCommand(FDeviceID, MCI_STOP, 0, 0);
    233233  {$ENDIF}
    234   {$IFDEF LINUX}
     234  {$IFDEF UNIX}
    235235  if SoundPlayerSyncProcess <> nil then SoundPlayerSyncProcess.Terminate(1);
    236236  if SoundPlayerAsyncProcess <> nil then SoundPlayerAsyncProcess.Terminate(1);
     
    280280begin
    281281  Result := 0;
    282   while (Result < SoundList.Count) and (SoundList[result].FFileName <> FileName) do
     282  while (Result < SoundList.Count) and (SoundList[Result].FFileName <> FileName) do
    283283    Inc(Result);
    284284  if Result = SoundList.Count then begin
     
    333333procedure UnitInit;
    334334begin
    335   SoundList := TFPGObjectList<TSound>.Create;
     335  SoundList := TObjectList<TSound>.Create;
    336336  PlayingSound := nil;
    337337  SoundPlayer := nil;
Note: See TracChangeset for help on using the changeset viewer.