Files
stk/doc/html/classMessager.html
2013-09-29 23:39:37 +02:00

126 lines
7.8 KiB
HTML

<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<img src="princeton.gif"> &nbsp; <img src="ccrma.gif"> &nbsp; <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>Messager Class Reference</h1><code>#include &lt;<a class="el" href="Messager_8h-source.html">Messager.h</a>&gt;</code>
<p>
<p>Inheritance diagram for Messager:
<p><center><img src="classMessager.png" usemap="#Messager_map" border="0" alt=""></center>
<map name="Messager_map">
<area href="classStk.html" alt="Stk" shape="rect" coords="0,0,68,24">
</map>
<a href="classMessager-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
STK input control message parser.
<p>
This class reads and parses control messages from a variety of sources, such as a scorefile, MIDI port, socket connection, or stdin. MIDI messages are retrieved using the <a class="el" href="classRtMidi.html">RtMidi</a> class. All other input sources (scorefile, socket, or stdin) are assumed to provide SKINI formatted messages. This class can be compiled with generic, non-realtime support, in which case only scorefile reading is possible.<p>
The various <em>realtime</em> message acquisition mechanisms (from MIDI, socket, or stdin) take place asynchronously, filling the message queue. A call to <a class="el" href="classMessager.html#a2">popMessage()</a> will pop the next available control message from the queue and return it via the referenced Message structure. When a <em>non-realtime</em> scorefile is set, it is not possible to start reading realtime input messages (from MIDI, socket, or stdin). Likewise, it is not possible to read from a scorefile when a realtime input mechanism is running.<p>
When MIDI input is started, input is also automatically read from stdin. This allows for program termination via the terminal window. An __SK_Exit_ message is pushed onto the stack whenever an "exit" or "Exit" message is received from stdin or when all socket connections close and no stdin thread is running.<p>
This class is primarily for use in STK example programs but it is generic enough to work in many other contexts.<p>
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
<p>
<p>
Definition at line <a class="el" href="Messager_8h-source.html#l00057">57</a> of file <a class="el" href="Messager_8h-source.html">Messager.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a0" doxytag="Messager::Messager" ></a>
&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a0">Messager</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a1" doxytag="Messager::~Messager" ></a>
&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a1">~Messager</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class destructor. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a2">popMessage</a> (<a class="el" href="structSkini_1_1Message.html">Skini::Message</a> &amp;message)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pop the next message from the queue and write it to the referenced message structure. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a3" doxytag="Messager::pushMessage" ></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a3">pushMessage</a> (<a class="el" href="structSkini_1_1Message.html">Skini::Message</a> &amp;message)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Push the referenced message onto the message stack. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a4">setScoreFile</a> (const char *filename)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specify a SKINI formatted scorefile from which messages should be read. </em> <a href="#a4"></a><em><br><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a2" doxytag="Messager::popMessage" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Messager::popMessage </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="structSkini_1_1Message.html">Skini::Message</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>message</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Pop the next message from the queue and write it to the referenced message structure.
<p>
Invalid messages (or an empty queue) are indicated by type values of zero, in which case all other message structure values are undefined. The user MUST verify the returned message type is valid before reading other message values. </td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="Messager::setScoreFile" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool Messager::setScoreFile </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const char *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>filename</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Specify a SKINI formatted scorefile from which messages should be read.
<p>
A return value of <code>true</code> indicates the call was successful. A return value of <code>false</code> can occur if the file is not found, cannot be opened, another file is currently still open, or if a realtime input mechanism is running. Scorefile input is considered to be a non-realtime control mechanism that cannot run concurrently with realtime input. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Messager_8h-source.html">Messager.h</a></ul>
<HR>
<table>
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
<tr><td>&copy;1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>