mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
116 lines
6.5 KiB
HTML
116 lines
6.5 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"> <img src="ccrma.gif"><P>
|
|
<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="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.2.8.1 -->
|
|
<h1>Messager.h</h1><div class="fragment"><pre>00001 <font class="comment">/***************************************************/</font>
|
|
00034 <font class="comment">/***************************************************/</font>
|
|
00035
|
|
00036 <font class="preprocessor">#if !defined(__MESSAGER_H)</font>
|
|
00037 <font class="preprocessor"></font><font class="preprocessor">#define __MESSSAGER_H</font>
|
|
00038 <font class="preprocessor"></font>
|
|
00039 <font class="preprocessor">#include "Stk.h"</font>
|
|
00040 <font class="preprocessor">#include "SKINI.h"</font>
|
|
00041
|
|
00042 <font class="preprocessor">#define MESSAGE_LENGTH 128</font>
|
|
00043 <font class="preprocessor"></font><font class="preprocessor">#define MAX_MESSAGES 25</font>
|
|
00044 <font class="preprocessor"></font>
|
|
00045 <font class="preprocessor">#if defined(__STK_REALTIME__)</font>
|
|
00046 <font class="preprocessor"></font>
|
|
00047 <font class="preprocessor">#include "Thread.h"</font>
|
|
00048 <font class="preprocessor">#include "Socket.h"</font>
|
|
00049 <font class="preprocessor">#include "RtMidi.h"</font>
|
|
00050
|
|
00051 <font class="preprocessor">#define STK_MIDI 0x0001</font>
|
|
00052 <font class="preprocessor"></font><font class="preprocessor">#define STK_PIPE 0x0002</font>
|
|
00053 <font class="preprocessor"></font><font class="preprocessor">#define STK_SOCKET 0x0004</font>
|
|
00054 <font class="preprocessor"></font>
|
|
00055 <font class="keyword">extern</font> <font class="stringliteral">"C"</font> THREAD_RETURN THREAD_TYPE stdinHandler(<font class="keywordtype">void</font> * ptr);
|
|
00056
|
|
00057 <font class="preprocessor">#if (defined(__OS_IRIX__) || defined(__OS_LINUX__))</font>
|
|
00058 <font class="preprocessor"></font><font class="preprocessor"> #include <sys/types.h></font>
|
|
00059 <font class="preprocessor"> #include <sys/time.h></font>
|
|
00060 <font class="preprocessor">#endif</font>
|
|
00061 <font class="preprocessor"></font>
|
|
00062 <font class="preprocessor">#endif // __STK_REALTIME__</font>
|
|
00063 <font class="preprocessor"></font>
|
|
00064 <font class="keyword">class </font><a class="code" href="classMessager.html">Messager</a> : <font class="keyword">public</font> <a class="code" href="classStk.html">Stk</a>
|
|
00065 {
|
|
00066 <font class="keyword">public</font>:
|
|
00068
|
|
00075 <a class="code" href="classMessager.html#a0">Messager</a>(<font class="keywordtype">int</font> inputMask = 0);
|
|
00076
|
|
00078 <a class="code" href="classMessager.html#a1">~Messager</a>();
|
|
00079
|
|
00081
|
|
00087 <font class="keywordtype">long</font> <a class="code" href="classMessager.html#a2">nextMessage</a>(<font class="keywordtype">void</font>);
|
|
00088
|
|
00090 <font class="keywordtype">void</font> <a class="code" href="classMessager.html#a3">setRtDelta</a>(<font class="keywordtype">long</font> nSamples);
|
|
00091
|
|
00093 <font class="keywordtype">long</font> <a class="code" href="classMessager.html#a4">getDelta</a>(<font class="keywordtype">void</font>) <font class="keyword">const</font>;
|
|
00094
|
|
00096 <font class="keywordtype">long</font> <a class="code" href="classMessager.html#a5">getType</a>() <font class="keyword">const</font>;
|
|
00097
|
|
00099 MY_FLOAT <a class="code" href="classMessager.html#a6">getByteTwo</a>() <font class="keyword">const</font>;
|
|
00100
|
|
00102 MY_FLOAT <a class="code" href="classMessager.html#a7">getByteThree</a>() <font class="keyword">const</font>;
|
|
00103
|
|
00105 <font class="keywordtype">long</font> <a class="code" href="classMessager.html#a8">getChannel</a>() <font class="keyword">const</font>;
|
|
00106
|
|
00107 <font class="keyword">protected</font>:
|
|
00108
|
|
00109 <a class="code" href="classSKINI.html">SKINI</a> *skini;
|
|
00110 <font class="keywordtype">long</font> type;
|
|
00111 <font class="keywordtype">long</font> channel;
|
|
00112 MY_FLOAT byte2;
|
|
00113 MY_FLOAT byte3;
|
|
00114 <font class="keywordtype">int</font> sources;
|
|
00115 <font class="keywordtype">long</font> delta;
|
|
00116 <font class="keywordtype">long</font> rtDelta;
|
|
00117 <font class="keywordtype">char</font> message[MAX_MESSAGES][MESSAGE_LENGTH];
|
|
00118 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> messageIndex;
|
|
00119 <font class="keywordtype">int</font> nMessages;
|
|
00120
|
|
00121 <font class="preprocessor">#if defined(__STK_REALTIME__)</font>
|
|
00122 <font class="preprocessor"></font>
|
|
00123 <font class="comment">// Check MIDI source for new messages.</font>
|
|
00124 <font class="keywordtype">bool</font> midiMessage(<font class="keywordtype">void</font>);
|
|
00125
|
|
00126 <font class="comment">// Check socket sources for new messages.</font>
|
|
00127 <font class="keywordtype">bool</font> socketMessage(<font class="keywordtype">void</font>);
|
|
00128
|
|
00129 <font class="comment">// Receive and parse socket data.</font>
|
|
00130 <font class="keywordtype">bool</font> readSocket(<font class="keywordtype">int</font> fd);
|
|
00131
|
|
00132 <a class="code" href="classRtMidi.html">RtMidi</a> *midi;
|
|
00133 <a class="code" href="classThread.html">Thread</a> *thread;
|
|
00134 <a class="code" href="classSocket.html">Socket</a> *soket;
|
|
00135
|
|
00136 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> nSockets;
|
|
00137 fd_set mask;
|
|
00138 <font class="keywordtype">int</font> maxfd;
|
|
00139 <font class="keywordtype">int</font> pipefd;
|
|
00140 <font class="keywordtype">int</font> fd[16];
|
|
00141 <font class="keywordtype">char</font> error[256];
|
|
00142
|
|
00143 <font class="preprocessor">#endif // __STK_REALTIME__</font>
|
|
00144 <font class="preprocessor"></font>
|
|
00145 };
|
|
00146
|
|
00147 <font class="preprocessor">#endif // defined(__MESSAGER_H)</font>
|
|
</font></pre></div><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>©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|