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 name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9<title>DVDChangeDisk</title> 10</head> 11 12<body> 13 14<h1>DVDChangeDisk</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/dvd.h> 19 20typedef void (*DVDCBCallback)(s32 result, <a href="DVDCommandBlock.html">DVDCommandBlock</a>* block); 21 22s32 DVDChangeDisk(<a href="DVDCommandBlock.html">DVDCommandBlock</a>* block, DVDDiskID* id); 23 24BOOL DVDChangeDiskAsync(<a href="DVDCommandBlock.html">DVDCommandBlock</a>* block, DVDDiskID* id, 25 DVDCBCallback callback); 26</pre></dd></dl> 27 28<h2>Arguments</h2> 29<TABLE class="arguments" border="1" > 30 <tr> 31<TH>block</TH> 32<TD>Command block of this command.</TD> 33 </tr> 34 <tr> 35<TH>id</TH> 36<TD>Pointer to the disc ID.</TD> 37 </tr> 38 <tr> 39<TH>callback</TH> 40<TD>Callback function that indicates completion. (Only for <code>DVDChangeDiskAsync</code>.)</TD> 41 </tr> 42</TABLE> 43 44<h2>Return Values</h2> 45<P><code>DVDChangeDisk</code>: Returns <CODE>0</CODE> if the command completes normally; otherwise, returns a negative value.</P> 46<P><code>DVDChangeDiskAsync</code>: Returns <CODE>TRUE</CODE> if the command terminates normally; otherwise, returns <CODE>FALSE</CODE>.</P> 47 48<h2>Description</h2> 49<P><code>DVDChangeDiskAsync</code> waits for the game player to insert the game disc with a matching <SPAN class="argument">id</SPAN>.</P> 50<P>After the read finishes, the <SPAN class="argument">callback</SPAN> function is called (unless <CODE>NULL</CODE> is specified for <SPAN class="argument">callback</SPAN>). When the game disc is successfully changed, zero is returned as the first argument <SPAN class="argument">result</SPAN> of the <SPAN class="argument">callback</SPAN> function. If a fatal error occurs, <code>DVD_RESULT_FATAL_ERROR</code> is returned. If the function is canceled, <code>DVD_RESULT_CANCELED</code> is returned. <CODE>DVD_RESULT_FATAL_ERROR</CODE> and <CODE>DVD_RESULT_CANCELED</CODE> are both negative values. The second argument of <SPAN class="argument">callback</SPAN> is the same <A href="DVDCommandBlock.html"><code>DVDCommandBlock</code></A> structure as that passed when <code>DVDCheckDiskAsync</code> is called.</P> 51<P>After the <code>DVDChangeDiskAsync</code> function is called, two methods are available for determining if the game disc change is completed. One method is to check that the <SPAN class="argument">callback</SPAN> function was called. The other is to poll with the <code><a href="DVDGetDriveStatus.html">DVDGetDriveStatus</a></code> function and wait until it returns <code>DVD_STATE_END</code>.</P> 52<P>The <code>DVDChangeDisk</code> function is a synchronous version of <code>DVDChangeDiskAsync</code>.</P> 53<P><B>Note:</B>Be careful if you are considering the use of synchronous functions in a real game program; use synchronous functions if the game program is multithreaded. In single threaded games, synchronous functions can't be used because there is no method for error checking.</P> 54 55<h2>See Also</h2> 56<p class="reference"> 57<a href="DVDGenerateDiskID.html">DVDGenerateDiskID</a> 58</p> 59 60<H2>Revision History</H2> 61<P> 622006/03/01 Initial version.<BR> 63</P> 64 65<hr><p>CONFIDENTIAL</p></body> 66</html>