Ignore:
Timestamp:
Aug 19, 1999, 8:46:54 PM (26 years ago)
Author:
phaller
Message:

Add: added ODINWRAP support for WINMM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/midi.cpp

    r95 r588  
    1 /* $Id: midi.cpp,v 1.3 1999-06-10 16:24:34 phaller Exp $ */
     1/* $Id: midi.cpp,v 1.4 1999-08-19 18:46:04 phaller Exp $ */
    22
    33/*
     
    1010 *
    1111 */
     12
     13
     14/****************************************************************************
     15 * Includes                                                                 *
     16 ****************************************************************************/
     17
    1218#include <os2win.h>
    1319#include <mmsystem.h>
     20#include <odinwrap.h>
    1421#include <process.h>
    1522#include <stdio.h>
     
    1926#include "midi.hpp"
    2027#include <winos2def.h>
     28
     29
     30ODINDEBUGCHANNEL(WINMM-MIDI)
    2131
    2232/*
     
    103113
    104114/******************************************************************************/
    105 MMRESULT WIN32API midiConnect( HMIDI hMidiIn,
    106                                HMIDIOUT hMidiOut,
    107                                LPVOID pReserved )
     115ODINFUNCTION3(MMRESULT, midiConnect,
     116              HMIDI, hMidiIn,
     117              HMIDIOUT, hMidiOut,
     118              LPVOID, pReserved)
    108119{
    109120  // TODO: Implement using instance connections
     
    125136
    126137/******************************************************************************/
    127 MMRESULT WIN32API midiDisconnect( HMIDI hMidiIn,
    128                                   HMIDIOUT hMidiOut,
    129                                   LPVOID pReserved )
     138ODINFUNCTION3(MMRESULT, midiDisconnect,
     139              HMIDI, hMidiIn,
     140              HMIDIOUT, hMidiOut,
     141              LPVOID, pReserved)
    130142{
    131143  // TODO: Implement using instance connections
     
    147159
    148160/******************************************************************************/
    149 MMRESULT WIN32API midiInAddBuffer( HMIDIIN hMidiIn,
    150                                    LPMIDIHDR lpMidiInHdr,
    151                                    UINT cbMidiInHdr )
     161ODINFUNCTION3(MMRESULT, midiInAddBuffer,
     162              HMIDIIN, hMidiIn,
     163              LPMIDIHDR, lpMidiInHdr,
     164              UINT, cbMidiInHdr)
    152165{
    153166  dprintf(("WINMM:midiInAddBuffer -- not Implemented\n" ));
     
    164177
    165178/******************************************************************************/
    166 MMRESULT WIN32API midiInClose( HMIDIIN hMidiIn )
     179ODINFUNCTION1(MMRESULT, midiInClose,
     180              HMIDIIN, hMidiIn)
    167181{
    168182  dprintf(("WINMM:midiInClose -- partially Implemented\n" ));
     
    180194
    181195/******************************************************************************/
    182 MMRESULT WIN32API midiInGetDevCapsA( UINT uDeviceId,      // Device # or handle
    183                                      LPMIDIINCAPSA midiInCaps,    // structure to fill in
    184                                      UINT  sMidiInCaps )  // Length of structure
     196ODINFUNCTION3(MMRESULT, midiInGetDevCapsA,
     197              UINT, uDeviceId,
     198              LPMIDIINCAPSA, midiInCaps,
     199              UINT,  sMidiInCaps)
    185200{
    186201  dprintf(("WINMM:midiInGetDevCapsA(%u)\n", uDeviceId ));
     
    208223
    209224/******************************************************************************/
    210 MMRESULT WIN32API midiInGetDevCapsW( UINT uDeviceId,      // Device # or handle
    211                                      LPMIDIINCAPSW midiInCaps,    // structure to fill in
    212                                      UINT  sMidiInCaps )  // Length of structure
     225ODINFUNCTION3(MMRESULT, midiInGetDevCapsW,
     226              UINT, uDeviceId,
     227              LPMIDIINCAPSW, midiInCaps,
     228              UINT,  sMidiInCaps )
    213229{
    214230  dprintf(("WINMM:midiInGetDevCapsA(%u)\n", uDeviceId ));
     
    237253
    238254/******************************************************************************/
    239 MMRESULT WIN32API midiInGetErrorTextA( MMRESULT wError, LPSTR lpText, UINT cchText )
     255ODINFUNCTION3(MMRESULT, midiInGetErrorTextA,
     256              MMRESULT, wError,
     257              LPSTR, lpText,
     258              UINT, cchText)
    240259{
    241260  dprintf(("WINMM:midiInGetErrorTextA(%d)\n", wError ));
     
    253272
    254273/******************************************************************************/
    255 MMRESULT WIN32API midiInGetErrorTextW( MMRESULT wError, LPWSTR lpText, UINT cchText )
     274ODINFUNCTION3(MMRESULT, midiInGetErrorTextW,
     275              MMRESULT, wError,
     276              LPWSTR, lpText,
     277              UINT, cchText)
    256278{
    257279  dprintf(("WINMM:midiInGetErrorTextW(%d)\n", wError ));
     
    269291
    270292/******************************************************************************/
    271 MMRESULT WIN32API midiInGetID( HMIDIIN hMidiIn, LPUINT puDeviceID )
     293ODINFUNCTION2(MMRESULT, midiInGetID,
     294              HMIDIIN, hMidiIn,
     295              LPUINT, puDeviceID)
    272296{
    273297  dprintf(("WINMM:midiInGetID\n" ));
     
    286310
    287311/******************************************************************************/
    288 UINT WIN32API midiInMessage( HMIDIIN hmi, UINT msg, DWORD dw1, DWORD dw2 )
     312ODINFUNCTION4(UINT, midiInMessage,
     313              HMIDIIN, hmi,
     314              UINT, msg,
     315              DWORD, dw1,
     316              DWORD, dw2)
    289317{
    290318  dprintf(("WINMM:midiInMessage -- not Implemented\n" ));
     
    293321
    294322/******************************************************************************/
    295 UINT WIN32API midiInGetNumDevs( void )
     323ODINFUNCTION0(UINT, midiInGetNumDevs)
    296324{
    297325  UINT i = IRTMIDI->numInInstances();
    298   dprintf(("WINMM:midiInGetNumDevs - returning %u\n", i ));
    299326  return i;
    300327}
    301328
    302329/******************************************************************************/
    303 MMRESULT WIN32API midiInOpen( LPHMIDIIN lphMidiIn,
    304                               UINT uDeviceId,
    305                               DWORD dwCallback,
    306                               DWORD dwCallbackInstance,
    307                               DWORD dwflags )
     330ODINFUNCTION5(MMRESULT, midiInOpen,
     331              LPHMIDIIN, lphMidiIn,
     332              UINT, uDeviceId,
     333              DWORD, dwCallback,
     334              DWORD, dwCallbackInstance,
     335              DWORD, dwflags)
    308336{
    309337  dprintf(("WINMM:midiInOpen(%d) --  partial Implementation\n", uDeviceId ));
     
    326354
    327355/******************************************************************************/
    328 MMRESULT WIN32API midiInPrepareHeader( HMIDIIN hMidiIn,
    329                                        LPMIDIHDR lpMidiInHdr,
    330                                        UINT cbMidiInHdr )
     356ODINFUNCTION3(MMRESULT, midiInPrepareHeader,
     357              HMIDIIN, hMidiIn,
     358              LPMIDIHDR, lpMidiInHdr,
     359              UINT, cbMidiInHdr)
    331360{
    332361  dprintf(("WINMM:midiInPrepareHeader -- not Implemented\n" ));
     
    344373
    345374/******************************************************************************/
    346 MMRESULT WIN32API midiInReset( HMIDIIN hMidiIn )
     375ODINFUNCTION1(MMRESULT, midiInReset,
     376              HMIDIIN, hMidiIn)
    347377{
    348378  dprintf(("WINMM:midiInReset -- not Implemented\n" ));
     
    359389
    360390/******************************************************************************/
    361 MMRESULT WIN32API midiInStart( HMIDIIN hMidiIn )
     391ODINFUNCTION1(MMRESULT, midiInStart,
     392              HMIDIIN, hMidiIn)
    362393{
    363394  dprintf(("WINMM:midiInStart\n" ));
     
    374405
    375406/******************************************************************************/
    376 MMRESULT WIN32API midiInStop( HMIDIIN hMidiIn )
     407ODINFUNCTION1(MMRESULT, midiInStop,
     408              HMIDIIN, hMidiIn)
    377409{
    378410  dprintf(("WINMM:midiInStop\n" ));
     
    389421
    390422/******************************************************************************/
    391 MMRESULT WIN32API midiInUnprepareHeader( HMIDIIN hMidiIn,
    392                                          LPMIDIHDR lpMidiInHdr,
    393                                          UINT cbMidiInHdr )
     423ODINFUNCTION3(MMRESULT, midiInUnprepareHeader,
     424              HMIDIIN, hMidiIn,
     425              LPMIDIHDR, lpMidiInHdr,
     426              UINT, cbMidiInHdr)
    394427{
    395428  dprintf(("WINMM:midiInUnPrepareHeader -- not Implemented\n" ));
     
    406439
    407440/******************************************************************************/
    408 MMRESULT WIN32API midiOutCacheDrumPatches( HMIDIOUT hMidiOut,
    409                                            UINT wPatch,
    410                                            WORD * lpKeyArray,
    411                                            UINT wFlags )
     441ODINFUNCTION4(MMRESULT, midiOutCacheDrumPatches,
     442              HMIDIOUT, hMidiOut,
     443              UINT, wPatch,
     444              WORD *, lpKeyArray,
     445              UINT, wFlags)
    412446{
    413447  // Valid only for an Internal synth.  So we won't do it for now.
     
    425459
    426460/******************************************************************************/
    427 MMRESULT WIN32API midiOutCachePatches( HMIDIOUT hMidiOut,
    428                                        UINT wBank,
    429                                        WORD * lpPatchArray,
    430                                        UINT wFlags )
     461ODINFUNCTION4(MMRESULT, midiOutCachePatches,
     462              HMIDIOUT, hMidiOut,
     463              UINT, wBank,
     464              WORD *, lpPatchArray,
     465              UINT, wFlags)
    431466{
    432467  // Valid only for an Internal synth.  So we won't do it for now.
     
    444479
    445480/******************************************************************************/
    446 MMRESULT WIN32API midiOutClose( HMIDIOUT hMidiOut )
     481ODINFUNCTION1(MMRESULT, midiOutClose,
     482              HMIDIOUT, hMidiOut)
    447483{
    448484  dprintf(("WINMM:midiOutClose - partially implemented\n" ));
     
    461497
    462498/******************************************************************************/
    463 MMRESULT WIN32API midiOutGetDevCapsA( UINT uDeviceId,      // Device # or handle
    464                                       LPMIDIOUTCAPSA midiOutCaps,   // structure to fill in
    465                                       UINT  sMidiOutCaps ) // Length of structure
     499ODINFUNCTION3(MMRESULT, midiOutGetDevCapsA,
     500              UINT, uDeviceId,
     501              LPMIDIOUTCAPSA, midiOutCaps,
     502              UINT,  sMidiOutCaps )
    466503{
    467504  // TODO: Actually fill in the important fields
     
    511548
    512549/******************************************************************************/
    513 MMRESULT WIN32API midiOutGetDevCapsW( UINT uDeviceId,      // Device # or handle
    514                                       LPMIDIOUTCAPSW midiOutCaps,   // structure to fill in
    515                                       UINT  sMidiOutCaps ) // Length of structure
     550ODINFUNCTION3(MMRESULT, midiOutGetDevCapsW,
     551              UINT, uDeviceId,
     552              LPMIDIOUTCAPSW, midiOutCaps,
     553              UINT,  sMidiOutCaps )
    516554{
    517555  // TODO: Actually fill in the important fields
     
    563601
    564602/******************************************************************************/
    565 MMRESULT WIN32API midiOutGetErrorTextA( MMRESULT wError, LPSTR lpText, UINT cchText )
     603ODINFUNCTION3(MMRESULT, midiOutGetErrorTextA,
     604              MMRESULT, wError,
     605              LPSTR, lpText,
     606              UINT, cchText)
    566607{
    567608  dprintf(("WINMM:midiOutGetErrorTextA(%d)\n", wError ));
     
    579620
    580621/******************************************************************************/
    581 MMRESULT WIN32API midiOutGetErrorTextW( MMRESULT wError, LPWSTR lpText, UINT cchText )
     622ODINFUNCTION3(MMRESULT, midiOutGetErrorTextW,
     623              MMRESULT, wError,
     624              LPWSTR, lpText,
     625              UINT, cchText)
    582626{
    583627  dprintf(("WINMM:midiOutGetErrorTextW(%d) - need to translate\n", wError ));
     
    595639
    596640/******************************************************************************/
    597 MMRESULT WIN32API midiOutGetID( HMIDIOUT hMidiOut,
    598                                 LPUINT puDeviceID )
     641ODINFUNCTION2(MMRESULT, midiOutGetID,
     642              HMIDIOUT, hMidiOut,
     643              LPUINT, puDeviceID)
    599644{
    600645  dprintf(("WINMM:midiOutGetID\n" ));
     
    612657
    613658/******************************************************************************/
    614 UINT WIN32API midiOutGetNumDevs( void )
     659ODINFUNCTION0(UINT, midiOutGetNumDevs)
    615660{
    616661  UINT i = IRTMIDI->numOutInstances();
    617   dprintf(("WINMM:midiOutGetNumDevs - returning %u\n", i ));
    618662  return i;
    619663}
    620664
    621665/******************************************************************************/
    622 MMRESULT WIN32API midiOutGetVolume( HMIDIOUT hMidiOut,
    623                                     LPDWORD lpdwVolume )
    624 {
    625   dprintf(("WINMM:midiOutGetVolume\n" ));
     666ODINFUNCTION2(MMRESULT, midiOutGetVolume,
     667              HMIDIOUT, hMidiOut,
     668              LPDWORD, lpdwVolume)
     669{
    626670  MMRESULT rc;
    627671  MidiOut * midiOut = MidiOut::find( hMidiOut );
     
    637681
    638682/******************************************************************************/
    639 MMRESULT WIN32API midiOutLongMsg( HMIDIOUT hMidiOut,
    640                                   LPMIDIHDR lpMidiOutHdr,
    641                                   UINT cbMidiOutHdr )
     683ODINFUNCTION3(MMRESULT, midiOutLongMsg,
     684              HMIDIOUT, hMidiOut,
     685              LPMIDIHDR, lpMidiOutHdr,
     686              UINT, cbMidiOutHdr)
    642687{
    643688  // TODO: Implement this
     
    657702
    658703/******************************************************************************/
    659 UINT WIN32API midiOutMessage( HMIDIOUT hMidiOut,
    660                               UINT msg, DWORD dw1, DWORD dw2 )
     704ODINFUNCTION4(UINT, midiOutMessage,
     705              HMIDIOUT, hMidiOut,
     706              UINT, msg,
     707              DWORD, dw1,
     708              DWORD, dw2)
    661709{
    662710  // TODO: Need to find out wha drivers actually return.
     
    666714
    667715/******************************************************************************/
    668 MMRESULT WIN32API midiOutOpen( LPHMIDIOUT lphMidiOut,
    669                                UINT uDeviceId,
    670                                DWORD dwCallback,
    671                                DWORD dwCallbackInstance,
    672                                DWORD dwflags )
     716ODINFUNCTION5(MMRESULT, midiOutOpen,
     717              LPHMIDIOUT, lphMidiOut,
     718              UINT, uDeviceId,
     719              DWORD, dwCallback,
     720              DWORD, dwCallbackInstance,
     721              DWORD, dwflags)
    673722{
    674723  // TODO: - Handle thread callback, if any program really needs it
     
    706755
    707756/******************************************************************************/
    708 MMRESULT WIN32API midiOutPrepareHeader( HMIDIOUT hMidiOut,
    709                                         LPMIDIHDR lpMidiOutHdr,
    710                                         UINT cbMidiOutHdr )
     757ODINFUNCTION3(MMRESULT, midiOutPrepareHeader,
     758              HMIDIOUT, hMidiOut,
     759              LPMIDIHDR, lpMidiOutHdr,
     760              UINT, cbMidiOutHdr)
    711761{
    712762  // TODO: Either implement or treat as a NOOP as we may not need to "prepare"
     
    725775
    726776/******************************************************************************/
    727 MMRESULT WIN32API midiOutReset( HMIDIOUT hMidiOut )
     777ODINFUNCTION1(MMRESULT, midiOutReset,
     778              HMIDIOUT, hMidiOut)
    728779{
    729780  // TODO: - return pending output buffers to callback
     
    743794
    744795/******************************************************************************/
    745 MMRESULT WIN32API midiOutSetVolume( HMIDIOUT hMidiOut,
    746                                     DWORD dwVolume )
     796ODINFUNCTION2(MMRESULT, midiOutSetVolume,
     797              HMIDIOUT, hMidiOut,
     798              DWORD, dwVolume)
    747799{
    748800  dprintf(("WINMM:midiOutSetVolume\n" ));
     
    760812
    761813/******************************************************************************/
    762 MMRESULT WIN32API midiOutShortMsg( HMIDIOUT hMidiOut,
    763                                    DWORD dwMsg )
     814ODINFUNCTION2(MMRESULT, midiOutShortMsg,
     815              HMIDIOUT, hMidiOut,
     816              DWORD, dwMsg)
    764817{
    765818  dprintf(("WINMM:midiOutShortMsg(%X)\n", dwMsg ));
     
    777830
    778831/******************************************************************************/
    779 MMRESULT WIN32API midiOutUnprepareHeader( HMIDIOUT hMidiOut,
    780                                           LPMIDIHDR lpMidiOutHdr,
    781                                           UINT cbMidiOutHdr )
     832ODINFUNCTION3(MMRESULT, midiOutUnprepareHeader,
     833              HMIDIOUT, hMidiOut,
     834              LPMIDIHDR, lpMidiOutHdr,
     835              UINT, cbMidiOutHdr)
    782836{
    783837  // TODO: - return MIDIERR_STILLPLAYING if buffer is playing
     
    11471201}
    11481202
     1203
Note: See TracChangeset for help on using the changeset viewer.