1 /*
2  * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
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 #ifndef WIN32_EXTRA_LEAN
27 #define WIN32_EXTRA_LEAN
28 #endif
29 #ifndef WIN32_LEAN_AND_MEAN
30 #define WIN32_LEAN_AND_MEAN
31 #endif
32 
33 #include <windows.h>
34 #include <mmsystem.h>
35 
36 /* for waveformat extensible */
37 #include <mmreg.h>
38 #include <ks.h>
39 
40 #ifndef PLATFORM_API_WINOS_UTIL_INCLUDED
41 #define PLATFORM_API_WINOS_UTIL_INCLUDED
42 
43 #define WIN_MAX_ERROR_LEN 200
44 
45 #if (USE_PLATFORM_MIDI_IN == TRUE) || (USE_PLATFORM_MIDI_OUT == TRUE)
46 
47 #include "PlatformMidi.h"
48 
49 typedef struct tag_SysExQueue {
50     int count;         // number of sys ex headers
51     int size;          // data size per sys ex header
52     int ownsLinearMem; // true when linearMem is to be disposed
53     UBYTE* linearMem;  // where the actual sys ex data is, count*size bytes
54     MIDIHDR header[1]; // Windows specific structure to hold meta info
55 } SysExQueue;
56 
57 /* set the startTime field in MidiDeviceHandle */
58 void MIDI_SetStartTime(MidiDeviceHandle* handle);
59 
60 /* return time stamp in microseconds */
61 INT64 MIDI_GetTimeStamp(MidiDeviceHandle* handle);
62 
63 // the buffers do not contain memory
64 int MIDI_WinCreateEmptyLongBufferQueue(MidiDeviceHandle* handle, int count);
65 int MIDI_WinCreateLongBufferQueue(MidiDeviceHandle* handle, int count, int size, UBYTE* preAllocatedMem);
66 void MIDI_WinDestroyLongBufferQueue(MidiDeviceHandle* handle);
67 
68 #endif // USE_PLATFORM_MIDI_IN || USE_PLATFORM_MIDI_OUT
69 
70 #endif // PLATFORM_API_WINOS_UTIL_INCLUDED
71