1 | /* $Id: maudio.cpp 561 2011-07-28 09:16:56Z rudi $ */
|
---|
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 |
|
---|
28 | #include "midi_idc.h" // RTMIDI interfaces,
|
---|
29 | #include "maudio.hpp"
|
---|
30 |
|
---|
31 | #pragma off (unreferenced)
|
---|
32 |
|
---|
33 |
|
---|
34 | void MIDIAUDIO::DevCaps(PAUDIO_CAPS pCaps)
|
---|
35 | {
|
---|
36 |
|
---|
37 | pCaps->ulSupport = SUPPORT_SUCCESS;
|
---|
38 | pCaps->ulDataSubType = SUBTYPE_NONE;
|
---|
39 | pCaps->ulResourceUnits = 1;
|
---|
40 | pCaps->ulResourceClass = 1;
|
---|
41 | pCaps->fCanRecord = FALSE;
|
---|
42 | pCaps->ulFlags = INPUT | // Input select is supported
|
---|
43 | OUTPUT | // Output select is supported
|
---|
44 | MONITOR | // Monitor is supported
|
---|
45 | VOLUME; // Volume control is supported
|
---|
46 | }
|
---|
47 |
|
---|
48 |
|
---|
49 | MIDIAUDIO::MIDIAUDIO( ULONG devicetype, TIMER* pTimer ) :
|
---|
50 | AUDIOHW( devicetype ),
|
---|
51 | _pTimer ( pTimer )
|
---|
52 | {};
|
---|
53 |
|
---|
54 |
|
---|
55 | // Default routines for RTMIDI - always return failure codes
|
---|
56 | // if these haven't been redefined by the sub-classes.
|
---|
57 |
|
---|
58 | int MIDIAUDIO::writeByte(BYTE b)
|
---|
59 | {
|
---|
60 | return 0; // Failure.
|
---|
61 | }
|
---|
62 |
|
---|
63 | int MIDIAUDIO::readByte(void)
|
---|
64 | {
|
---|
65 | return -1; // Failure.
|
---|
66 | }
|
---|
67 |
|
---|
68 | USHORT MIDIAUDIO::RTMIDI_OpenReceive(void)
|
---|
69 | {
|
---|
70 | return MIDIERRA_NO_HARDWARE;
|
---|
71 | }
|
---|
72 |
|
---|
73 | USHORT MIDIAUDIO::RTMIDI_OpenSend(void)
|
---|
74 | {
|
---|
75 | return MIDIERRA_NO_HARDWARE;
|
---|
76 | }
|
---|
77 |
|
---|
78 | USHORT MIDIAUDIO::RTMIDI_CloseReceive(void)
|
---|
79 | {
|
---|
80 | return MIDIERRA_NO_HARDWARE;
|
---|
81 | }
|
---|
82 |
|
---|
83 | USHORT MIDIAUDIO::RTMIDI_CloseSend(void)
|
---|
84 | {
|
---|
85 | return MIDIERRA_NO_HARDWARE;
|
---|
86 | }
|
---|