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>MIDIGetStatus</title> 9</head> 10 11<body> 12 13<h1>MIDIGetStatus</h1> 14 15<h2>C Specification</h2> 16<dl><dd><pre><code> 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 MIDIGetStatus(s32 chan, u8* status); 32</code></pre></dd></dl> 33 34<h2>Arguments</h2> 35<p> 36<TABLE border="1" > 37 <tr> 38<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>chan</EM></STRONG></CODE></TD> 39<TD width="520">This is one of the <code>MIDI_CHAN<em>n</em></code> Nintendo GameCube Controller Sockets to which the MIDI adapter is connected.</TD> 40 </tr> 41 <tr> 42<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>status</EM></STRONG></CODE></TD> 43<TD width="520">Pointer to the u8 type of variable that stores the status returned by the MIDI adapter. The value is masked using <CODE>MIDI_JSTAT_MASK</CODE> and is valid only when execution terminates normally.</TD> 44 </tr> 45</TABLE> 46</p> 47 48 49<h2>Return Values</h2> 50<p> 51Returns one of the following codes. As long as <CODE>MIDI_READY</CODE> is returned, execution terminates normally. 52<p> 53<code>MIDI_READY<br> MIDI_NOT_READY<br></code> 54</p> 55</p> 56 57<h2>Description</h2> 58<p> 59Issues a command for getting the status of the MIDI adapter and waiting for a response.<BR>The function call will fail if a MIDI adapter is not connected. 60</p> 61 62<p> 63This function may put the current thread to sleep. For precautions when calling similar functions, refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 64</p> 65 66<h2>See Also</h2> 67<p> 68<code><a href="./MIDIGetStatusAsync.html">MIDIGetStatusAsync</a></code><br><a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 69</p> 70 71<h2>Revision History</h2> 72<p> 732007/09/25 Added information on the sleep status of threads.<br>2007/05/09 Initial version. <BR> 74</p> 75 76<hr><p>CONFIDENTIAL</p></body> 77</html> 78