[142] | 1 | /* $Id: maudio.hpp 205 2007-06-14 01:33:51Z stevenhl $ */
|
---|
| 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 definition.
|
---|
| 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 | #ifndef MIDIAUDIO_INCLUDED
|
---|
| 24 | #define MIDIAUDIO_INCLUDED
|
---|
| 25 |
|
---|
| 26 | #ifndef OS2_INCLUDED
|
---|
| 27 | #define INCL_NOPMAPI
|
---|
| 28 | #include <os2.h>
|
---|
| 29 | #endif
|
---|
| 30 |
|
---|
[205] | 31 | #include "midi_idc.h" // RTMIDI interfaces, MIDI_NAME_LENGTH
|
---|
[142] | 32 | #include "audiohw.hpp" // Object definition.
|
---|
| 33 | #include "timer.hpp" // Object definition.
|
---|
| 34 |
|
---|
| 35 | class MIDIAUDIO : public AUDIOHW {
|
---|
| 36 | protected:
|
---|
| 37 | MIDIAUDIO (ULONG devicetype, TIMER* pTimer );
|
---|
| 38 | public:
|
---|
| 39 | // RT MIDI Data
|
---|
| 40 | char szRTMIDI_Name[MIDI_NAME_LENGTH];
|
---|
| 41 | // RTMIDI gets a pointer to this string.
|
---|
| 42 | ULONG ulRTMIDI_Caps; // RTMIDI defined capability bits.
|
---|
| 43 | ULONG ulRTMIDI_Handle; // Provided to us by RTMIDI (aka MIDI.SYS)
|
---|
| 44 |
|
---|
| 45 | // Entry points into RTMIDI (MIDI.SYS) provided to us by IDC interface.
|
---|
| 46 | PFNMIDI_SENDBYTE pfnSendByte;
|
---|
| 47 | PFNMIDI_SENDSTRING pfnSendString;
|
---|
| 48 | PFNMIDI_DEREGISTER pfnDeregister;
|
---|
| 49 |
|
---|
| 50 | // Methods
|
---|
| 51 |
|
---|
| 52 | // Writes byte to data port. Returns 0 if failure, 1 on success
|
---|
| 53 | virtual int writeByte(BYTE);
|
---|
| 54 |
|
---|
| 55 | // Read data port. Data read is in LSB with MSB==0 on good read.
|
---|
| 56 | // Returns -1 on err.
|
---|
| 57 | virtual int readByte(void);
|
---|
| 58 |
|
---|
| 59 | // Device caps for MMPM/2 IOCTL interface.
|
---|
| 60 | virtual void DevCaps(PAUDIO_CAPS pCaps);
|
---|
| 61 |
|
---|
| 62 | // Start and stop hardware operating.
|
---|
| 63 | virtual int Start(STREAM *stream) = 0;
|
---|
| 64 | virtual int Stop(STREAM *stream) = 0;
|
---|
| 65 |
|
---|
| 66 | // Standard MIDI channel commands.
|
---|
| 67 | virtual void noteOff( BYTE mchan, BYTE note, BYTE velocity ) = 0;
|
---|
| 68 | virtual void noteOn( BYTE mchan, BYTE note, BYTE velocity ) = 0;
|
---|
| 69 | virtual void polyphonicPressure( BYTE mchan, BYTE note, BYTE value ) = 0;
|
---|
| 70 | virtual void controlChange( BYTE mchan, BYTE control_number, BYTE value ) = 0;
|
---|
| 71 | virtual void programChange( BYTE mchan, BYTE program_number ) = 0;
|
---|
| 72 | virtual void channelPressure( BYTE mchan, BYTE value ) = 0;
|
---|
| 73 | virtual void pitchBend( BYTE mchan, BYTE value_lsb, BYTE value_msb ) = 0;
|
---|
| 74 |
|
---|
| 75 | // Services provided to the RTMIDI interface.
|
---|
| 76 | virtual USHORT RTMIDI_OpenReceive(void);
|
---|
| 77 | virtual USHORT RTMIDI_OpenSend(void);
|
---|
| 78 | virtual USHORT RTMIDI_CloseReceive(void);
|
---|
| 79 | virtual USHORT RTMIDI_CloseSend(void);
|
---|
| 80 |
|
---|
| 81 | // Timer association.
|
---|
| 82 | inline TIMER* getTimer( void ) { return _pTimer; }
|
---|
| 83 |
|
---|
| 84 | private:
|
---|
| 85 | TIMER* _pTimer; // Timer associated with this hardware.
|
---|
| 86 |
|
---|
| 87 | };
|
---|
| 88 |
|
---|
| 89 | #endif
|
---|