Changeset 526 for OCO/trunk/drv16/maudio.cpp
- Timestamp:
- Jul 22, 2010, 9:33:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OCO/trunk/drv16/maudio.cpp
r468 r526 3 3 /* SCCSID = %W% %E% */ 4 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 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 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 * 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 13 ****************************************************************************/ 14 14 /**@internal %W% 15 * 15 * MIDI audio hardware object implementation. 16 16 * @version %I% 17 17 * @context 18 * 18 * Unless otherwise noted, all interfaces are Ring-0, 16-bit, kernel stack. 19 19 * @notes 20 20 * @history … … 25 25 #include <os2medef.h> 26 26 #include <audio.h> 27 #include "midi_idc.h" 27 #include "midi_idc.h" // RTMIDI interfaces 28 28 #include "maudio.hpp" 29 29 #include <dbgos2.h> … … 37 37 { 38 38 39 pCaps->ulSupport 39 pCaps->ulSupport = SUPPORT_SUCCESS; 40 40 pCaps->ulDataSubType = SUBTYPE_NONE; 41 41 pCaps->ulResourceUnits = 1; 42 42 pCaps->ulResourceClass = 1; 43 pCaps->fCanRecord 44 pCaps->ulFlags = INPUT |// Input select is supported45 OUTPUT |// Output select is supported46 MONITOR |// Monitor is supported47 VOLUME;// Volume control is supported43 pCaps->fCanRecord = FALSE; 44 pCaps->ulFlags = INPUT | // Input select is supported 45 OUTPUT | // Output select is supported 46 MONITOR | // Monitor is supported 47 VOLUME; // Volume control is supported 48 48 } 49 49 //****************************************************************************** … … 59 59 { 60 60 for (int iChannel=0; iChannel<16; iChannel++) { 61 writeByte(StreamId, (BYTE) (0xB0 + iChannel));// channel mode62 writeByte(StreamId, 123);// all notes off63 61 writeByte(StreamId, (BYTE) (0xB0 + iChannel)); // channel mode 62 writeByte(StreamId, 123); // all notes off 63 writeByte(StreamId, 0); 64 64 } 65 65 … … 72 72 int MIDIAUDIO::writeByte(OSSSTREAMID StreamId, BYTE b) 73 73 { 74 return 0; 74 return 0; // Failure. 75 75 } 76 76 //****************************************************************************** … … 78 78 int MIDIAUDIO::readByte(OSSSTREAMID StreamId) 79 79 { 80 return -1; 80 return -1; // Failure. 81 81 } 82 82 //****************************************************************************** … … 108 108 BOOL MIDIAUDIO::SetVolume(OSSSTREAMID StreamId, OSSSTREAMID mixerStreamId, ULONG ulVolume) 109 109 { 110 110 return FALSE; 111 111 } 112 112 //****************************************************************************** 113 113 //****************************************************************************** 114 int MIDIAUDIO::Pause(OSSSTREAMID StreamId) 114 int MIDIAUDIO::Pause(OSSSTREAMID StreamId) // Pause the operation 115 115 { 116 //dprintf(("DUMMY MIDIAUDIO::Pause"));117 118 116 //dprintf(("DUMMY MIDIAUDIO::Pause")); 117 DebugInt3(); 118 return 0; 119 119 } 120 120 //****************************************************************************** 121 121 //****************************************************************************** 122 int MIDIAUDIO::Resume(OSSSTREAMID StreamId) 122 int MIDIAUDIO::Resume(OSSSTREAMID StreamId) // Resume the operation 123 123 { 124 //dprintf(("DUMMY MIDIAUDIO::Resume"));125 126 124 //dprintf(("DUMMY MIDIAUDIO::Resume")); 125 DebugInt3(); 126 return 0; 127 127 } 128 128 //****************************************************************************** … … 130 130 void MIDIAUDIO::noteOff(OSSSTREAMID StreamId, BYTE mchan, BYTE note, BYTE velocity ) 131 131 { 132 //dprintf2(("MIDIAUDIO::noteOff %d %d %d", mchan, note, velocity));133 134 135 132 //dprintf2(("MIDIAUDIO::noteOff %d %d %d", mchan, note, velocity)); 133 if(OSS16_MidiNoteOff(StreamId, mchan, note, velocity) != OSSERR_SUCCESS) { 134 DebugInt3(); 135 } 136 136 } 137 137 //****************************************************************************** … … 139 139 void MIDIAUDIO::noteOn(OSSSTREAMID StreamId, BYTE mchan, BYTE note, BYTE velocity ) 140 140 { 141 //dprintf2(("MIDIAUDIO::noteOn %d %d %d", mchan, note, velocity));142 143 144 141 //dprintf2(("MIDIAUDIO::noteOn %d %d %d", mchan, note, velocity)); 142 if(OSS16_MidiNoteOn(StreamId, mchan, note, velocity) != OSSERR_SUCCESS) { 143 DebugInt3(); 144 } 145 145 } 146 146 //****************************************************************************** … … 148 148 void MIDIAUDIO::polyphonicPressure(OSSSTREAMID StreamId, BYTE mchan, BYTE note, BYTE value ) 149 149 { 150 //dprintf2(("MIDIAUDIO::polyphonicPressure %d %d %d", mchan, note, value));151 152 153 150 //dprintf2(("MIDIAUDIO::polyphonicPressure %d %d %d", mchan, note, value)); 151 if(OSS16_MidiKeyPressure(StreamId, mchan, note, value) != OSSERR_SUCCESS) { 152 DebugInt3(); 153 } 154 154 } 155 155 //****************************************************************************** … … 157 157 void MIDIAUDIO::controlChange(OSSSTREAMID StreamId, BYTE mchan, BYTE control_number, BYTE value ) 158 158 { 159 //dprintf2(("MIDIAUDIO::controlChange %d %d %d", mchan, control_number, value));160 161 162 159 //dprintf2(("MIDIAUDIO::controlChange %d %d %d", mchan, control_number, value)); 160 if(OSS16_MidiControlChange(StreamId, mchan, control_number, value) != OSSERR_SUCCESS) { 161 DebugInt3(); 162 } 163 163 } 164 164 //****************************************************************************** … … 166 166 void MIDIAUDIO::programChange(OSSSTREAMID StreamId, BYTE mchan, BYTE program_number ) 167 167 { 168 //dprintf2(("MIDIAUDIO::programChange %d %d", mchan, program_number));169 170 171 168 //dprintf2(("MIDIAUDIO::programChange %d %d", mchan, program_number)); 169 if(OSS16_MidiProgramChange(StreamId, mchan, program_number) != OSSERR_SUCCESS) { 170 DebugInt3(); 171 } 172 172 } 173 173 //****************************************************************************** … … 175 175 void MIDIAUDIO::channelPressure(OSSSTREAMID StreamId, BYTE mchan, BYTE value ) 176 176 { 177 //dprintf2(("MIDIAUDIO::channelPressure %d %d", mchan, value));178 179 180 177 //dprintf2(("MIDIAUDIO::channelPressure %d %d", mchan, value)); 178 if(OSS16_MidiChannelPressure(StreamId, mchan, value) != OSSERR_SUCCESS) { 179 DebugInt3(); 180 } 181 181 } 182 182 //****************************************************************************** … … 184 184 void MIDIAUDIO::pitchBend(OSSSTREAMID StreamId, BYTE mchan, BYTE value_lsb, BYTE value_msb) 185 185 { 186 //dprintf2(("MIDIAUDIO::pitchBend %d %d %d", mchan, value_lsb, value_msb));187 188 189 186 //dprintf2(("MIDIAUDIO::pitchBend %d %d %d", mchan, value_lsb, value_msb)); 187 if(OSS16_MidiKeyPressure(StreamId, mchan, value_lsb, value_msb) != OSSERR_SUCCESS) { 188 DebugInt3(); 189 } 190 190 } 191 191 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.