[142] | 1 | /* $Id: mpu401.hpp 151 2000-05-28 16:50:46Z sandervl $ */
|
---|
| 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 | * MPU_401 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 MPU401_INCLUDED
|
---|
| 24 | #define MPU401_INCLUDED
|
---|
| 25 |
|
---|
| 26 | #ifndef OS2_INCLUDED
|
---|
| 27 | #define INCL_NOPMAPI
|
---|
| 28 | #include <os2.h>
|
---|
| 29 | #endif
|
---|
| 30 |
|
---|
| 31 | #include "maudio.hpp"
|
---|
| 32 | #include "irq.hpp"
|
---|
| 33 |
|
---|
| 34 | #define DSR 0x80
|
---|
| 35 | #define DRR 0x40
|
---|
| 36 |
|
---|
| 37 | unsigned MPUcommand(USHORT, BYTE);
|
---|
| 38 | // sends byte to an I/O address. Returns non-zero if error
|
---|
| 39 |
|
---|
| 40 | class MPU_401 : public MIDIAUDIO {
|
---|
| 41 | int fOpenedSend; // TRUE if opened for RTMIDI Send (recording)
|
---|
| 42 | int fOpenedRecv; // TRUE if opened for RTMIDI Receive (playback)
|
---|
| 43 | BYTE n; // This is the nth MPU-401
|
---|
| 44 | int _iAllNotesOff(void); // function to turn all notes off
|
---|
[147] | 45 | ULONG midiInStreamId;
|
---|
| 46 | ULONG midiOutStreamId;
|
---|
[142] | 47 | public:
|
---|
| 48 | // Constructor.
|
---|
| 49 | MPU_401( TIMER* pTimer );
|
---|
| 50 |
|
---|
[151] | 51 | static void processIrq(unsigned long streamid);
|
---|
| 52 |
|
---|
[142] | 53 | // Standard MIDI channel commands.
|
---|
| 54 | virtual void noteOff( BYTE mchan, BYTE note, BYTE velocity );
|
---|
| 55 | virtual void noteOn( BYTE mchan, BYTE note, BYTE velocity );
|
---|
| 56 | virtual void polyphonicPressure( BYTE mchan, BYTE note, BYTE value );
|
---|
| 57 | virtual void controlChange( BYTE mchan, BYTE control_number, BYTE value );
|
---|
| 58 | virtual void programChange( BYTE mchan, BYTE program_number );
|
---|
| 59 | virtual void channelPressure( BYTE mchan, BYTE value );
|
---|
| 60 | virtual void pitchBend( BYTE mchan, BYTE value_lsb, BYTE value_msb );
|
---|
| 61 |
|
---|
| 62 | // Direct byte level IO... used for handling System Common & Exclusive
|
---|
| 63 | // commands, as well as for RTMIDI
|
---|
| 64 | virtual int writeByte(BYTE b);
|
---|
| 65 | virtual int readByte(void);
|
---|
| 66 |
|
---|
| 67 | // Stream control.
|
---|
| 68 | virtual int Reset(STREAM *stream);
|
---|
| 69 | virtual int Start(STREAM *stream);
|
---|
| 70 | virtual int Stop(STREAM *stream);
|
---|
| 71 | virtual int Pause(STREAM *stream);
|
---|
| 72 | virtual int Resume(STREAM *stream);
|
---|
| 73 |
|
---|
| 74 | // Services provided to the RTMIDI interface.
|
---|
| 75 | virtual USHORT RTMIDI_OpenReceive(void);
|
---|
| 76 | virtual USHORT RTMIDI_OpenSend(void);
|
---|
| 77 | virtual USHORT RTMIDI_CloseReceive(void);
|
---|
| 78 | virtual USHORT RTMIDI_CloseSend(void);
|
---|
| 79 | };
|
---|
| 80 |
|
---|
| 81 | #endif
|
---|