Changeset 353 for CoolAudio/Systems/WinAPI/UAudioSystemWindows.pas
- Timestamp:
- Apr 23, 2012, 2:57:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolAudio/Systems/WinAPI/UAudioSystemWindows.pas
r352 r353 11 11 12 12 type 13 14 { TAudioSystemWindows } 15 13 16 TAudioSystemWindows = class(TAudioSystem) 14 17 public 15 18 PlayerIndex: Integer; 19 function GetMediaPlayerDriverClass: TMediaPlayerDriverClass; override; 16 20 end; 17 21 … … 21 25 { TPlayerWindows } 22 26 23 TPlayerWindows = class(T Player)27 TPlayerWindows = class(TMediaPlayerDriver) 24 28 private 25 29 FHandle: HWND; … … 47 51 procedure Pause; override; 48 52 procedure Stop; override; 49 constructor Create (AOwner: TComponent); override;53 constructor Create; override; 50 54 destructor Destroy; override; 51 55 property DeviceType: TMPDeviceTypes read FDeviceType write SetDeviceType; … … 60 64 61 65 implementation 66 67 { TAudioSystemWindows } 68 69 function TAudioSystemWindows.GetMediaPlayerDriverClass: TMediaPlayerDriverClass; 70 begin 71 Result := TPlayerWindows; 72 end; 62 73 63 74 {$IFDEF Windows} … … 175 186 Parm: TMCI_Generic_Parms; 176 187 begin 177 if FPlaying then begin 178 CheckError(mciSendCommand(FDeviceID, mci_Pause, FFlags, Longint(@Parm))); 179 FPlaying := False; 180 end else begin 181 CheckError(mciSendCommand(FDeviceID, mci_Resume, FFlags, Longint(@Parm))); 182 FPlaying := True; 188 if FActive then begin 189 if FPlaying then begin 190 CheckError(mciSendCommand(FDeviceID, mci_Pause, FFlags, Longint(@Parm))); 191 FPlaying := False; 192 end else begin 193 CheckError(mciSendCommand(FDeviceID, mci_Resume, FFlags, Longint(@Parm))); 194 FPlaying := True; 195 end; 183 196 end; 184 197 end; … … 188 201 Parm: TMCI_Generic_Parms; 189 202 begin 190 if F Playing then begin203 if FActive and FPlaying then begin 191 204 FFlags := 0; 192 205 if FUseNotify then … … 206 219 end; 207 220 208 constructor TPlayerWindows.Create (AOwner: TComponent);221 constructor TPlayerWindows.Create; 209 222 begin 210 223 inherited;
Note:
See TracChangeset
for help on using the changeset viewer.