ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

speaker.c
Go to the documentation of this file.
00001 /*
00002     ReactOS Sound System
00003     Sound Blaster DSP support
00004     Speaker commands
00005 
00006     Author:
00007         Andrew Greenwood (silverblade@reactos.org)
00008 
00009     History:
00010         2 July 2008 - Created (split from sbdsp.c)
00011 
00012     Notes:
00013         Functions documented in sbdsp.h
00014 */
00015 
00016 #include "precomp.h"
00017 
00018 NTSTATUS
00019 SbDspEnableSpeaker(
00020     IN  PUCHAR BasePort,
00021     IN  ULONG Timeout)
00022 {
00023     return SbDspWrite(BasePort, SB_DSP_SPEAKER_ON, Timeout);
00024 }
00025 
00026 NTSTATUS
00027 SbDspDisableSpeaker(
00028     IN  PUCHAR BasePort,
00029     IN  ULONG Timeout)
00030 {
00031     return SbDspWrite(BasePort, SB_DSP_SPEAKER_OFF, Timeout);
00032 }
00033 
00034 /*
00035     VirtualBox doesn't seem to support this.
00036 */
00037 NTSTATUS
00038 SbDspIsSpeakerEnabled(
00039     IN  PUCHAR BasePort,
00040     OUT PBOOLEAN IsEnabled,
00041     IN  ULONG Timeout)
00042 {
00043     NTSTATUS Status;
00044     UCHAR SpeakerStatus = 0;
00045 
00046     if ( ! IsEnabled )
00047         return STATUS_INVALID_PARAMETER_2;
00048 
00049     /* Request the speaker status */
00050     Status = SbDspWrite(BasePort, SB_DSP_SPEAKER_STATUS, Timeout);
00051     if ( Status != STATUS_SUCCESS )
00052         return Status;
00053 
00054     /* Obtain the status */
00055     Status = SbDspRead(BasePort, &SpeakerStatus, Timeout);
00056     if ( Status != STATUS_SUCCESS )
00057         return Status;
00058 
00059     DbgPrint("SBDSP - SpeakerStatus is %02x\n", SpeakerStatus);
00060     *IsEnabled = (SpeakerStatus == 0xFF);
00061 
00062     return STATUS_SUCCESS;
00063 }

Generated on Sat May 26 2012 04:35:03 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.