41 lines
13 KiB
HTML
41 lines
13 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 Midi 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="TheMidiKit.html" title="The Midi Kit" /><link rel="prev" href="BMidiPort.html" title="BMidiPort" /><link rel="next" href="BMidiSynth.html" title="BMidiSynth" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BMidiPort.html" title="BMidiPort"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheMidiKit.html" title="The Midi Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BMidiSynth.html" title="BMidiSynth"><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 Midi Kit</div></div><div id="headerB">Prev: <a href="BMidiPort.html">BMidiPort</a> Up: <a href="TheMidiKit.html">The Midi Kit</a> Next: <a href="BMidiSynth.html">BMidiSynth</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="BMidiStore"></a>BMidiStore</h2></div></div></div><a id="id1197820" 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">midi/MidiStore.h</code></td></tr><tr><td>Library:</td><td><code class="filename">libmidi.so</code></td></tr><tr><td>Allocation:</td><td>–</td></tr></tbody></table></td><td>
|
||
<a class="link overview" href="BMidiStore_Overview.html" title="BMidiStore">Class Overview</a>
|
||
<div class="toc"><ul><li><span class="section"><a href="BMidiStore.html#BMidiStore_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BMidiStore.html#BMidiStore_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="BMidiStore_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="BMidiStore_Constructor"></a>BMidiStore()</h4></div></div></div><code class="constructorsynopsis cpp"><span class="methodname">BMidiStore</span>();</code><p>The constructor creates a new, empty <code class="classname">BMidiStore</code>
|
||
object.</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="BMidiStore_Destructor"></a>~BMidiStore()</h4></div></div></div><code class="destructorsynopsis cpp"><span class="modifier">virtual </span><span class="methodname">~BMidiStore</span>();</code><p>The destructor destroys the object and its storage.</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="BMidiStore_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="BMidiStore_BeginTime"></a>BeginTime()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">uint32 </span><span class="methodname">BeginTime</span>() <span class="modifier">const</span>;</code><p>Returns the time, in ticks, at which the most recent performance started.
|
||
This function is only valid if the object has actually performed.</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="BMidiStore_CountEvents"></a><a id="BMidiStore_SortEvents"></a>
|
||
<a id="BMidiStore_DeltaOfEvent"></a>
|
||
<a id="BMidiStore_EventAtDelta"></a>
|
||
CountEvents(), SortEvents(), DeltaOfEvent(), EventAtDelta()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">uint32 </span><span class="methodname">CountEvents</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">SortEvents</span>(<span class="methodparam"><span class="type">bool </span><span class="parameter">force</span><span class="initializer"> = <span class="constant">false</span></span></span>);</code><code class="methodsynopsis cpp"><span class="type">uint32 </span><span class="methodname">DeltaOfEvent</span>(<span class="methodparam"><span class="type">uint32 </span><span class="parameter">index</span></span>) <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">uint32 </span><span class="methodname">EventAtDelta</span>(<span class="methodparam"><span class="type">uint32 </span><span class="parameter">delta</span></span>) <span class="modifier">const</span>;</code><p><code class="methodname">CountEvents()</code> returns the number
|
||
of events in the object's event list.</p><p><code class="methodname">SortEvents()</code> time-sorts the events in
|
||
the event list. The object maintains a (conservative) notion of whether the
|
||
events are already sorted; if <code class="parameter">force</code> is
|
||
<code class="constant">false</code> and the object doesn't think the operation
|
||
is necessary, the sorting isn't performed. If
|
||
<code class="parameter">force</code> is <code class="constant">true</code>, the
|
||
operation is always performed, regardless of its necessity.</p><p><code class="methodname">DeltaOfEvent()</code> returns the "delta
|
||
time" of the <code class="parameter">index</code>'th event in the object's
|
||
list of events. An event's delta time is the time span, in milliseconds,
|
||
between the first event in the event list and itself.</p><p><code class="methodname">EventAtDelta()</code> Returns the index of
|
||
the event that occurs on or after <code class="parameter">delta</code>
|
||
milliseconds from the beginning of the event list.</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="BMidiStore_Export"></a><a id="BMidiStore_Import"></a>
|
||
Export(), Import()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">Export</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">entry_ref* </span><span class="parameter">to_file</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">format</span></span>);</code><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">Export</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">entry_ref* </span><span class="parameter">from_file</span></span>);</code><p><code class="methodname">Export()</code> time-sorts the object's event
|
||
list, and then writes the list as a standard MIDI file in the designated
|
||
<code class="parameter">format</code>; the <code class="parameter">format</code>
|
||
argument should be either 0 or 1. The file that
|
||
<code class="parameter">to_file</code> refers to must already exist, and is not
|
||
cleared before it's written.</p><p><code class="methodname">Import()</code> reads the standard MIDI file
|
||
from the designated file and adds its events to the object's event
|
||
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>The file was successfully written or read.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NO_MEMORY</code> (<code class="methodname">Import()</code> only)</span></p></td><td><p>Couldn't allocate enough memory to accommodate the file.</p></td></tr><tr><td><p><span class="term">POSIX errors</span></p></td><td><p>Some other file error prevented the operation.</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="BMidiStore_SetCurrentEvent"></a><a id="BMidiStore_CurrentEvent"></a>
|
||
SetCurrentEvent(), CurrentEvent()</h4></div></div></div><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">SetCurrentEvent</span>(<span class="methodparam"><span class="type">uint32 </span><span class="parameter">index</span></span>);</code><code class="methodsynopsis cpp"><span class="type">uint32 </span><span class="methodname">CurrentEvent</span>();</code><p>Sets the object's "current event"—the event that it will perform
|
||
next—to the event at index in the event list.</p><p><code class="methodname">CurrentEvent()</code> returns the index of the
|
||
event that will be performed next.</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="BMidiStore_SetTempo"></a><a id="BMidiStore_Tempo"></a>
|
||
SetTempo(), Tempo()</h4></div></div></div><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">SetTempo</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">beatsPerMinute</span></span>);</code><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">Tempo</span>() <span class="modifier">const</span>;</code><p>Sets and returns the object's tempo—the speed at which it performs
|
||
events—in beats per minute. The default tempo is 60 bpm.</p></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BMidiPort.html">BMidiPort</a> Up: <a href="TheMidiKit.html">The Midi Kit</a> Next: <a href="BMidiSynth.html">BMidiSynth</a> </div><div id="footerB"><div id="footerBL"><a href="BMidiPort.html" title="BMidiPort"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheMidiKit.html" title="The Midi Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BMidiSynth.html" title="BMidiSynth"><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>
|