source: cmedia/trunk/Drv16/mpu401.hpp

Last change on this file was 354, checked in by stevenhl, 18 years ago

Import untested baseline cmedia sources, work products and binaries
Binaries and work products should be deleted from repository.
once new builds are verified to work.

File size: 3.0 KB
Line 
1/* $Id: mpu401.hpp,v 1.3 2000/05/28 16:50:40 sandervl Exp $ */
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
37unsigned MPUcommand(USHORT, BYTE);
38// sends byte to an I/O address. Returns non-zero if error
39
40class 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
45 ULONG midiInStreamId;
46 ULONG midiOutStreamId;
47public:
48 // Constructor.
49 MPU_401( TIMER* pTimer );
50
51 static void processIrq(unsigned long streamid);
52
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
Note: See TracBrowser for help on using the repository browser.