1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 8<title>MIDIRead</title> 9</head> 10 11<body> 12 13<h1>MIDIRead</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction"> 17#include <revolution/midi.h> 18 19#define MIDI_CHAN0 0 20#define MIDI_CHAN1 1 21#define MIDI_CHAN2 2 22#define MIDI_CHAN3 3 23#define MIDI_MAX_CHAN 4 24 25#define MIDI_JSTAT_MASK 0x3a 26#define MIDI_JSTAT_FLAGS_SHIFT 4 27#define MIDI_JSTAT_FLAGS_MASK 0x30 28#define MIDI_JSTAT_SEND 0x08 29#define MIDI_JSTAT_RECV 0x02 30 31s32 MIDIRead(s32 chan, u8* dst, u8* status); 32</pre></dd></dl> 33 34<h2>Arguments</h2> 35<p> 36<TABLE class="arguments" border="1" > 37 <tr> 38<TH>chan</TH> 39<TD>One of the <code>MIDI_CHAN<em>n</em></code> GameCube controller ports.</TD> 40 </tr> 41 <tr> 42<TH>dst</TH> 43<TD>u8 type of pointer to the buffer storing read data.</TD> 44 </tr> 45 <tr> 46<TH>status</TH> 47<TD>Pointer to the u8 type of variable, which stores the status value returned by the MIDI adapter. The value is masked using <CODE>MIDI_JSTAT_MASK</CODE> and is valid only when execution terminates normally.</TD> 48 </tr> 49</TABLE> 50</p> 51 52<h2>Return Values</h2> 53<p> 54Returns one of the following codes. If <CODE>MIDI_READY</CODE> is returned, execution terminated normally. 55<p> 56<code>MIDI_READY<br> MIDI_NOT_READY<br></code> 57</p> 58</p> 59 60<h2>Description</h2> 61<p> 62Gets four bytes of data from the MIDI adapter.<br>Function call will fail if a MIDI adapter is not connected. 63</p> 64 65<h2>See Also</h2> 66<p class="reference"> 67<a href="./MIDIReadAsync.html">MIDIReadAsync</a> 68</p> 69 70<h2>Revision History</h2> 71<p> 722007/05/09 Initial version.<br> 73</p> 74 75<hr><p>CONFIDENTIAL</p></body> 76</html> 77