163 lines
39 KiB
HTML
163 lines
39 KiB
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - Classes And Methods - The Media Kit</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
|
||
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
|
||
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheMediaKit.html" title="The Media Kit" /><link rel="prev" href="BTimeCode.html" title="BTimeCode" /><link rel="next" href="BTimeSource.html" title="BTimeSource" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BTimeCode.html" title="BTimeCode"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheMediaKit.html" title="The Media Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BTimeSource.html" title="BTimeSource"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - Classes And Methods - The Media Kit</div></div><div id="headerB">Prev: <a href="BTimeCode.html">BTimeCode</a> Up: <a href="TheMediaKit.html">The Media Kit</a> Next: <a href="BTimeSource.html">BTimeSource</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue"></a>BTimedEventQueue</h2></div></div></div><a id="id1173936" class="indexterm"></a><div class="classheader"><table border="0"><colgroup><col /><col /></colgroup><tbody><tr><td><table width="100%" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td>Derived From:</td><td>–</td></tr><tr><td>Mix-in Classes:</td><td>–</td></tr><tr><td>Declared In:</td><td><code class="filename">media/TimedEventQueue.h</code></td></tr><tr><td>Library:</td><td><code class="filename">libmedia.so</code></td></tr><tr><td>Allocation:</td><td>Constructor only</td></tr></tbody></table></td><td>
|
||
<a class="link overview" href="BTimedEventQueue_Overview.html" title="BTimedEventQueue">Class Overview</a>
|
||
<div class="toc"><ul><li><span class="section"><a href="BTimedEventQueue.html#BTimedEventQueue_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BTimedEventQueue.html#BTimedEventQueue_MemberFunctions">Member Functions</a></span></li><li><span class="section"><a href="BTimedEventQueue.html#BTimedEventQueue_Constants">Constants</a></span></li><li><span class="section"><a href="BTimedEventQueue.html#BTimedEventQueue_DefinedTypes">Defined Types</a></span></li></ul></div>
|
||
</td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_ConstructorDestructor"></a>Constructor and Destructor</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_Constructor"></a>BTimedEventQueue()</h4></div><div xmlns:d="http://docbook.org/ns/docbook"><h5 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">protected</h5></div></div></div><code class="constructorsynopsis cpp"><span class="methodname">BTimedEventQueue</span>();</code><p>Initializes a new, empty, timed event queue.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_Destructor"></a>~BTimedEventQueue</h4></div></div></div><code class="destructorsynopsis cpp"><span class="modifier">virtual </span><span class="methodname">~BTimedEventQueue</span>();</code><p>Flushes the queue and deallocates memory allocated by the object.</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_MemberFunctions"></a>Member Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_AddEvent"></a>AddEvent()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">AddEvent</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">media_timed_event& </span><span class="parameter">event</span></span>);</code><p>Adds the specified event to the queue.</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code></span></p></td><td><p>The event was added.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_VALUE</code></span></p></td><td><p> Unknown or invalid event type (you can't use
|
||
<code class="constant">B_NO_EVENT</code>
|
||
or <code class="constant">B_ANY_EVENT</code>).</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NO_INIT</code></span></p></td><td><p>The queue hasn't been initialized.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_DoForEach"></a>DoForEach()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">DoForEach</span>(<span class="methodparam"><span class="type">for_each_hook </span><span class="parameter">hook</span></span>,<br /> <span class="methodparam"><span class="type">void* </span><span class="parameter">context</span></span>,<br /> <span class="methodparam"><span class="type">bigtime_t </span><span class="parameter">time</span></span>,<br /> <span class="methodparam"><span class="type">time_direction </span><span class="parameter">direction</span></span>,<br /> <span class="methodparam"><span class="type">bool </span><span class="parameter">inclusive</span><span class="initializer"> = <span class="constant">true</span></span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">event</span><span class="initializer"> = <span class="constant">B_ANY_EVENT</span></span></span>);</code><p>For each event in the queue matching the specified parameters, the hook
|
||
function is called. The <code class="parameter">context</code> pointer is passed through to the hook
|
||
function, and may point to anything your hook function requires.</p><ul class="itemizedlist"><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_ALWAYS</code> indicates that all events of the type
|
||
indicated by <code class="parameter">event</code> should be processed. The
|
||
<code class="parameter">time</code> and <code class="parameter">inclusive</code>
|
||
arguments are ignored.</p></li><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_BEFORE_TIME</code> indicates that all matching events
|
||
occurring before the specified <code class="parameter">time</code> should be
|
||
processed. If <code class="parameter">inclusive</code> is
|
||
<code class="constant">true</code>, events occurring at
|
||
<code class="parameter">time</code> are also processed.</p></li><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_AT_TIME</code> processes all matching events scheduled
|
||
at the specified <code class="parameter">time</code>. The
|
||
<code class="parameter">inclusive</code> argument is ignored.</p></li><li><p>If <code class="parameter">direction</code> is
|
||
<code class="constant">B_AFTER_TIME</code>, all matching events scheduled to
|
||
occur after the specified <code class="parameter">time</code> are processed. If
|
||
<code class="parameter">inclusive</code> is <code class="constant">true</code>,
|
||
events scheduled to occur at <code class="parameter">time</code> are also
|
||
processed.</p></li></ul><p>This provides a means for you to scan through the queue and perform
|
||
a particular act on every node (or all nodes of a certain type, or that
|
||
occur at certain times). If you want to process all events, you can specify
|
||
a <code class="parameter">time</code> of
|
||
<code class="constant">B_INFINITE_TIMEOUT</code> and a
|
||
<code class="parameter">direction</code> of
|
||
<code class="constant">B_BEFORE_TIME</code>.</p><p>The hook function should return a
|
||
<a class="link" href="BTimedEventQueue.html#Enums_queue_action" title="queue_action"><span class="type">queue_action</span></a>
|
||
value.</p><pre class="programlisting example cpp"><span class="type">queue_action</span> <code class="function">MyHook</code>(<span class="type">media_timed_event*</span> <code class="parameter">event</code>, <span class="type">void*</span> <code class="parameter">context</code>) {
|
||
if (<code class="parameter">event</code>-><code class="varname">data</code> == 0) {
|
||
<span class="comment">/* countdown finished, do something */</span>
|
||
return <code class="classname">BTimedEventQueue</code>::<code class="constant">B_REMOVE_EVENT</code>;
|
||
}
|
||
<code class="parameter">event</code>-><code class="varname">data</code>--;
|
||
return <code class="classname">BTimedEventQueue</code>::<code class="constant">B_NO_ACTION</code>;
|
||
}</pre><p>In this example, the hook function processes the event (and indicates on
|
||
return that it should be removed from the queue) if the <code class="varname">data</code> field of the
|
||
event structure is zero; otherwise <code class="varname">data</code> is decremented and the event is
|
||
left alone.</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code></span></p></td><td><p>The events were processed.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_ERROR</code></span></p></td><td><p>An undefined error occurred.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_EventCount"></a>EventCount()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">EventCount</span>() <span class="modifier">const</span>;</code><p>Returns the number of events in the queue.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_FindFirstMatch"></a>FindFirstMatch()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">const </span><span class="type">media_timed_event* </span><span class="methodname">FindFirstMatch</span>(<span class="methodparam"><span class="type">bigtime_t </span><span class="parameter">eventTime</span></span>,<br /> <span class="methodparam"><span class="type">time_direction </span><span class="parameter">direction</span></span>,<br /> <span class="methodparam"><span class="type">bool </span><span class="parameter">inclusive</span><span class="initializer"> = <span class="constant">true</span></span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">event</span><span class="initializer"> = <span class="constant">B_ANY_EVENT</span></span></span>);</code><p>Searches the event queue for the first event matching the given
|
||
specifications. The search begins at the time specified by
|
||
<code class="parameter">eventTime</code>, and progresses in the specified
|
||
<code class="parameter">direction</code>.</p><ul class="itemizedlist"><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_ALWAYS</code> indicates that all events of the type
|
||
indicated by <code class="parameter">event</code> should be scanned. The
|
||
<code class="parameter">eventTime</code> and
|
||
<code class="parameter">inclusive</code> arguments are ignored.</p></li><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_BEFORE_TIME</code> indicates that all matching events
|
||
occurring before the specified <code class="parameter">eventTime</code> should
|
||
be scanned. If <code class="parameter">inclusive</code> is
|
||
<code class="constant">true</code>, events occurring at
|
||
<code class="parameter">eventTime</code> are also scanned.</p></li><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_AT_TIME</code> scans all matching events scheduled at
|
||
the specified <code class="parameter">eventTime</code>. The
|
||
<code class="parameter">inclusive</code> argument is ignored.</p></li><li><p>If <code class="parameter">direction</code> is
|
||
<code class="constant">B_AFTER_TIME</code>, all matching events scheduled to
|
||
occur after the specified <code class="parameter">eventTime</code> are scanned.
|
||
If <code class="parameter">inclusive</code> is <code class="constant">true</code>,
|
||
events scheduled to occur at <code class="parameter">eventTime</code> are also
|
||
scanned.</p></li></ul><p>If you want to scan all events, you can specify a time of
|
||
<code class="constant">B_INFINITE_TIMEOUT</code> and a direction of
|
||
<code class="constant">B_BEFORE_TIME</code>.</p><p>If no matching event is found, <code class="constant">NULL</code> is
|
||
returned.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_FirstEvent"></a><a id="BTimedEventQueue_FirstEventTime"></a>
|
||
FirstEvent(), FirstEventTime()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">const </span><span class="type">media_timed_event* </span><span class="methodname">FirstEvent</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">bigtime_t </span><span class="methodname">FirstEventTime</span>() <span class="modifier">const</span>;</code><p><code class="methodname">FirstEvent()</code> returns the first event
|
||
in the queue, without removing it from the queue.</p><p><code class="methodname">FirstEventTime()</code> returns the first
|
||
event's time, in microseconds.</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code></span></p></td><td><p>No error occurred.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NO_INIT</code></span></p></td><td><p>The queue hasn't been initialized.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_INFINITE_TIMEOUT</code></span></p></td><td><p>The queue is empty (<code class="methodname">FirstEventTime()</code> only).</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_FlushEvents"></a>FlushEvents()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">FlushEvents</span>(<span class="methodparam"><span class="type">bigtime_t </span><span class="parameter">time</span></span>,<br /> <span class="methodparam"><span class="type">time_direction </span><span class="parameter">direction</span></span>,<br /> <span class="methodparam"><span class="type">bool </span><span class="parameter">inclusive</span><span class="initializer"> = <span class="constant">true</span></span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">event</span><span class="initializer"> = <span class="constant">B_ANY_EVENT</span></span></span>) <span class="modifier">const</span>;</code><p>Flushes the specified events from the queue. You specify which events to
|
||
flush by indicating a <code class="parameter">time</code> from which events should be flushed, a
|
||
<code class="parameter">direction</code> in which to search for events to flush, and the type of events
|
||
to flush:</p><ul class="itemizedlist"><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_ALWAYS</code> indicates that all events of the type
|
||
indicated by <code class="parameter">event</code> should be flushed. The
|
||
<code class="parameter">eventTime</code> and
|
||
<code class="parameter">inclusive</code> arguments are ignored.</p></li><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_BEFORE_TIME</code> indicates that all matching events
|
||
occurring before the specified <code class="parameter">eventTime</code> should
|
||
be flushed. If <code class="parameter">inclusive</code> is
|
||
<code class="constant">true</code>, events occurring at
|
||
<code class="parameter">eventTime</code> are also flushed.</p></li><li><p>Setting <code class="parameter">direction</code> to
|
||
<code class="constant">B_AT_TIME</code> flushes all matching events scheduled at
|
||
the specified <code class="parameter">eventTime</code>. The
|
||
<code class="parameter">inclusive</code> argument is ignored.</p></li><li><p>If <code class="parameter">direction</code> is
|
||
<code class="constant">B_AFTER_TIME</code>, all matching events scheduled to
|
||
occur after the specified <code class="parameter">eventTime</code> are flushed.
|
||
If <code class="parameter">inclusive</code> is <code class="constant">true</code>,
|
||
events scheduled to occur at <code class="parameter">eventTime</code> are also
|
||
flushed.</p></li></ul><p>If you want to flush all events, you can specify a time of
|
||
<code class="constant">B_INFINITE_TIMEOUT</code> and a direction of
|
||
<code class="constant">B_BEFORE_TIME</code>.</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code></span></p></td><td><p>The events were flushed.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_ERROR</code></span></p></td><td><p>An undefined error occurred.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_HasEvents"></a>HasEvents()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">HasEvents</span>();</code><p>Returns <code class="constant">true</code> if there are events in the
|
||
queue, otherwise returns <code class="constant">false</code>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_LastEvent"></a><a id="BTimedEventQueue_LastEventTime"></a>
|
||
LastEvent(), LastEventTime()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">const </span><span class="type">media_timed_event* </span><span class="methodname">LastEvent</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">bigtime_t </span><span class="methodname">LastEventTime</span>() <span class="modifier">const</span>;</code><p><code class="methodname">LastEvent()</code> returns the last event
|
||
in the queue, without removing it from the queue.</p><p><code class="methodname">LastEventTime()</code> returns the last event's
|
||
time, in microseconds.</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code></span></p></td><td><p>No error occurred.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NO_INIT</code></span></p></td><td><p>The queue hasn't been initialized.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_INFINITE_TIMEOUT</code></span></p></td><td><p>The queue is empty (<code class="methodname">LastEventTime()</code> only).</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_RemoveEvent"></a><a id="BTimedEventQueue_RemoveFirstEvent"></a>
|
||
RemoveEvent(), RemoveFirstEvent()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">RemoveEvent</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">media_timed_event* </span><span class="parameter">event</span></span>);</code><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">RemoveFirstEvent</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">media_timed_event* </span><span class="parameter">event</span><span class="initializer"> = <span class="constant">NULL</span></span></span>);</code><p><code class="methodname">RemoveEvent()</code> removes the specified
|
||
event from the queue.</p><p><code class="methodname">RemoveFirstEvent()</code> removes the first
|
||
event from the queue. If <code class="parameter">outEvent</code>
|
||
isn't <code class="parameter">NULL</code>, the specified buffer is filled with a copy of the event
|
||
that's been removed.</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code></span></p></td><td><p>The event was removed.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NO_INIT</code></span></p></td><td><p>The queue hasn't been initialized.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_SetCleanupHook"></a>SetCleanupHook()</h4></div></div></div><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">SetCleanupHook</span>(<span class="methodparam"><span class="type">cleanup_hook </span><span class="parameter">hook</span></span>,<br /> <span class="methodparam"><span class="type">void* </span><span class="parameter">context</span></span>);</code><p>Sets up the cleanup hook function specified by hook to be called for
|
||
events as they're removed from the queue. The hook will be called only
|
||
for events with
|
||
<a class="link" href="BTimedEventQueue.html#Enums_cleanup_flag" title="cleanup_flag"><span class="type">cleanup_flag</span></a>
|
||
values of <code class="constant">B_DELETE</code> or <code class="constant">B_USER_CLEANUP</code> or
|
||
greater.</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_Constants"></a>Constants</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="Enums_cleanup_flag"></a>cleanup_flag</h4></div></div></div><p>Declared in: <code class="filename">media/TimedEventQueue.h</code></p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_NO_CLEANUP</code></span></p></td><td><p>Don't clean up when the event is removed from the queue.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_RECYCLE_BUFFER</code></span></p></td><td><p><code class="classname">BTimedEventQueue</code> should recycle the buffer when the
|
||
buffer event is removed from the queue.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_EXPIRE_TIMER</code></span></p></td><td><p>Call
|
||
<a class="link" href="BMediaNode.html#BMediaNode_TimerExpired"><code class="methodname">TimerExpired()</code></a>
|
||
on the event's data field.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_USER_CLEANUP</code></span></p></td><td><p>Base value for user-defined cleanup types.</p></td></tr></tbody></table><p>These values define how <code class="classname">BTimedEventQueue</code>
|
||
should handle removing events from the queue. If the flag is
|
||
<code class="constant">B_USER_CLEANUP</code> or greater, the cleanup hook
|
||
function is called when the event is removed.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="Enums_event_type"></a>event_type</h4></div></div></div><p>Declared in: <code class="filename">media/TimedEventQueue.h</code></p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_NO_EVENT</code></span></p></td><td><p>Don't push buffers of this type. It's a return value only.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_ANY_EVENT</code></span></p></td><td><p>Don't push buffers of this type; it's used in searches only.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_START</code></span></p></td><td><p>A start event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_STOP</code></span></p></td><td><p>A stop event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_SEEK</code></span></p></td><td><p>A seek event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_WARP</code></span></p></td><td><p>A warp event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_TIMER</code></span></p></td><td><p>A timer event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_HANDLE_BUFFER</code></span></p></td><td><p>Represents a buffer queued to be handled. The event's
|
||
pointer is a pointer to a
|
||
<a class="link" href="BBuffer.html" title="BBuffer"><code class="classname">BBuffer</code></a>
|
||
object.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_DATA_STATUS</code></span></p></td><td><p>Represents a data status event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_HARDWARE</code></span></p></td><td><p>A hardware event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_PARAMETER</code></span></p></td><td><p>The buffer contains changes to parameter values; pass it to
|
||
<a class="link" href="BControllable.html#BControllable_ApplyParameterData"><code class="methodname">BControllable::ApplyParameterData()</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_USER_EVENT</code></span></p></td><td><p>Base value for user-defined events.</p></td></tr></tbody></table><p>These values describe type types of events that a
|
||
<code class="classname">BTimedEventQueue</code> can handle.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="Enums_queue_action"></a>queue_action</h4></div></div></div><p>Declared in: <code class="filename">media/TimedEventQueue.h</code></p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_DONE</code></span></p></td><td><p>End the
|
||
<a class="link" href="BTimedEventQueue.html#BTimedEventQueue_DoForEach" title="DoForEach()"><code class="methodname">DoForEach()</code></a>
|
||
pass.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NO_ACTION</code></span></p></td><td><p>Do nothing for this event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_REMOVE_EVENT</code></span></p></td><td><p>Remove the event.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_RESORT_QUEUE</code></span></p></td><td><p>Sort the queue again to ensure that events are still in
|
||
the right order.</p></td></tr></tbody></table><p>These queue action values are returned by the hook function used by
|
||
<a class="link" href="BTimedEventQueue.html#BTimedEventQueue_DoForEach" title="DoForEach()"><code class="methodname">DoForEach()</code></a>;
|
||
these values indicate what
|
||
<a class="link" href="BTimedEventQueue.html#BTimedEventQueue_DoForEach" title="DoForEach()"><code class="methodname">DoForEach()</code></a>
|
||
should do to the event after the hook has processed it.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="Enums_time_direction"></a>time_direction</h4></div></div></div><p>Declared in: <code class="filename">media/TimedEventQueue.h</code></p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_ALWAYS</code></span></p></td><td><p>Matches events occurring at any time.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BEFORE_TIME</code></span></p></td><td><p>Matches events occurring before a specified time.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_AT_TIME</code></span></p></td><td><p>Matches events occurring at a specified time.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_AFTER_TIME</code></span></p></td><td><p>Matches events occurring after a specified time.</p></td></tr></tbody></table><p>These values are used to indicate a search direction through the time
|
||
continuum.</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BTimedEventQueue_DefinedTypes"></a>Defined Types</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="cleanup_hook"></a>cleanup_hook</h4></div></div></div><a id="id1176258" class="indexterm"></a><p>Declared in: <code class="filename">media/TimedEventQueue.h</code></p><pre class="programlisting definition c">typedef <span class="type">queue_action</span> (*<span class="type">cleanup_hook</span>)(<span class="type">media_timed_event*</span> <code class="parameter">event</code>,
|
||
<span class="type">void*</span> <code class="parameter">context</code>);</pre><p>The <span class="type">cleanup_hook</span> type is used to define a hook
|
||
function called while removing an event from the queue; it's set by calling
|
||
<a class="link" href="BTimedEventQueue.html#BTimedEventQueue_SetCleanupHook" title="SetCleanupHook()"><code class="methodname">SetCleanupHook()</code></a>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="for_each_hook"></a>for_each_hook</h4></div></div></div><a id="id1176333" class="indexterm"></a><p>Declared in: <code class="filename">media/TimedEventQueue.h</code></p><pre class="programlisting definition c">typedef <span class="type">queue_action</span> (*<span class="type">for_each_hook</span>)(<span class="type">media_timed_event*</span> <code class="parameter">event</code>,
|
||
<span class="type">void*</span> <code class="parameter">context</code>);</pre><p>The <span class="type">for_each_hook</span> type is used to define a hook function called by
|
||
<a class="link" href="BTimedEventQueue.html#BTimedEventQueue_DoForEach" title="DoForEach()"><code class="methodname">DoForEach()</code></a>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="media_timed_event"></a>media_timed_event</h4></div></div></div><a id="id1176408" class="indexterm"></a><p>Declared in: <code class="filename">media/TimedEventQueue.h</code></p><pre class="programlisting definition cpp"><span class="type">struct media_timed_event</span> {
|
||
<code class="methodname">media_timed_event</code>();
|
||
<code class="methodname">media_timed_event</code>(<span class="type">bigtime_t</span> <code class="parameter">inTime</code>, <span class="type">int32</span> <code class="parameter">inType</code>);
|
||
<code class="methodname">media_timed_event</code>(<span class="type">bigtime_t</span> <code class="parameter">inTime</code>, <span class="type">int32</span> <code class="parameter">inType</code>, <span class="type">void*</span> <code class="parameter">inPointer</code>,
|
||
<span class="type">uint32</span> <code class="parameter">inCleanup</code>);
|
||
<code class="methodname">media_timed_event</code>(<span class="type">bigtime_t</span> <code class="parameter">inTime</code>, <span class="type">int32</span> <code class="parameter">inType</code>,
|
||
<span class="type">void*</span> <code class="parameter">inPointer</code>, <span class="type">uint32</span> <code class="parameter">inCleanup</code>,
|
||
<span class="type">int32</span> <code class="parameter">inData</code>, <span class="type">int64</span> <code class="parameter">inBigdata</code>,
|
||
<span class="type">char*</span> <code class="parameter">inUserData</code>, <span class="type">size_t</span> <code class="parameter">dataSize</code> = 0);
|
||
|
||
<code class="methodname">media_timed_event</code>(<span class="type">const media_timed_event&</span> <code class="parameter">clone</code>);
|
||
<span class="type">void</span> <code class="methodname">operator=</code>(<span class="type">const media_timed_event&</span> <code class="parameter">clone</code>);
|
||
|
||
<code class="methodname">~media_timed_event</code>();
|
||
|
||
<span class="type">bigtime_t</span> <code class="varname">event_time</code>;
|
||
<span class="type">int32</span> <code class="varname">type</code>;
|
||
<span class="type">void*</span> <code class="varname">pointer</code>;
|
||
<span class="type">uint32</span> <code class="varname">cleanup</code>;
|
||
<span class="type">int32</span> <code class="varname">data</code>;
|
||
<span class="type">int64</span> <code class="varname">bigdata</code>;
|
||
<span class="type">char</span> <code class="varname">user_data</code>[64];
|
||
<span class="type">uint32</span> <code class="varname">_reserved_media_timed_event_</code>[8];
|
||
};</pre><p>Describes a media event:</p><table class="variablelist fields"><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="varname">event_time</code></span></p></td><td><p>Indicates the time at which the event is scheduled to
|
||
occur.</p></td></tr><tr><td><p><span class="term"><code class="varname">type</code></span></p></td><td><p>Indicates the type of event, as an
|
||
event_type.</p></td></tr><tr><td><p><span class="term"><code class="varname">pointer</code></span></p></td><td><p>Is a pointer to event-specific data owned by the event.</p></td></tr><tr><td><p><span class="term"><code class="varname">cleanup</code></span></p></td><td><p>Is the
|
||
cleanup_flag
|
||
value for the event.</p></td></tr><tr><td><p><span class="term"><code class="varname">data</code></span></p></td><td><p>Is an event-specific 32-bit value.</p></td></tr><tr><td><p><span class="term"><code class="varname">bigdata</code></span></p></td><td><p>Is an event-specific 64-bit value.</p></td></tr><tr><td><p><span class="term"><code class="varname">user_data</code></span></p></td><td><p>Is user-defined data.</p></td></tr></tbody></table></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BTimeCode.html">BTimeCode</a> Up: <a href="TheMediaKit.html">The Media Kit</a> Next: <a href="BTimeSource.html">BTimeSource</a> </div><div id="footerB"><div id="footerBL"><a href="BTimeCode.html" title="BTimeCode"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheMediaKit.html" title="The Media Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BTimeSource.html" title="BTimeSource"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
|
||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
|
||
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>
|