Ignore:
Timestamp:
Jul 22, 2010, 9:33:17 PM (15 years ago)
Author:
David Azarewicz
Message:

Reintegrate branch into trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OCO/trunk/drv16/maudio.cpp

    r468 r526  
    33/* SCCSID = %W% %E% */
    44/****************************************************************************
    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         *
    99 * 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 *                                                                                                                                                      *
    1313 ****************************************************************************/
    1414/**@internal %W%
    15  *  MIDI audio hardware object implementation.
     15 *      MIDI audio hardware object implementation.
    1616 * @version %I%
    1717 * @context
    18  *  Unless otherwise noted, all interfaces are Ring-0, 16-bit, kernel stack.
     18 *      Unless otherwise noted, all interfaces are Ring-0, 16-bit, kernel stack.
    1919 * @notes
    2020 * @history
     
    2525#include <os2medef.h>
    2626#include <audio.h>
    27 #include "midi_idc.h"                    // RTMIDI interfaces
     27#include "midi_idc.h"                                    // RTMIDI interfaces
    2828#include "maudio.hpp"
    2929#include <dbgos2.h>
     
    3737{
    3838
    39    pCaps->ulSupport       = SUPPORT_SUCCESS;
     39   pCaps->ulSupport       = SUPPORT_SUCCESS;
    4040   pCaps->ulDataSubType   = SUBTYPE_NONE;
    4141   pCaps->ulResourceUnits = 1;
    4242   pCaps->ulResourceClass = 1;
    43    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
     43   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
    4848}
    4949//******************************************************************************
     
    5959{
    6060   for (int iChannel=0; iChannel<16; iChannel++) {
    61       writeByte(StreamId, (BYTE) (0xB0 + iChannel));    // channel mode
    62       writeByte(StreamId, 123);                         // all notes off
    63       writeByte(StreamId, 0);
     61          writeByte(StreamId, (BYTE) (0xB0 + iChannel));        // channel mode
     62          writeByte(StreamId, 123);                                             // all notes off
     63          writeByte(StreamId, 0);
    6464   }
    6565
     
    7272int MIDIAUDIO::writeByte(OSSSTREAMID StreamId, BYTE b)
    7373{
    74    return 0;    // Failure.
     74   return 0;    // Failure.
    7575}
    7676//******************************************************************************
     
    7878int MIDIAUDIO::readByte(OSSSTREAMID StreamId)
    7979{
    80    return -1;   // Failure.
     80   return -1;   // Failure.
    8181}
    8282//******************************************************************************
     
    108108BOOL MIDIAUDIO::SetVolume(OSSSTREAMID StreamId, OSSSTREAMID mixerStreamId, ULONG ulVolume)
    109109{
    110     return FALSE;
     110        return FALSE;
    111111}
    112112//******************************************************************************
    113113//******************************************************************************
    114 int MIDIAUDIO::Pause(OSSSTREAMID StreamId)         // Pause the operation
     114int MIDIAUDIO::Pause(OSSSTREAMID StreamId)                 // Pause the operation
    115115{
    116 //    dprintf(("DUMMY MIDIAUDIO::Pause"));
    117     DebugInt3();
    118     return 0;
     116        //dprintf(("DUMMY MIDIAUDIO::Pause"));
     117        DebugInt3();
     118        return 0;
    119119}
    120120//******************************************************************************
    121121//******************************************************************************
    122 int MIDIAUDIO::Resume(OSSSTREAMID StreamId)        // Resume the operation
     122int MIDIAUDIO::Resume(OSSSTREAMID StreamId)        // Resume the operation
    123123{
    124 //    dprintf(("DUMMY MIDIAUDIO::Resume"));
    125     DebugInt3();
    126     return 0;
     124        //dprintf(("DUMMY MIDIAUDIO::Resume"));
     125        DebugInt3();
     126        return 0;
    127127}
    128128//******************************************************************************
     
    130130void MIDIAUDIO::noteOff(OSSSTREAMID StreamId, BYTE mchan, BYTE note, BYTE velocity )
    131131{
    132 //    dprintf2(("MIDIAUDIO::noteOff %d %d %d", mchan, note, velocity));
    133     if(OSS16_MidiNoteOff(StreamId, mchan, note, velocity) != OSSERR_SUCCESS) {
    134        DebugInt3();
    135     }
     132        //dprintf2(("MIDIAUDIO::noteOff %d %d %d", mchan, note, velocity));
     133        if(OSS16_MidiNoteOff(StreamId, mchan, note, velocity) != OSSERR_SUCCESS) {
     134           DebugInt3();
     135        }
    136136}
    137137//******************************************************************************
     
    139139void MIDIAUDIO::noteOn(OSSSTREAMID StreamId, BYTE mchan, BYTE note, BYTE velocity )
    140140{
    141 //    dprintf2(("MIDIAUDIO::noteOn %d %d %d", mchan, note, velocity));
    142     if(OSS16_MidiNoteOn(StreamId, mchan, note, velocity) != OSSERR_SUCCESS) {
    143         DebugInt3();
    144     }
     141        //dprintf2(("MIDIAUDIO::noteOn %d %d %d", mchan, note, velocity));
     142        if(OSS16_MidiNoteOn(StreamId, mchan, note, velocity) != OSSERR_SUCCESS) {
     143                DebugInt3();
     144        }
    145145}
    146146//******************************************************************************
     
    148148void MIDIAUDIO::polyphonicPressure(OSSSTREAMID StreamId, BYTE mchan, BYTE note, BYTE value )
    149149{
    150 //    dprintf2(("MIDIAUDIO::polyphonicPressure %d %d %d", mchan, note, value));
    151     if(OSS16_MidiKeyPressure(StreamId, mchan, note, value) != OSSERR_SUCCESS) {
    152         DebugInt3();
    153     }
     150        //dprintf2(("MIDIAUDIO::polyphonicPressure %d %d %d", mchan, note, value));
     151        if(OSS16_MidiKeyPressure(StreamId, mchan, note, value) != OSSERR_SUCCESS) {
     152                DebugInt3();
     153        }
    154154}
    155155//******************************************************************************
     
    157157void MIDIAUDIO::controlChange(OSSSTREAMID StreamId, BYTE mchan, BYTE control_number, BYTE value )
    158158{
    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     }
     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        }
    163163}
    164164//******************************************************************************
     
    166166void MIDIAUDIO::programChange(OSSSTREAMID StreamId, BYTE mchan, BYTE program_number )
    167167{
    168 //    dprintf2(("MIDIAUDIO::programChange %d %d", mchan, program_number));
    169     if(OSS16_MidiProgramChange(StreamId, mchan, program_number) != OSSERR_SUCCESS) {
    170         DebugInt3();
    171     }
     168        //dprintf2(("MIDIAUDIO::programChange %d %d", mchan, program_number));
     169        if(OSS16_MidiProgramChange(StreamId, mchan, program_number) != OSSERR_SUCCESS) {
     170                DebugInt3();
     171        }
    172172}
    173173//******************************************************************************
     
    175175void MIDIAUDIO::channelPressure(OSSSTREAMID StreamId, BYTE mchan, BYTE value )
    176176{
    177 //    dprintf2(("MIDIAUDIO::channelPressure %d %d", mchan, value));
    178     if(OSS16_MidiChannelPressure(StreamId, mchan, value) != OSSERR_SUCCESS) {
    179         DebugInt3();
    180     }
     177        //dprintf2(("MIDIAUDIO::channelPressure %d %d", mchan, value));
     178        if(OSS16_MidiChannelPressure(StreamId, mchan, value) != OSSERR_SUCCESS) {
     179                DebugInt3();
     180        }
    181181}
    182182//******************************************************************************
     
    184184void MIDIAUDIO::pitchBend(OSSSTREAMID StreamId, BYTE mchan, BYTE value_lsb, BYTE value_msb)
    185185{
    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     }
     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        }
    190190}
    191191//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.