Rev 4 | Rev 57 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4 | Rev 16 | ||
---|---|---|---|
Line 634... | Line 634... | ||
634 | begin |
634 | begin |
635 | Result := TDirectSoundCreate(DXLoadLibrary('DSound.dll', 'DirectSoundCreate')) |
635 | Result := TDirectSoundCreate(DXLoadLibrary('DSound.dll', 'DirectSoundCreate')) |
636 | (lpGUID, lpDS, pUnkOuter); |
636 | (lpGUID, lpDS, pUnkOuter); |
637 | end; |
637 | end; |
638 | 638 | ||
639 | function DXDirectSoundEnumerate(lpCallback: TDSEnumCallbackA; |
639 | function DXDirectSoundEnumerate(lpCallback: {$IFDEF UNICODE}TDSEnumCallbackW{$ELSE}TDSEnumCallbackA{$ENDIF}; |
640 | lpContext: Pointer): HRESULT; |
640 | lpContext: Pointer): HRESULT; |
641 | type |
641 | type |
642 | TDirectSoundEnumerate = function(lpCallback: TDSEnumCallbackA; |
642 | TDirectSoundEnumerate = function(lpCallback: {$IFDEF UNICODE}TDSEnumCallbackW{$ELSE}TDSEnumCallbackA{$ENDIF}; |
643 | lpContext: Pointer): HRESULT; stdcall; |
643 | lpContext: Pointer): HRESULT; stdcall; |
644 | begin |
644 | begin |
645 | Result := TDirectSoundEnumerate(DXLoadLibrary('DSound.dll', 'DirectSoundEnumerateA')) |
645 | Result := TDirectSoundEnumerate(DXLoadLibrary('DSound.dll', {$IFDEF UNICODE}'DirectSoundEnumerateW'{$ELSE}'DirectSoundEnumerateA'{$ENDIF})) |
646 | (lpCallback, lpContext); |
646 | (lpCallback, lpContext); |
647 | end; |
647 | end; |
648 | 648 | ||
649 | function DXDirectSoundCaptureCreate(lpGUID: PGUID; out lplpDSC: IDirectSoundCapture; |
649 | function DXDirectSoundCaptureCreate(lpGUID: PGUID; out lplpDSC: IDirectSoundCapture; |
650 | pUnkOuter: IUnknown): HRESULT; |
650 | pUnkOuter: IUnknown): HRESULT; |
Line 665... | Line 665... | ||
665 | type |
665 | type |
666 | TDirectSoundCaptureEnumerate = function(lpCallback: TDSEnumCallbackA; |
666 | TDirectSoundCaptureEnumerate = function(lpCallback: TDSEnumCallbackA; |
667 | lpContext: Pointer): HRESULT; stdcall; |
667 | lpContext: Pointer): HRESULT; stdcall; |
668 | begin |
668 | begin |
669 | try |
669 | try |
670 | Result := TDirectSoundCaptureEnumerate(DXLoadLibrary('DSound.dll', 'DirectSoundCaptureEnumerateA')) |
670 | Result := TDirectSoundCaptureEnumerate(DXLoadLibrary('DSound.dll', {$IFDEF UNICODE}'DirectSoundCaptureEnumerateW'{$ELSE}'DirectSoundCaptureEnumerateA'{$ENDIF})) |
671 | (lpCallback, lpContext); |
671 | (lpCallback, lpContext); |
672 | except |
672 | except |
673 | raise EDirectXError.Create(SSinceDirectX5); |
673 | raise EDirectXError.Create(SSinceDirectX5); |
674 | end; |
674 | end; |
675 | end; |
675 | end; |
Line 2176... | Line 2176... | ||
2176 | FOnFilledBuffer := Value; |
2176 | FOnFilledBuffer := Value; |
2177 | 2177 | ||
2178 | if Assigned(FOnFilledBuffer) then |
2178 | if Assigned(FOnFilledBuffer) then |
2179 | begin |
2179 | begin |
2180 | FNotifyThread := TSoundCaptureStreamNotify.Create(Self); |
2180 | FNotifyThread := TSoundCaptureStreamNotify.Create(Self); |
2181 | FNotifyThread.Resume; |
2181 | FNotifyThread.{$IFDEF VER14UP}Start{$ELSE}Resume{$ENDIF}; |
2182 | end; |
2182 | end; |
2183 | end else |
2183 | end else |
2184 | FOnFilledBuffer := Value; |
2184 | FOnFilledBuffer := Value; |
2185 | end; |
2185 | end; |
2186 | 2186 | ||
Line 2211... | Line 2211... | ||
2211 | FBuffer.Start(DSCBSTART_LOOPING); |
2211 | FBuffer.Start(DSCBSTART_LOOPING); |
2212 | 2212 | ||
2213 | if Assigned(FOnFilledBuffer) then |
2213 | if Assigned(FOnFilledBuffer) then |
2214 | begin |
2214 | begin |
2215 | FNotifyThread := TSoundCaptureStreamNotify.Create(Self); |
2215 | FNotifyThread := TSoundCaptureStreamNotify.Create(Self); |
2216 | FNotifyThread.Resume; |
2216 | FNotifyThread.{$IFDEF VER14UP}Start{$ELSE}Resume{$ENDIF}; |
2217 | end; |
2217 | end; |
2218 | except |
2218 | except |
2219 | Stop; |
2219 | Stop; |
2220 | raise; |
2220 | raise; |
2221 | end; |
2221 | end; |