ReactOS 0.4.15-dev-7998-gdb93cb1
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}
LONG NTSTATUS
Definition: precomp.h:26
return pProvider IsEnabled(ProviderControl)
Status
Definition: gdiplustypes.h:25
#define DbgPrint
Definition: hal.h:12
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:476
static ULONG Timeout
Definition: ping.c:61
#define SB_DSP_SPEAKER_ON
Definition: sbdsp.h:75
NTSTATUS SbDspWrite(IN PUCHAR BasePort, IN UCHAR DataByte, IN ULONG Timeout)
Definition: dsp_io.c:99
NTSTATUS SbDspRead(IN PUCHAR BasePort, OUT PUCHAR DataByte, IN ULONG Timeout)
Definition: dsp_io.c:120
#define SB_DSP_SPEAKER_OFF
Definition: sbdsp.h:76
#define SB_DSP_SPEAKER_STATUS
Definition: sbdsp.h:77
NTSTATUS SbDspEnableSpeaker(IN PUCHAR BasePort, IN ULONG Timeout)
Definition: speaker.c:19
NTSTATUS SbDspDisableSpeaker(IN PUCHAR BasePort, IN ULONG Timeout)
Definition: speaker.c:27
NTSTATUS SbDspIsSpeakerEnabled(IN PUCHAR BasePort, OUT PBOOLEAN IsEnabled, IN ULONG Timeout)
Definition: speaker.c:38
#define STATUS_SUCCESS
Definition: shellext.h:65
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
unsigned char UCHAR
Definition: xmlstorage.h:181