haiku-website/static/legacy-docs/bebook/BMediaFiles.html

32 lines
16 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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="BMediaFile.html" title="BMediaFile" /><link rel="next" href="BMediaFormats.html" title="BMediaFormats" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BMediaFile.html" title="BMediaFile"><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="BMediaFormats.html" title="BMediaFormats"><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="BMediaFile.html">BMediaFile</a>  Up: <a href="TheMediaKit.html">The Media Kit</a>  Next: <a href="BMediaFormats.html">BMediaFormats</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="BMediaFiles"></a>BMediaFiles</h2></div></div></div><a id="id1142120" 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/MediaFiles.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="BMediaFiles_Overview.html" title="BMediaFiles">Class Overview</a>
<div class="toc"><ul><li><span class="section"><a href="BMediaFiles.html#BMediaFiles_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BMediaFiles.html#BMediaFiles_MemberFunctions">Member Functions</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="BMediaFiles_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="BMediaFiles_Constructor"></a>BMediaFiles()</h4></div></div></div><code class="constructorsynopsis cpp"><span class="methodname">BMediaFiles</span>();</code><p>Constructor.</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="BMediaFiles_Destructor"></a>~BMediaFiles()</h4></div></div></div><code class="destructorsynopsis cpp"><span class="modifier">virtual </span><span class="methodname">~BMediaFiles()</span>();</code><p>Destructor.</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="BMediaFiles_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="BMediaFiles_GetNextRef"></a>GetNextRef()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">GetNextRef</span>(<span class="methodparam"><span class="type"><span class="classname">BString</span>* </span><span class="parameter">outType</span></span>,<br />                            <span class="methodparam"><span class="type">entry_ref </span><span class="parameter">outRef</span><span class="initializer"> = <span class="constant">NULL</span></span></span>);</code><p>Returns the next media type in <code class="parameter">outType</code>.
These types include things like "sound" and "bitmap."</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.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_INDEX</code></span></p></td><td><p>No more <span class="type">entry_ref</span>s to get.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_VALUE</code></span></p></td><td><p><code class="parameter">outType</code> is <code class="constant">NULL</code>.</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="BMediaFiles_GetNextType"></a>GetNextType()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">GetNextType</span>(<span class="methodparam"><span class="type"><span class="classname">BString</span>* </span><span class="parameter">outType</span></span>) <span class="modifier">const</span>;</code><p>Returns the next media type in <code class="parameter">outType</code>.
These types include things like "sound" and "bitmap."</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.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_INDEX</code></span></p></td><td><p>No more types to get.</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="BMediaFiles_GetRefFor"></a><a id="RemoveRefFor"></a>
<a id="SetRefFor"></a>
GetRefFor(), SetRefFor(), RemoveRefFor()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">GetRefFor</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">type</span></span>,<br />                           <span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">item</span></span>,<br />                           <span class="methodparam"><span class="type">entry_ref* </span><span class="parameter">outRef</span></span>);</code><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">SetRefFor</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">type</span></span>,<br />                           <span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">item</span></span>,<br />                           <span class="methodparam"><span class="type">entry_ref&amp; </span><span class="parameter">outRef</span></span>);</code><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">RemoveRefFor</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">type</span></span>,<br />                              <span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">item</span></span>,<br />                              <span class="methodparam"><span class="type">entry_ref&amp; </span><span class="parameter">outRef</span></span>);</code><p><code class="methodname">GetRefFor()</code> returns the
<span class="type">entry_ref</span> for the media file that's been assigned
to the specified <code class="parameter">type</code> and <code class="parameter">item</code>
name pair. For example, if you wanted to
retrieve the sound file that's been assigned as the system startup sound,
you might specify type as "sound" and item as "startup sound."</p><p><code class="methodname">SetRefFor()</code> sets, by <span class="type">entry_ref</span>,
the file to be used for the specified
<code class="parameter">type</code>/<code class="parameter">item</code> pairing.</p><p><code class="methodname">RemoveRefFor()</code> removes the specified
<span class="type">entry_ref</span> for the given
<code class="parameter">type</code>/<code class="parameter">item</code> pairing.</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.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_ENTRY_NOT_FOUND</code></span></p></td><td><p>(<code class="methodname">GetRefFor()</code> only) the specified
<code class="parameter">type</code>/<code class="parameter">item</code> pair
isn't assigned.</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="BMediaFiles_RewindRefs"></a>RewindRefs()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">RewindRefs</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">type</span></span>);</code><p>Rewinds the <span class="type">entry_ref</span> list for the specified media
type, so you can start scanning from the beginning of the list.</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.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_VALUE</code></span></p></td><td><p><code class="parameter">type</code> is <code class="constant">NULL</code>.</p></td></tr><tr><td><p><span class="term">Other errors.</span></p></td><td><p>Unable to rewind; the Media Server may not be responding.</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="BMediaFiles_RemoveItem"></a>RemoveItem()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">RemoveItem</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">type</span></span>);</code><p>Removes an entrire entry from the media files database. Unlike
<code class="methodname">RemoveRefFor()</code>, which removes an
<span class="type">entry_ref</span> from an entry, this function
actually deletes the entire entry.</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.</p></td></tr><tr><td><p><span class="term">Other errors.</span></p></td><td><p>Unable to remove the item; the Media Server may not be responding.</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="BMediaFiles_RewindTypes"></a>RewindTypes()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">RewindTypes</span>();</code><p>Rewinds to the beginning of the media type list. If you've been using a
<code class="classname">BMediaFiles</code> object and want to begin scanning again from the beginning of
the media type list, you should call this function.</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.</p></td></tr><tr><td><p><span class="term">Other errors.</span></p></td><td><p>Unable to rewind; the Media Server may not be responding.</p></td></tr></tbody></table></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BMediaFile.html">BMediaFile</a>  Up: <a href="TheMediaKit.html">The Media Kit</a>  Next: <a href="BMediaFormats.html">BMediaFormats</a> </div><div id="footerB"><div id="footerBL"><a href="BMediaFile.html" title="BMediaFile"><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="BMediaFormats.html" title="BMediaFormats"><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>