home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ioctlapi.zip
/
appsrc.zip
/
pddname.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-11-16
|
2KB
|
81 lines
//-----------------------------------------------------------------------------
// Freeware. This file may be used freely to promote the ioctl90 mixer API.
//-----------------------------------------------------------------------------
//
// OS/2 32-bit program to query the Physical Device Driver name
// for the default MMPM/2 WaveAudio device. Joe Nord 10-Mar-1999
//
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <os2.h>
#define INCL_OS2MM
#include <os2me.h>
#include "data.h"
ULONG GetAudioPDDName (char *pszPDDName)
{
ULONG ulRC;
char szAmpMix[9] = "AMPMIX01";
MCI_SYSINFO_PARMS SysInfo;
MCI_SYSINFO_LOGDEVICE SysInfoParm;
MCI_SYSINFO_QUERY_NAME QueryNameParm;
memset (&SysInfo, '\0', sizeof(SysInfo));
memset (&SysInfoParm, '\0', sizeof(SysInfoParm));
memset (&QueryNameParm, '\0', sizeof(QueryNameParm));
SysInfo.ulItem = MCI_SYSINFO_QUERY_NAMES;
SysInfo.usDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO;
SysInfo.pSysInfoParm = &QueryNameParm;
strcpy (QueryNameParm.szLogicalName, szAmpMix);
ulRC = mciSendCommand (0,
MCI_SYSINFO,
MCI_SYSINFO_ITEM | MCI_WAIT,
(PVOID) &SysInfo,
0);
if (ulRC != 0)
{
if (Options.Verbose || Options.Debug)
{
printf ("GetAudioPDDName mciSendCommand ulRC=%u\n", ulRC);
}
return (ulRC);
}
// Get PDD associated with our AmpMixer
// Device name is in pSysInfoParm->szPDDName
SysInfo.ulItem = MCI_SYSINFO_QUERY_DRIVER;
SysInfo.usDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO;
SysInfo.pSysInfoParm = &SysInfoParm;
strcpy (SysInfoParm.szInstallName, QueryNameParm.szInstallName);
ulRC = mciSendCommand (0,
MCI_SYSINFO,
MCI_SYSINFO_ITEM | MCI_WAIT,
(PVOID) &SysInfo,
0);
if (ulRC != 0)
{
if (Options.Verbose || Options.Debug)
{
printf ("GetAudioPDDName mciSendCommand ulRC=%u\n", ulRC);
}
return (ulRC);
}
strcpy (pszPDDName, SysInfoParm.szPDDName);
return (ulRC);
}