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="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9<title>DVDCancelAll</title> 10</head> 11 12<body> 13 14<h1>DVDCancelAll<br> DVDCancelAllAsync</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction">#include <revolution/dvd.h> 18 19typedef void (*DVDCBCallback)(s32 result, <a href="DVDCommandBlock.html">DVDCommandBlock</a>* block); 20 21s32 DVDCancelAll(void); 22 23BOOL DVDCancelAllAsync(DVDCBCallback callback); 24</pre></dd></dl> 25 26<H2>Arguments</H2> 27<TABLE class="arguments" border="1" > 28 <TBODY> 29 <TR> 30<TH>callback</TH> 31<TD>Callback function that indicates completion. If a callback is unnecessary, specify <CODE>NULL</CODE>. </TD> 32 </TR> 33 </TBODY> 34</TABLE> 35 36<H2>Return Values</H2> 37<P><CODE>DVDCancelAll</CODE>: <CODE>0</CODE> if cancel succeeds; <CODE>-1</CODE> if cancel fails.</P> 38<P><CODE>DVDCancelAllAsync</CODE>: <CODE>TRUE</CODE> if cancel succeeds; <CODE>FALSE</CODE> if cancel fails.</P> 39 40<h2>Description</h2> 41<P>The <code>DVDCancelAllAsync</code> function cancels all DVD commands in the DVD queue and executing command. When the command has completed, the callback function is called unless <SPAN class="argument">callback</SPAN> is specified as <CODE>NULL</CODE>. In the callback function, 0 is passed as <SPAN class="argument">result</SPAN> and the command block of the command that executes when <code>DVDCancelAllAsync</code> is called is passed as <SPAN class="argument">block</SPAN>. (If no DVD command is being processed when the function is called, <CODE>NULL</CODE> is passed as <SPAN class="argument">block</SPAN>.))</P> 42<P><CODE>DVD_RESULT_CANCELED</CODE> will be passed to all canceled functions. In other words, canceled synchronous functions return <code>DVD_RESULT_CANCELED</code>. If a callback is specified for canceled asynchronous functions, <code>DVD_RESULT_CANCELED</code> will be passed as <SPAN class="argument">result</SPAN> to the callback function. The order callback functions are called in doesn’t match the order that requests are processed in. Because the executing request can take time, its callback could be called last.</P> 43<P>If the issued cancel succeeds, <CODE>DVDCancelAllAsync</CODE> returns <CODE>TRUE</CODE>. Otherwise, <CODE>FALSE</CODE> is returned. <CODE>FALSE</CODE> can be returned if the DVD library is currently processing a cancel. In this case, a cancel is not performed.</P> 44<P>The <code>DVDCancelAll</code> function is the synchronous version of the <code>DVDCancelAllAsync</code> function. This function doesn't return until cancel completes. This function returns 0 if cancel succeeds and -1 if cancel fails. The conditions for a cancel to fail are the same as for the <code>DVDCancelAllAsync</code> function.</P> 45<P>You can issue the <code>DVDCancelAll(Async)</code> function if no DVD commands are processing.</P> 46 47<p>This function may put the current thread to sleep. Refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.</p> 48 49<h2>See Also</h2> 50<p class="reference"> 51<a href="DVDCancel.html"><CODE>DVDCancel(Async)</CODE></a><BR><a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 52</p> 53 54<H2>Revision History</H2> 55<P> 562007/09/25 Added an explanation of thread behavior. <BR>2006/03/01 Initial version.<BR> 57</P> 58 59<hr><p>CONFIDENTIAL</p></body> 60</html>