mirror of
https://github.com/thestk/stk
synced 2026-01-15 05:51:52 +00:00
Release 4.2.0 tarball
This commit is contained in:
committed by
Stephen Sinclair
parent
fe20fe92a2
commit
de344668dd
@@ -9,117 +9,57 @@
|
||||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="information.html">Information</a> <a class="qindex" href="classes.html">Classes</a> <a class="qindex" href="download.html">Download</a> <a class="qindex" href="usage.html">Usage</a> <a class="qindex" href="maillist.html">Mail List</a> <a class="qindex" href="system.html">Requirements</a> <a class="qindex" href="links.html">Links</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
||||
<HR>
|
||||
<!-- Generated by Doxygen 1.3.4 -->
|
||||
<h1>Messager Class Reference</h1>STK input control message parser.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <<a class="el" href="Messager_8h-source.html">Messager.h</a>></code>
|
||||
<h1>Messager Class Reference</h1><code>#include <<a class="el" href="Messager_8h-source.html">Messager.h</a>></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><table border=0 cellpadding=0 cellspacing=0>
|
||||
<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> </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a0">Messager</a> (int inputMask=0, int port=2001)</td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a0" doxytag="Messager::Messager" ></a>
|
||||
</td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a0">Messager</a> ()</td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor performs initialization based on an input mask and an optional socket port. </em> <a href="#a0"></a><em><br><br></td></tr>
|
||||
<tr><td class="mdescLeft"> </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>
|
||||
</td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a1">~Messager</a> ()</td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class destructor. <br><br></td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a2">nextMessage</a> (void)</td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align=right valign=top>void </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> &message)</td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Check for a new input message and return the message type. </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::setRtDelta" ></a>
|
||||
void </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a3">setRtDelta</a> (long nSamples)</td></tr>
|
||||
<tr><td class="mdescLeft"> </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 </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> &message)</td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the delta time (in samples) returned between valid realtime messages. This setting has no affect for scorefile messages. <br><br></td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a4" doxytag="Messager::getDelta" ></a>
|
||||
long </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a4">getDelta</a> (void) const </td></tr>
|
||||
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a4">setScoreFile</a> (const char *filename)</td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the current message "delta time" in samples. <br><br></td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a5" doxytag="Messager::getType" ></a>
|
||||
long </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a5">getType</a> () const </td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the current message type. <br><br></td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a6" doxytag="Messager::getByteTwo" ></a>
|
||||
MY_FLOAT </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a6">getByteTwo</a> () const </td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the byte two value for the current message. <br><br></td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a7" doxytag="Messager::getByteThree" ></a>
|
||||
MY_FLOAT </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a7">getByteThree</a> () const </td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the byte three value for the current message. <br><br></td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a8" doxytag="Messager::getChannel" ></a>
|
||||
long </td><td class="memItemRight" valign=bottom><a class="el" href="classMessager.html#a8">getChannel</a> () const </td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the channel number for the current message. <br><br></td></tr>
|
||||
</table>
|
||||
<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 MIDI port, scorefile, socket connection, or pipe. MIDI messages are retrieved using the <a class="el" href="classRtMidi.html">RtMidi</a> class. All other input sources (scorefile, socket, or pipe) are assumed to provide <a class="el" href="classSKINI.html">SKINI</a> formatted messages.<p>
|
||||
For each call to <a class="el" href="classMessager.html#a2">nextMessage()</a>, the active input sources are queried to see if a new control message is available.<p>
|
||||
This class is primarily for use in STK main() event loops.<p>
|
||||
One of the original goals in creating this class was to simplify the message acquisition process by removing all threads. If the windoze select() function behaved just like the unix one, that would have been possible. Since it does not (it can't be used to poll STDIN), I am using a thread to acquire messages from STDIN, which sends these messages via a socket connection to the message socket server. Perhaps in the future, it will be possible to simplify things.<p>
|
||||
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
|
||||
<p>
|
||||
|
||||
<p>
|
||||
Definition at line <a class="el" href="Messager_8h-source.html#l00063">63</a> of file <a class="el" href="Messager_8h-source.html">Messager.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
|
||||
<a class="anchor" name="a0" doxytag="Messager::Messager" ></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"> Messager::Messager </td>
|
||||
<td class="md" valign="top">( </td>
|
||||
<td class="md" nowrap valign="top">int </td>
|
||||
<td class="mdname" nowrap> <em>inputMask</em> = 0, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="md" nowrap>int </td>
|
||||
<td class="mdname" nowrap> <em>port</em> = 2001</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="md">) </td>
|
||||
<td class="md" colspan="2"></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellspacing=5 cellpadding=0 border=0>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<p>
|
||||
Constructor performs initialization based on an input mask and an optional socket port.
|
||||
<p>
|
||||
The default constructor is set to read input from a <a class="el" href="classSKINI.html">SKINI</a> scorefile. The flags STK_MIDI, STK_PIPE, and STK_SOCKET can be OR'ed together in any combination for multiple "realtime" input source parsing. An optional socket port number can be specified for use when the STK_SOCKET flag is set. For realtime input types, an <a class="el" href="classStkError.html">StkError</a> can be thrown during instantiation. </td>
|
||||
</tr>
|
||||
<tr><td class="mdescLeft"> </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::nextMessage" ></a><p>
|
||||
<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"> long Messager::nextMessage </td>
|
||||
<td class="md" nowrap valign="top"> void Messager::popMessage </td>
|
||||
<td class="md" valign="top">( </td>
|
||||
<td class="md" nowrap valign="top">void </td>
|
||||
<td class="mdname1" valign="top" nowrap> </td>
|
||||
<td class="md" nowrap valign="top"><a class="el" href="structSkini_1_1Message.html">Skini::Message</a> & </td>
|
||||
<td class="mdname1" valign="top" nowrap> <em>message</em> </td>
|
||||
<td class="md" valign="top"> ) </td>
|
||||
<td class="md" nowrap></td>
|
||||
</tr>
|
||||
@@ -136,9 +76,40 @@ The default constructor is set to read input from a <a class="el" href="classSKI
|
||||
<td>
|
||||
|
||||
<p>
|
||||
Check for a new input message and return the message type.
|
||||
Pop the next message from the queue and write it to the referenced message structure.
|
||||
<p>
|
||||
Return type values greater than zero represent valid messages. If an input scorefile has been completely read or all realtime input sources have closed, a negative value is returned. If the return type is zero, no valid messages are present. </td>
|
||||
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">( </td>
|
||||
<td class="md" nowrap valign="top">const char * </td>
|
||||
<td class="mdname1" valign="top" nowrap> <em>filename</em> </td>
|
||||
<td class="md" valign="top"> ) </td>
|
||||
<td class="md" nowrap></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellspacing=5 cellpadding=0 border=0>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</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>
|
||||
@@ -146,7 +117,7 @@ Return type values greater than zero represent valid messages. If an input score
|
||||
<HR>
|
||||
|
||||
<table>
|
||||
<tr><td><A HREF="http://www-ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
||||
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
||||
<tr><td>©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user