< prev index next >

src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_MidiOut.c

Print this page
rev 52923 : 8226346: Build better binary builders
Reviewed-by: andrew


  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #define USE_ERROR
  27 #define USE_TRACE
  28 
  29 #include "PLATFORM_API_WinOS_Util.h"
  30 
  31 /* include to prevent charset problem */
  32 #include "PLATFORM_API_WinOS_Charset_Util.h"
  33 
  34 #if USE_PLATFORM_MIDI_OUT == TRUE
  35 
  36 
  37 #ifdef USE_ERROR
  38 #include <stdio.h>
  39 
  40 /* Use THIS_FILE when it is available. */
  41 #ifndef THIS_FILE
  42     #define THIS_FILE __FILE__
  43 #endif
  44 
  45 #define MIDIOUT_CHECK_ERROR  { \
  46         if (err != MMSYSERR_NOERROR) \
  47             ERROR3("MIDI OUT Error in %s:%d : %s\n", THIS_FILE, __LINE__, MIDI_OUT_GetErrorStr((INT32) err)); \
  48         }
  49 #else
  50 #define MIDIOUT_CHECK_ERROR
  51 #endif
  52 
  53 /* *************************** MidiOutDeviceProvider implementation *********************************** */
  54 
  55 /* not thread safe */
  56 static char winMidiOutErrMsg[WIN_MAX_ERROR_LEN];
  57 
  58 char* MIDI_OUT_GetErrorStr(INT32 err) {
  59     winMidiOutErrMsg[0] = 0;
  60     midiOutGetErrorText((MMRESULT) err, winMidiOutErrMsg, WIN_MAX_ERROR_LEN);
  61     return winMidiOutErrMsg;
  62 }
  63 
  64 INT32 MIDI_OUT_GetNumDevices() {
  65     // add one for the MIDI_MAPPER
  66     // we want to return it first so it'll be the default, so we
  67     // decrement each deviceID for these methods....




  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #define USE_ERROR
  27 #define USE_TRACE
  28 
  29 #include "PLATFORM_API_WinOS_Util.h"
  30 
  31 /* include to prevent charset problem */
  32 #include "PLATFORM_API_WinOS_Charset_Util.h"
  33 
  34 #if USE_PLATFORM_MIDI_OUT == TRUE
  35 
  36 
  37 #ifdef USE_ERROR
  38 #include <stdio.h>
  39 





  40 #define MIDIOUT_CHECK_ERROR  { \
  41         if (err != MMSYSERR_NOERROR) \
  42             ERROR3("MIDI OUT Error in %s:%d : %s\n", __FILE__, __LINE__, MIDI_OUT_GetErrorStr((INT32) err)); \
  43         }
  44 #else
  45 #define MIDIOUT_CHECK_ERROR
  46 #endif
  47 
  48 /* *************************** MidiOutDeviceProvider implementation *********************************** */
  49 
  50 /* not thread safe */
  51 static char winMidiOutErrMsg[WIN_MAX_ERROR_LEN];
  52 
  53 char* MIDI_OUT_GetErrorStr(INT32 err) {
  54     winMidiOutErrMsg[0] = 0;
  55     midiOutGetErrorText((MMRESULT) err, winMidiOutErrMsg, WIN_MAX_ERROR_LEN);
  56     return winMidiOutErrMsg;
  57 }
  58 
  59 INT32 MIDI_OUT_GetNumDevices() {
  60     // add one for the MIDI_MAPPER
  61     // we want to return it first so it'll be the default, so we
  62     // decrement each deviceID for these methods....


< prev index next >