ReactOS  0.4.15-dev-1397-g19779b3
speaker.c
Go to the documentation of this file.
1 /*
2  ReactOS Sound System
3  Sound Blaster DSP support
4  Speaker commands
5 
6  Author:
7  Andrew Greenwood (silverblade@reactos.org)
8 
9  History:
10  2 July 2008 - Created (split from sbdsp.c)
11 
12  Notes:
13  Functions documented in sbdsp.h
14 */
15 
16 #include "precomp.h"
17 
20  IN PUCHAR BasePort,
22 {
23  return SbDspWrite(BasePort, SB_DSP_SPEAKER_ON, Timeout);
24 }
25 
28  IN PUCHAR BasePort,
30 {
31  return SbDspWrite(BasePort, SB_DSP_SPEAKER_OFF, Timeout);
32 }
33 
34 /*
35  VirtualBox doesn't seem to support this.
36 */
39  IN PUCHAR BasePort,
42 {
44  UCHAR SpeakerStatus = 0;
45 
46  if ( ! IsEnabled )
48 
49  /* Request the speaker status */
51  if ( Status != STATUS_SUCCESS )
52  return Status;
53 
54  /* Obtain the status */
55  Status = SbDspRead(BasePort, &SpeakerStatus, Timeout);
56  if ( Status != STATUS_SUCCESS )
57  return Status;
58 
59  DbgPrint("SBDSP - SpeakerStatus is %02x\n", SpeakerStatus);
60  *IsEnabled = (SpeakerStatus == 0xFF);
61 
62  return STATUS_SUCCESS;
63 }
#define IN
Definition: typedefs.h:39
NTSTATUS SbDspWrite(IN PUCHAR BasePort, IN UCHAR DataByte, IN ULONG Timeout)
Definition: dsp_io.c:99
#define DbgPrint
Definition: loader.c:25
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS SbDspRead(IN PUCHAR BasePort, OUT PUCHAR DataByte, IN ULONG Timeout)
Definition: dsp_io.c:120
NTSTATUS SbDspIsSpeakerEnabled(IN PUCHAR BasePort, OUT PBOOLEAN IsEnabled, IN ULONG Timeout)
Definition: speaker.c:38
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:476
Status
Definition: gdiplustypes.h:24
return pProvider IsEnabled(ProviderControl)
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
#define SB_DSP_SPEAKER_ON
Definition: sbdsp.h:75
NTSTATUS SbDspEnableSpeaker(IN PUCHAR BasePort, IN ULONG Timeout)
Definition: speaker.c:19
static ULONG Timeout
Definition: ping.c:61
#define SB_DSP_SPEAKER_OFF
Definition: sbdsp.h:76
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS SbDspDisableSpeaker(IN PUCHAR BasePort, IN ULONG Timeout)
Definition: speaker.c:27
#define STATUS_SUCCESS
Definition: shellext.h:65
#define SB_DSP_SPEAKER_STATUS
Definition: sbdsp.h:77