mirror of
https://github.com/reactos/reactos.git
synced 2024-11-11 01:04:11 +00:00
29fa274d6d
- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers) - If someone wants to delete aicom-network-fixes, they are welcome to - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea svn path=/branches/aicom-network-branch/; revision=44353
66 lines
1.3 KiB
C
66 lines
1.3 KiB
C
/*
|
|
ReactOS Sound System
|
|
Sound Blaster DSP support
|
|
Speaker commands
|
|
|
|
Author:
|
|
Andrew Greenwood (silverblade@reactos.org)
|
|
|
|
History:
|
|
2 July 2008 - Created (split from sbdsp.c)
|
|
|
|
Notes:
|
|
Functions documented in sbdsp.h
|
|
*/
|
|
|
|
#include <ntddk.h>
|
|
#include <debug.h>
|
|
|
|
#include <sbdsp.h>
|
|
|
|
NTSTATUS
|
|
SbDspEnableSpeaker(
|
|
IN PUCHAR BasePort,
|
|
IN ULONG Timeout)
|
|
{
|
|
return SbDspWrite(BasePort, SB_DSP_SPEAKER_ON, Timeout);
|
|
}
|
|
|
|
NTSTATUS
|
|
SbDspDisableSpeaker(
|
|
IN PUCHAR BasePort,
|
|
IN ULONG Timeout)
|
|
{
|
|
return SbDspWrite(BasePort, SB_DSP_SPEAKER_OFF, Timeout);
|
|
}
|
|
|
|
/*
|
|
VirtualBox doesn't seem to support this.
|
|
*/
|
|
NTSTATUS
|
|
SbDspIsSpeakerEnabled(
|
|
IN PUCHAR BasePort,
|
|
OUT PBOOLEAN IsEnabled,
|
|
IN ULONG Timeout)
|
|
{
|
|
NTSTATUS Status;
|
|
UCHAR SpeakerStatus = 0;
|
|
|
|
if ( ! IsEnabled )
|
|
return STATUS_INVALID_PARAMETER_2;
|
|
|
|
/* Request the speaker status */
|
|
Status = SbDspWrite(BasePort, SB_DSP_SPEAKER_STATUS, Timeout);
|
|
if ( Status != STATUS_SUCCESS )
|
|
return Status;
|
|
|
|
/* Obtain the status */
|
|
Status = SbDspRead(BasePort, &SpeakerStatus, Timeout);
|
|
if ( Status != STATUS_SUCCESS )
|
|
return Status;
|
|
|
|
DbgPrint("SBDSP - SpeakerStatus is %02x\n", SpeakerStatus);
|
|
*IsEnabled = (SpeakerStatus == 0xFF);
|
|
|
|
return STATUS_SUCCESS;
|
|
}
|