PageRenderTime 26ms CodeModel.GetById 3ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

/apidocs/echonest.support.midi.RawInstreamFile.RawInstreamFile-class.html

http://echo-nest-remix.googlecode.com/
HTML | 365 lines | 314 code | 30 blank | 21 comment | 0 complexity | 3467b45594ac8ac5fe36ef3eb01303f3 MD5 | raw file
  1<?xml version="1.0" encoding="ascii"?>
  2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3          "DTD/xhtml1-transitional.dtd">
  4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5<head>
  6  <title>echonest.support.midi.RawInstreamFile.RawInstreamFile</title>
  7  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  8  <script type="text/javascript" src="epydoc.js"></script>
  9</head>
 10
 11<body bgcolor="white" text="black" link="blue" vlink="#204080"
 12      alink="#204080">
 13<!-- ==================== NAVIGATION BAR ==================== -->
 14<table class="navbar" border="0" width="100%" cellpadding="0"
 15       bgcolor="#a0c0ff" cellspacing="0">
 16  <tr valign="middle">
 17
 18  <!-- Tree link -->
 19      <th>&nbsp;&nbsp;&nbsp;<a
 20        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
 21
 22  <!-- Index link -->
 23      <th>&nbsp;&nbsp;&nbsp;<a
 24        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
 25
 26  <!-- Help link -->
 27      <th>&nbsp;&nbsp;&nbsp;<a
 28        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
 29
 30  <!-- Project homepage -->
 31      <th class="navbar" align="right" width="100%">
 32        <table border="0" cellpadding="0" cellspacing="0">
 33          <tr><th class="navbar" align="center"
 34            ><a class="navbar" target="_top" href="http://code.google.com/p/echo-nest-remix/">Project Homepage</a></th>
 35          </tr></table></th>
 36  </tr>
 37</table>
 38<table width="100%" cellpadding="0" cellspacing="0">
 39  <tr valign="top">
 40    <td width="100%">
 41      <span class="breadcrumbs">
 42        <a href="echonest-module.html">Package&nbsp;echonest</a> ::
 43        <a href="echonest.support-module.html">Package&nbsp;support</a> ::
 44        <a href="echonest.support.midi-module.html">Package&nbsp;midi</a> ::
 45        <a href="echonest.support.midi.RawInstreamFile-module.html">Module&nbsp;RawInstreamFile</a> ::
 46        Class&nbsp;RawInstreamFile
 47      </span>
 48    </td>
 49    <td>
 50      <table cellpadding="0" cellspacing="0">
 51        <!-- hide/show private -->
 52        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
 53    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
 54        <tr><td align="right"><span class="options"
 55            >[<a href="frames.html" target="_top">frames</a
 56            >]&nbsp;|&nbsp;<a href="echonest.support.midi.RawInstreamFile.RawInstreamFile-class.html"
 57            target="_top">no&nbsp;frames</a>]</span></td></tr>
 58      </table>
 59    </td>
 60  </tr>
 61</table>
 62<!-- ==================== CLASS DESCRIPTION ==================== -->
 63<h1 class="epydoc">Class RawInstreamFile</h1><p class="nomargin-top"><span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile">source&nbsp;code</a></span></p>
 64It parses and reads data from an input file. It takes care of big
 65endianess, and keeps track of the cursor position. The midi parser
 66only reads from this object. Never directly from the file.
 67
 68<!-- ==================== INSTANCE METHODS ==================== -->
 69<a name="section-InstanceMethods"></a>
 70<table class="summary" border="1" cellpadding="3"
 71       cellspacing="0" width="100%" bgcolor="white">
 72<tr bgcolor="#70b0f0" class="table-header">
 73  <td colspan="2" class="table-header">
 74    <table border="0" cellpadding="0" cellspacing="0" width="100%">
 75      <tr valign="top">
 76        <td align="left"><span class="table-header">Instance Methods</span></td>
 77        <td align="right" valign="top"
 78         ><span class="options">[<a href="#section-InstanceMethods"
 79         class="privatelink" onclick="toggle_private();"
 80         >hide private</a>]</span></td>
 81      </tr>
 82    </table>
 83  </td>
 84</tr>
 85<tr>
 86    <td width="15%" align="right" valign="top" class="summary">
 87      <span class="summary-type">&nbsp;</span>
 88    </td><td class="summary">
 89      <table width="100%" cellpadding="0" cellspacing="0" border="0">
 90        <tr>
 91          <td><span class="summary-sig"><a href="echonest.support.midi.RawInstreamFile.RawInstreamFile-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
 92        <span class="summary-sig-arg">infile</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span><br />
 93      If 'file' is a string we assume it is a path and read from
 94that file.</td>
 95          <td align="right" valign="top">
 96            <span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.__init__">source&nbsp;code</a></span>
 97            
 98          </td>
 99        </tr>
100      </table>
101      
102    </td>
103  </tr>
104<tr>
105    <td width="15%" align="right" valign="top" class="summary">
106      <span class="summary-type">&nbsp;</span>
107    </td><td class="summary">
108      <table width="100%" cellpadding="0" cellspacing="0" border="0">
109        <tr>
110          <td><span class="summary-sig"><a name="setData"></a><span class="summary-sig-name">setData</span>(<span class="summary-sig-arg">self</span>,
111        <span class="summary-sig-arg">data</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span><br />
112      Sets the data from a string.</td>
113          <td align="right" valign="top">
114            <span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.setData">source&nbsp;code</a></span>
115            
116          </td>
117        </tr>
118      </table>
119      
120    </td>
121  </tr>
122<tr>
123    <td width="15%" align="right" valign="top" class="summary">
124      <span class="summary-type">&nbsp;</span>
125    </td><td class="summary">
126      <table width="100%" cellpadding="0" cellspacing="0" border="0">
127        <tr>
128          <td><span class="summary-sig"><a name="setCursor"></a><span class="summary-sig-name">setCursor</span>(<span class="summary-sig-arg">self</span>,
129        <span class="summary-sig-arg">position</span>=<span class="summary-sig-default">0</span>)</span><br />
130      Sets the absolute position if the cursor</td>
131          <td align="right" valign="top">
132            <span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.setCursor">source&nbsp;code</a></span>
133            
134          </td>
135        </tr>
136      </table>
137      
138    </td>
139  </tr>
140<tr>
141    <td width="15%" align="right" valign="top" class="summary">
142      <span class="summary-type">&nbsp;</span>
143    </td><td class="summary">
144      <table width="100%" cellpadding="0" cellspacing="0" border="0">
145        <tr>
146          <td><span class="summary-sig"><a name="getCursor"></a><span class="summary-sig-name">getCursor</span>(<span class="summary-sig-arg">self</span>)</span><br />
147      Returns the value of the cursor</td>
148          <td align="right" valign="top">
149            <span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.getCursor">source&nbsp;code</a></span>
150            
151          </td>
152        </tr>
153      </table>
154      
155    </td>
156  </tr>
157<tr>
158    <td width="15%" align="right" valign="top" class="summary">
159      <span class="summary-type">&nbsp;</span>
160    </td><td class="summary">
161      <table width="100%" cellpadding="0" cellspacing="0" border="0">
162        <tr>
163          <td><span class="summary-sig"><a name="moveCursor"></a><span class="summary-sig-name">moveCursor</span>(<span class="summary-sig-arg">self</span>,
164        <span class="summary-sig-arg">relative_position</span>=<span class="summary-sig-default">0</span>)</span><br />
165      Moves the cursor to a new relative position</td>
166          <td align="right" valign="top">
167            <span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.moveCursor">source&nbsp;code</a></span>
168            
169          </td>
170        </tr>
171      </table>
172      
173    </td>
174  </tr>
175<tr>
176    <td width="15%" align="right" valign="top" class="summary">
177      <span class="summary-type">&nbsp;</span>
178    </td><td class="summary">
179      <table width="100%" cellpadding="0" cellspacing="0" border="0">
180        <tr>
181          <td><span class="summary-sig"><a name="nextSlice"></a><span class="summary-sig-name">nextSlice</span>(<span class="summary-sig-arg">self</span>,
182        <span class="summary-sig-arg">length</span>,
183        <span class="summary-sig-arg">move_cursor</span>=<span class="summary-sig-default">1</span>)</span><br />
184      Reads the next text slice from the raw data, with length</td>
185          <td align="right" valign="top">
186            <span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.nextSlice">source&nbsp;code</a></span>
187            
188          </td>
189        </tr>
190      </table>
191      
192    </td>
193  </tr>
194<tr>
195    <td width="15%" align="right" valign="top" class="summary">
196      <span class="summary-type">&nbsp;</span>
197    </td><td class="summary">
198      <table width="100%" cellpadding="0" cellspacing="0" border="0">
199        <tr>
200          <td><span class="summary-sig"><a href="echonest.support.midi.RawInstreamFile.RawInstreamFile-class.html#readBew" class="summary-sig-name">readBew</a>(<span class="summary-sig-arg">self</span>,
201        <span class="summary-sig-arg">n_bytes</span>=<span class="summary-sig-default">1</span>,
202        <span class="summary-sig-arg">move_cursor</span>=<span class="summary-sig-default">1</span>)</span><br />
203      Reads n bytes of date from the current cursor position.</td>
204          <td align="right" valign="top">
205            <span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.readBew">source&nbsp;code</a></span>
206            
207          </td>
208        </tr>
209      </table>
210      
211    </td>
212  </tr>
213<tr>
214    <td width="15%" align="right" valign="top" class="summary">
215      <span class="summary-type">&nbsp;</span>
216    </td><td class="summary">
217      <table width="100%" cellpadding="0" cellspacing="0" border="0">
218        <tr>
219          <td><span class="summary-sig"><a href="echonest.support.midi.RawInstreamFile.RawInstreamFile-class.html#readVarLen" class="summary-sig-name">readVarLen</a>(<span class="summary-sig-arg">self</span>)</span><br />
220      Reads a variable length value from the current cursor position.</td>
221          <td align="right" valign="top">
222            <span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.readVarLen">source&nbsp;code</a></span>
223            
224          </td>
225        </tr>
226      </table>
227      
228    </td>
229  </tr>
230</table>
231<!-- ==================== METHOD DETAILS ==================== -->
232<a name="section-MethodDetails"></a>
233<table class="details" border="1" cellpadding="3"
234       cellspacing="0" width="100%" bgcolor="white">
235<tr bgcolor="#70b0f0" class="table-header">
236  <td colspan="2" class="table-header">
237    <table border="0" cellpadding="0" cellspacing="0" width="100%">
238      <tr valign="top">
239        <td align="left"><span class="table-header">Method Details</span></td>
240        <td align="right" valign="top"
241         ><span class="options">[<a href="#section-MethodDetails"
242         class="privatelink" onclick="toggle_private();"
243         >hide private</a>]</span></td>
244      </tr>
245    </table>
246  </td>
247</tr>
248</table>
249<a name="__init__"></a>
250<div>
251<table class="details" border="1" cellpadding="3"
252       cellspacing="0" width="100%" bgcolor="white">
253<tr><td>
254  <table width="100%" cellpadding="0" cellspacing="0" border="0">
255  <tr valign="top"><td>
256  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
257        <span class="sig-arg">infile</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span>
258    <br /><em class="fname">(Constructor)</em>
259  </h3>
260  </td><td align="right" valign="top"
261    ><span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.__init__">source&nbsp;code</a></span>&nbsp;
262    </td>
263  </tr></table>
264  
265  If 'file' is a string we assume it is a path and read from
266that file.
267If it is a file descriptor we read from the file, but we don't
268close it.
269Midi files are usually pretty small, so it should be safe to
270copy them into memory.
271  <dl class="fields">
272  </dl>
273</td></tr></table>
274</div>
275<a name="readBew"></a>
276<div>
277<table class="details" border="1" cellpadding="3"
278       cellspacing="0" width="100%" bgcolor="white">
279<tr><td>
280  <table width="100%" cellpadding="0" cellspacing="0" border="0">
281  <tr valign="top"><td>
282  <h3 class="epydoc"><span class="sig"><span class="sig-name">readBew</span>(<span class="sig-arg">self</span>,
283        <span class="sig-arg">n_bytes</span>=<span class="sig-default">1</span>,
284        <span class="sig-arg">move_cursor</span>=<span class="sig-default">1</span>)</span>
285  </h3>
286  </td><td align="right" valign="top"
287    ><span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.readBew">source&nbsp;code</a></span>&nbsp;
288    </td>
289  </tr></table>
290  
291  Reads n bytes of date from the current cursor position.
292Moves cursor if move_cursor is true
293  <dl class="fields">
294  </dl>
295</td></tr></table>
296</div>
297<a name="readVarLen"></a>
298<div>
299<table class="details" border="1" cellpadding="3"
300       cellspacing="0" width="100%" bgcolor="white">
301<tr><td>
302  <table width="100%" cellpadding="0" cellspacing="0" border="0">
303  <tr valign="top"><td>
304  <h3 class="epydoc"><span class="sig"><span class="sig-name">readVarLen</span>(<span class="sig-arg">self</span>)</span>
305  </h3>
306  </td><td align="right" valign="top"
307    ><span class="codelink"><a href="echonest.support.midi.RawInstreamFile-pysrc.html#RawInstreamFile.readVarLen">source&nbsp;code</a></span>&nbsp;
308    </td>
309  </tr></table>
310  
311  Reads a variable length value from the current cursor position.
312Moves cursor if move_cursor is true
313  <dl class="fields">
314  </dl>
315</td></tr></table>
316</div>
317<br />
318<!-- ==================== NAVIGATION BAR ==================== -->
319<table class="navbar" border="0" width="100%" cellpadding="0"
320       bgcolor="#a0c0ff" cellspacing="0">
321  <tr valign="middle">
322
323  <!-- Tree link -->
324      <th>&nbsp;&nbsp;&nbsp;<a
325        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
326
327  <!-- Index link -->
328      <th>&nbsp;&nbsp;&nbsp;<a
329        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
330
331  <!-- Help link -->
332      <th>&nbsp;&nbsp;&nbsp;<a
333        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
334
335  <!-- Project homepage -->
336      <th class="navbar" align="right" width="100%">
337        <table border="0" cellpadding="0" cellspacing="0">
338          <tr><th class="navbar" align="center"
339            ><a class="navbar" target="_top" href="http://code.google.com/p/echo-nest-remix/">Project Homepage</a></th>
340          </tr></table></th>
341  </tr>
342</table>
343<table border="0" cellpadding="0" cellspacing="0" width="100%%">
344  <tr>
345    <td align="left" class="footer">
346    Generated by Epydoc 3.0.1 on Wed Sep  1 16:08:59 2010
347    </td>
348    <td align="right" class="footer">
349      <a target="mainFrame" href="http://epydoc.sourceforge.net"
350        >http://epydoc.sourceforge.net</a>
351    </td>
352  </tr>
353</table>
354
355<script type="text/javascript">
356  <!--
357  // Private objects are initially displayed (because if
358  // javascript is turned off then we want them to be
359  // visible); but by default, we want to hide them.  So hide
360  // them unless we have a cookie that says to show them.
361  checkCookie();
362  // -->
363</script>
364</body>
365</html>