1 | /* $Id: maudio.cpp 142 2000-04-23 14:55:46Z ktk $ */
|
---|
2 |
|
---|
3 | /* SCCSID = %W% %E% */
|
---|
4 | /****************************************************************************
|
---|
5 | * *
|
---|
6 | * Copyright (c) IBM Corporation 1994 - 1997. *
|
---|
7 | * *
|
---|
8 | * The following IBM OS/2 source code is provided to you solely for the *
|
---|
9 | * the purpose of assisting you in your development of OS/2 device drivers. *
|
---|
10 | * You may use this code in accordance with the IBM License Agreement *
|
---|
11 | * provided in the IBM Device Driver Source Kit for OS/2. *
|
---|
12 | * *
|
---|
13 | ****************************************************************************/
|
---|
14 | /**@internal %W%
|
---|
15 | * MIDI audio hardware object implementation.
|
---|
16 | * @version %I%
|
---|
17 | * @context
|
---|
18 | * Unless otherwise noted, all interfaces are Ring-0, 16-bit, kernel stack.
|
---|
19 | * @notes
|
---|
20 | * @history
|
---|
21 | */
|
---|
22 |
|
---|
23 | #define INCL_NOPMAPI
|
---|
24 | #include <os2.h>
|
---|
25 | #include <os2medef.h>
|
---|
26 | #include <audio.h>
|
---|
27 | #include "..\midi\midi_idc.h" // RTMIDI interfaces,
|
---|
28 | #include "maudio.hpp"
|
---|
29 |
|
---|
30 | #pragma off (unreferenced)
|
---|
31 |
|
---|
32 |
|
---|
33 | void MIDIAUDIO::DevCaps(PAUDIO_CAPS pCaps)
|
---|
34 | {
|
---|
35 |
|
---|
36 | pCaps->ulSupport = SUPPORT_SUCCESS;
|
---|
37 | pCaps->ulDataSubType = SUBTYPE_NONE;
|
---|
38 | pCaps->ulResourceUnits = 1;
|
---|
39 | pCaps->ulResourceClass = 1;
|
---|
40 | pCaps->fCanRecord = FALSE;
|
---|
41 | pCaps->ulFlags = INPUT | // Input select is supported
|
---|
42 | OUTPUT | // Output select is supported
|
---|
43 | MONITOR | // Monitor is supported
|
---|
44 | VOLUME; // Volume control is supported
|
---|
45 | }
|
---|
46 |
|
---|
47 |
|
---|
48 | MIDIAUDIO::MIDIAUDIO( ULONG devicetype, TIMER* pTimer ) :
|
---|
49 | AUDIOHW( devicetype ),
|
---|
50 | _pTimer ( pTimer )
|
---|
51 | {};
|
---|
52 |
|
---|
53 |
|
---|
54 | // Default routines for RTMIDI - always return failure codes
|
---|
55 | // if these haven't been redefined by the sub-classes.
|
---|
56 |
|
---|
57 | virtual int MIDIAUDIO::writeByte(BYTE b)
|
---|
58 | {
|
---|
59 | return 0; // Failure.
|
---|
60 | }
|
---|
61 |
|
---|
62 | virtual int MIDIAUDIO::readByte(void)
|
---|
63 | {
|
---|
64 | return -1; // Failure.
|
---|
65 | }
|
---|
66 |
|
---|
67 | USHORT MIDIAUDIO::RTMIDI_OpenReceive(void)
|
---|
68 | {
|
---|
69 | return MIDIERRA_NO_HARDWARE;
|
---|
70 | }
|
---|
71 |
|
---|
72 | USHORT MIDIAUDIO::RTMIDI_OpenSend(void)
|
---|
73 | {
|
---|
74 | return MIDIERRA_NO_HARDWARE;
|
---|
75 | }
|
---|
76 |
|
---|
77 | USHORT MIDIAUDIO::RTMIDI_CloseReceive(void)
|
---|
78 | {
|
---|
79 | return MIDIERRA_NO_HARDWARE;
|
---|
80 | }
|
---|
81 |
|
---|
82 | USHORT MIDIAUDIO::RTMIDI_CloseSend(void)
|
---|
83 | {
|
---|
84 | return MIDIERRA_NO_HARDWARE;
|
---|
85 | }
|
---|