PageRenderTime 1765ms CodeModel.GetById 147ms app.highlight 1460ms RepoModel.GetById 138ms app.codeStats 2ms

/apidocs/echonest.video-pysrc.html

http://echo-nest-remix.googlecode.com/
HTML | 617 lines | 586 code | 10 blank | 21 comment | 0 complexity | 93d4bd238b99b98d95b42a8d23cc0558 MD5 | raw file

Large files files are truncated, but you can click here to view the full 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.video</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        Module&nbsp;video
 44      </span>
 45    </td>
 46    <td>
 47      <table cellpadding="0" cellspacing="0">
 48        <!-- hide/show private -->
 49        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
 50    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
 51        <tr><td align="right"><span class="options"
 52            >[<a href="frames.html" target="_top">frames</a
 53            >]&nbsp;|&nbsp;<a href="echonest.video-pysrc.html"
 54            target="_top">no&nbsp;frames</a>]</span></td></tr>
 55      </table>
 56    </td>
 57  </tr>
 58</table>
 59<h1 class="epydoc">Source Code for <a href="echonest.video-module.html">Module echonest.video</a></h1>
 60<pre class="py-src">
 61<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/env python</tt> </tt>
 62<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"># encoding: utf=8</tt> </tt>
 63<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
 64<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">video.py</tt> </tt>
 65<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
 66<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-docstring">Framework that turns video into silly putty.</tt> </tt>
 67<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
 68<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-docstring">Created by Robert Ochshorn on 2008-5-30.</tt> </tt>
 69<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-docstring">Refactored by Ben Lacker on 2009-6-18.</tt> </tt>
 70<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-docstring">Copyright (c) 2008 The Echo Nest Corporation. All rights reserved.</tt> </tt>
 71<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
 72<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">numpy</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
 73<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
 74<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">re</tt> </tt>
 75<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">shutil</tt> </tt>
 76<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">subprocess</tt> </tt>
 77<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sys</tt> </tt>
 78<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">tempfile</tt> </tt>
 79<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"> </tt>
 80<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package echonest=echonest-module.html"><a title="echonest" class="py-name" href="#" onclick="return doclink('link-0', 'echonest', 'link-0');">echonest</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Module echonest.audio=echonest.audio-module.html,Variable pyechonest.artist.Artist.audio=pyechonest.artist.Artist-class.html#audio"><a title="echonest.audio
 81pyechonest.artist.Artist.audio" class="py-name" href="#" onclick="return doclink('link-1', 'audio', 'link-1');">audio</a></tt> </tt>
 82<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Package pyechonest=pyechonest-module.html"><a title="pyechonest" class="py-name" href="#" onclick="return doclink('link-2', 'pyechonest', 'link-2');">pyechonest</a></tt> <tt class="py-keyword">import</tt> <tt id="link-3" class="py-name" targets="Module pyechonest.config=pyechonest.config-module.html"><a title="pyechonest.config" class="py-name" href="#" onclick="return doclink('link-3', 'config', 'link-3');">config</a></tt> </tt>
 83<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"> </tt>
 84<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"> </tt>
 85<a name="ImageSequence"></a><div id="ImageSequence-def"><a name="L24"></a><tt class="py-lineno"> 24</tt> <a class="py-toggle" href="#" id="ImageSequence-toggle" onclick="return toggle('ImageSequence');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html">ImageSequence</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
 86</div><div id="ImageSequence-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ImageSequence-expanded"><a name="ImageSequence.__init__"></a><div id="ImageSequence.__init__-def"><a name="L25"></a><tt class="py-lineno"> 25</tt> <a class="py-toggle" href="#" id="ImageSequence.__init__-toggle" onclick="return toggle('ImageSequence.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">sequence</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">settings</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
 87</div><div id="ImageSequence.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.__init__-expanded"><a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">        <tt class="py-docstring">"builds sequence from a filelist, or another ImageSequence object"</tt> </tt>
 88<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt id="link-4" class="py-name" targets="Class echonest.video.VideoSettings=echonest.video.VideoSettings-class.html"><a title="echonest.video.VideoSettings" class="py-name" href="#" onclick="return doclink('link-4', 'VideoSettings', 'link-4');">VideoSettings</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
 89<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">sequence</tt><tt class="py-op">,</tt> <tt id="link-5" class="py-name" targets="Class echonest.video.ImageSequence=echonest.video.ImageSequence-class.html"><a title="echonest.video.ImageSequence" class="py-name" href="#" onclick="return doclink('link-5', 'ImageSequence', 'link-5');">ImageSequence</a></tt><tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-name">issubclass</tt><tt class="py-op">(</tt><tt class="py-name">sequence</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name"><a title="echonest.video.ImageSequence" class="py-name" href="#" onclick="return doclink('link-6', 'ImageSequence', 'link-5');">ImageSequence</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment">#from ImageSequence</tt> </tt>
 90<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line">           <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt> <tt class="py-op">=</tt> <tt class="py-name">sequence</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">,</tt> <tt class="py-name">sequence</tt><tt class="py-op">.</tt><tt class="py-name">files</tt> </tt>
 91<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">sequence</tt><tt class="py-op">,</tt> <tt class="py-name">list</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment">#from filelist</tt> </tt>
 92<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt> <tt class="py-op">=</tt> <tt class="py-name">sequence</tt> </tt>
 93<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">settings</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
 94<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt> <tt class="py-op">=</tt> <tt class="py-name">settings</tt> </tt>
 95<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method echonest.video.ImageSequence._init()=echonest.video.ImageSequence-class.html#_init"><a title="echonest.video.ImageSequence._init" class="py-name" href="#" onclick="return doclink('link-7', '_init', 'link-7');">_init</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
 96</div><a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"> </tt>
 97<a name="ImageSequence._init"></a><div id="ImageSequence._init-def"><a name="L36"></a><tt class="py-lineno"> 36</tt> <a class="py-toggle" href="#" id="ImageSequence._init-toggle" onclick="return toggle('ImageSequence._init');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#_init">_init</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
 98</div><div id="ImageSequence._init-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence._init-expanded"><a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-docstring">"extra init settings/options (can override...)"</tt> </tt>
 99<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> </tt>
100</div><a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">         </tt>
101<a name="ImageSequence.__len__"></a><div id="ImageSequence.__len__-def"><a name="L40"></a><tt class="py-lineno"> 40</tt> <a class="py-toggle" href="#" id="ImageSequence.__len__-toggle" onclick="return toggle('ImageSequence.__len__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#__len__">__len__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
102</div><div id="ImageSequence.__len__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.__len__-expanded"><a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">        <tt class="py-docstring">"how many frames are in this sequence?"</tt> </tt>
103<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt><tt class="py-op">)</tt> </tt>
104</div><a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"> </tt>
105<a name="ImageSequence.__getitem__"></a><div id="ImageSequence.__getitem__-def"><a name="L44"></a><tt class="py-lineno"> 44</tt> <a class="py-toggle" href="#" id="ImageSequence.__getitem__-toggle" onclick="return toggle('ImageSequence.__getitem__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#__getitem__">__getitem__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
106</div><div id="ImageSequence.__getitem__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.__getitem__-expanded"><a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">        <tt class="py-name">index</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method echonest.video.ImageSequence.indexvoodo()=echonest.video.ImageSequence-class.html#indexvoodo"><a title="echonest.video.ImageSequence.indexvoodo" class="py-name" href="#" onclick="return doclink('link-8', 'indexvoodo', 'link-8');">indexvoodo</a></tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">)</tt> </tt>
107<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">,</tt> <tt class="py-name">slice</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
108<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method echonest.audio.AudioData.getslice()=echonest.audio.AudioData-class.html#getslice,Method echonest.video.ImageSequence.getslice()=echonest.video.ImageSequence-class.html#getslice,Method echonest.video.SynchronizedAV.getslice()=echonest.video.SynchronizedAV-class.html#getslice"><a title="echonest.audio.AudioData.getslice
109echonest.video.ImageSequence.getslice
110echonest.video.SynchronizedAV.getslice" class="py-name" href="#" onclick="return doclink('link-9', 'getslice', 'link-9');">getslice</a></tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">)</tt> </tt>
111<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
112<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">"must provide an argument of type 'slice'"</tt><tt class="py-op">)</tt> </tt>
113</div><a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"> </tt>
114<a name="ImageSequence.getslice"></a><div id="ImageSequence.getslice-def"><a name="L51"></a><tt class="py-lineno"> 51</tt> <a class="py-toggle" href="#" id="ImageSequence.getslice-toggle" onclick="return toggle('ImageSequence.getslice');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#getslice">getslice</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
115</div><div id="ImageSequence.getslice-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.getslice-expanded"><a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">        <tt class="py-docstring">"returns a slice of the frames as a new instance"</tt> </tt>
116<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Variable echonest.audio.AudioQuantumList.start=echonest.audio.AudioQuantumList-class.html#start"><a title="echonest.audio.AudioQuantumList.start" class="py-name" href="#" onclick="return doclink('link-10', 'start', 'link-10');">start</a></tt><tt class="py-op">,</tt> <tt class="py-name">float</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
117<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">            <tt class="py-name">index</tt> <tt class="py-op">=</tt> <tt class="py-name">slice</tt><tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="echonest.audio.AudioQuantumList.start" class="py-name" href="#" onclick="return doclink('link-11', 'start', 'link-10');">start</a></tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">.</tt><tt class="py-name">fps</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt class="py-name">stop</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">.</tt><tt class="py-name">fps</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">index</tt><tt class="py-op">.</tt><tt class="py-name">step</tt><tt class="py-op">)</tt> </tt>
118<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt><tt class="py-op">[</tt><tt class="py-name">index</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">)</tt> </tt>
119</div><a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line"> </tt>
120<a name="ImageSequence.indexvoodo"></a><div id="ImageSequence.indexvoodo-def"><a name="L57"></a><tt class="py-lineno"> 57</tt> <a class="py-toggle" href="#" id="ImageSequence.indexvoodo-toggle" onclick="return toggle('ImageSequence.indexvoodo');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#indexvoodo">indexvoodo</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
121</div><div id="ImageSequence.indexvoodo-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.indexvoodo-expanded"><a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-docstring">"converts index to frame from a variety of forms"</tt> </tt>
122<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">,</tt> <tt class="py-name">float</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
123<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">*</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">.</tt><tt class="py-name">fps</tt><tt class="py-op">)</tt> </tt>
124<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method echonest.video.ImageSequence._indexvoodoo()=echonest.video.ImageSequence-class.html#_indexvoodoo"><a title="echonest.video.ImageSequence._indexvoodoo" class="py-name" href="#" onclick="return doclink('link-12', '_indexvoodoo', 'link-12');">_indexvoodoo</a></tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">)</tt> </tt>
125</div><a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"> </tt>
126<a name="ImageSequence._indexvoodoo"></a><div id="ImageSequence._indexvoodoo-def"><a name="L63"></a><tt class="py-lineno"> 63</tt> <a class="py-toggle" href="#" id="ImageSequence._indexvoodoo-toggle" onclick="return toggle('ImageSequence._indexvoodoo');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#_indexvoodoo">_indexvoodoo</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
127</div><div id="ImageSequence._indexvoodoo-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence._indexvoodoo-expanded"><a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">        <tt class="py-comment">#obj to slice</tt> </tt>
128<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">,</tt> <tt class="py-name">slice</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">,</tt> <tt class="py-string">"start"</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">,</tt> <tt class="py-string">"duration"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
129<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">            <tt class="py-name">sl</tt> <tt class="py-op">=</tt>  <tt class="py-name">slice</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="echonest.audio.AudioQuantumList.start" class="py-name" href="#" onclick="return doclink('link-13', 'start', 'link-10');">start</a></tt><tt class="py-op">,</tt> <tt class="py-name">index</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="echonest.audio.AudioQuantumList.start" class="py-name" href="#" onclick="return doclink('link-14', 'start', 'link-10');">start</a></tt><tt class="py-op">+</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Variable echonest.audio.AudioData.duration=echonest.audio.AudioData-class.html#duration,Variable echonest.audio.AudioQuantumList.duration=echonest.audio.AudioQuantumList-class.html#duration,Variable echonest.audio.LocalAudioFile.duration=echonest.audio.LocalAudioFile-class.html#duration,Variable echonest.audio.ModifiedRenderable.duration=echonest.audio.ModifiedRenderable-class.html#duration,Variable echonest.audio.Simultaneous.duration=echonest.audio.Simultaneous-class.html#duration,Method echonest.audio.TimeTruncateFactor.duration()=echonest.audio.TimeTruncateFactor-class.html#duration,Method echonest.audio.TimeTruncateLength.duration()=echonest.audio.TimeTruncateLength-class.html#duration,Function echonest.sorting.duration()=echonest.sorting-module.html#duration,Method echonest.video.ImageSequence.duration()=echonest.video.ImageSequence-class.html#duration"><a title="echonest.audio.AudioData.duration
130echonest.audio.AudioQuantumList.duration
131echonest.audio.LocalAudioFile.duration
132echonest.audio.ModifiedRenderable.duration
133echonest.audio.Simultaneous.duration
134echonest.audio.TimeTruncateFactor.duration
135echonest.audio.TimeTruncateLength.duration
136echonest.sorting.duration
137echonest.video.ImageSequence.duration" class="py-name" href="#" onclick="return doclink('link-15', 'duration', 'link-15');">duration</a></tt><tt class="py-op">)</tt> </tt>
138<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">sl</tt> </tt>
139<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">        <tt class="py-comment">#slice of objs: return slice(start.start, start.end.start+start.end.duration)</tt> </tt>
140<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">,</tt> <tt class="py-name">slice</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
141<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="echonest.audio.AudioQuantumList.start" class="py-name" href="#" onclick="return doclink('link-16', 'start', 'link-10');">start</a></tt><tt class="py-op">,</tt> <tt class="py-string">"start"</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt class="py-name">stop</tt><tt class="py-op">,</tt> <tt class="py-string">"duration"</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt class="py-name">stop</tt><tt class="py-op">,</tt> <tt class="py-string">"start"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
142<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">                <tt class="py-name">sl</tt> <tt class="py-op">=</tt> <tt class="py-name">slice</tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name"><a title="echonest.audio.AudioQuantumList.start" class="py-name" href="#" onclick="return doclink('link-17', 'start', 'link-10');">start</a></tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="echonest.audio.AudioQuantumList.start" class="py-name" href="#" onclick="return doclink('link-18', 'start', 'link-10');">start</a></tt><tt class="py-op">,</tt> <tt class="py-name">index</tt><tt class="py-op">.</tt><tt class="py-name">stop</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="echonest.audio.AudioQuantumList.start" class="py-name" href="#" onclick="return doclink('link-19', 'start', 'link-10');">start</a></tt><tt class="py-op">+</tt><tt class="py-name">index</tt><tt class="py-op">.</tt><tt class="py-name">stop</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="echonest.audio.AudioData.duration
143echonest.audio.AudioQuantumList.duration
144echonest.audio.LocalAudioFile.duration
145echonest.audio.ModifiedRenderable.duration
146echonest.audio.Simultaneous.duration
147echonest.audio.TimeTruncateFactor.duration
148echonest.audio.TimeTruncateLength.duration
149echonest.sorting.duration
150echonest.video.ImageSequence.duration" class="py-name" href="#" onclick="return doclink('link-20', 'duration', 'link-15');">duration</a></tt><tt class="py-op">)</tt> </tt>
151<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-name">sl</tt> </tt>
152<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">index</tt> </tt>
153</div><a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"> </tt>
154<a name="ImageSequence.__add__"></a><div id="ImageSequence.__add__-def"><a name="L75"></a><tt class="py-lineno"> 75</tt> <a class="py-toggle" href="#" id="ImageSequence.__add__-toggle" onclick="return toggle('ImageSequence.__add__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#__add__">__add__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">imseq2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
155</div><div id="ImageSequence.__add__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.__add__-expanded"><a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt class="py-docstring">"""returns an ImageSequence with the second seq appended to this</tt> </tt>
156<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-docstring">        one. uses settings of the self."""</tt> </tt>
157<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name" targets="Method echonest.action.Blend.render()=echonest.action.Blend-class.html#render,Method echonest.action.Crossfade.render()=echonest.action.Crossfade-class.html#render,Method echonest.action.Crossmatch.render()=echonest.action.Crossmatch-class.html#render,Method echonest.action.Fadein.render()=echonest.action.Fadein-class.html#render,Method echonest.action.Fadeout.render()=echonest.action.Fadeout-class.html#render,Method echonest.action.Playback.render()=echonest.action.Playback-class.html#render,Function echonest.action.render()=echonest.action-module.html#render,Method echonest.audio.AudioData.render()=echonest.audio.AudioData-class.html#render,Method echonest.audio.AudioQuantum.render()=echonest.audio.AudioQuantum-class.html#render,Method echonest.audio.AudioQuantumList.render()=echonest.audio.AudioQuantumList-class.html#render,Method echonest.audio.ModifiedRenderable.render()=echonest.audio.ModifiedRenderable-class.html#render,Method echonest.audio.Simultaneous.render()=echonest.audio.Simultaneous-class.html#render,Method echonest.video.ImageSequence.render()=echonest.video.ImageSequence-class.html#render"><a title="echonest.action.Blend.render
158echonest.action.Crossfade.render
159echonest.action.Crossmatch.render
160echonest.action.Fadein.render
161echonest.action.Fadeout.render
162echonest.action.Playback.render
163echonest.action.render
164echonest.audio.AudioData.render
165echonest.audio.AudioQuantum.render
166echonest.audio.AudioQuantumList.render
167echonest.audio.ModifiedRenderable.render
168echonest.audio.Simultaneous.render
169echonest.video.ImageSequence.render" class="py-name" href="#" onclick="return doclink('link-21', 'render', 'link-21');">render</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
170<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-name">imseq2</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="echonest.action.Blend.render
171echonest.action.Crossfade.render
172echonest.action.Crossmatch.render
173echonest.action.Fadein.render
174echonest.action.Fadeout.render
175echonest.action.Playback.render
176echonest.action.render
177echonest.audio.AudioData.render
178echonest.audio.AudioQuantum.render
179echonest.audio.AudioQuantumList.render
180echonest.audio.ModifiedRenderable.render
181echonest.audio.Simultaneous.render
182echonest.video.ImageSequence.render" class="py-name" href="#" onclick="return doclink('link-22', 'render', 'link-21');">render</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-comment">#todo: should the render be applied here? is it destructive? can it render in the new sequence?</tt> </tt>
183<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt> <tt class="py-op">+</tt> <tt class="py-name">imseq2</tt><tt class="py-op">.</tt><tt class="py-name">files</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">)</tt> </tt>
184</div><a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"> </tt>
185<a name="ImageSequence.duration"></a><div id="ImageSequence.duration-def"><a name="L82"></a><tt class="py-lineno"> 82</tt> <a class="py-toggle" href="#" id="ImageSequence.duration-toggle" onclick="return toggle('ImageSequence.duration');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#duration">duration</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
186</div><div id="ImageSequence.duration-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.duration-expanded"><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">        <tt class="py-docstring">"duration of a clip in seconds"</tt> </tt>
187<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">.</tt><tt class="py-name">fps</tt><tt class="py-op">)</tt> </tt>
188</div><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line"> </tt>
189<a name="ImageSequence.frametoim"></a><div id="ImageSequence.frametoim-def"><a name="L86"></a><tt class="py-lineno"> 86</tt> <a class="py-toggle" href="#" id="ImageSequence.frametoim-toggle" onclick="return toggle('ImageSequence.frametoim');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#frametoim">frametoim</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
190</div><div id="ImageSequence.frametoim-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.frametoim-expanded"><a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">        <tt class="py-docstring">"return a PIL image"</tt> </tt>
191<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Method echonest.audio.AudioData.__getitem__()=echonest.audio.AudioData-class.html#__getitem__,Method echonest.video.ImageSequence.__getitem__()=echonest.video.ImageSequence-class.html#__getitem__,Method echonest.video.SynchronizedAV.__getitem__()=echonest.video.SynchronizedAV-class.html#__getitem__"><a title="echonest.audio.AudioData.__getitem__
192echonest.video.ImageSequence.__getitem__
193echonest.video.SynchronizedAV.__getitem__" class="py-name" href="#" onclick="return doclink('link-23', '__getitem__', 'link-23');">__getitem__</a></tt><tt class="py-op">(</tt><tt class="py-name">index</tt><tt class="py-op">)</tt> </tt>
194</div><a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"> </tt>
195<a name="ImageSequence.renderframe"></a><div id="ImageSequence.renderframe-def"><a name="L90"></a><tt class="py-lineno"> 90</tt> <a class="py-toggle" href="#" id="ImageSequence.renderframe-toggle" onclick="return toggle('ImageSequence.renderframe');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#renderframe">renderframe</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">index</tt><tt class="py-op">,</tt> <tt class="py-param">dest</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">replacefileinseq</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
196</div><div id="ImageSequence.renderframe-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.renderframe-expanded"><a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">        <tt class="py-docstring">"renders frame to destination directory. can update sequence with rendered image (default)"</tt> </tt>
197<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">dest</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
198<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">            <tt class="py-comment">#handle, dest = tempfile.mkstemp()</tt> </tt>
199<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">            <tt class="py-name">dest</tt> <tt class="py-op">=</tt> <tt class="py-name">tempfile</tt><tt class="py-op">.</tt><tt class="py-name">NamedTemporaryFile</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> </tt>
200<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt class="py-comment">#copy file without loading</tt> </tt>
201<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt class="py-name">shutil</tt><tt class="py-op">.</tt><tt class="py-name">copyfile</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt><tt class="py-op">[</tt><tt class="py-name">index</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">)</tt> </tt>
202<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt class="py-comment">#symlink file...</tt> </tt>
203<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-comment">#os.symlink(self.files[index], dest)</tt> </tt>
204<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">replacefileinseq</tt><tt class="py-op">:</tt> </tt>
205<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt><tt class="py-op">[</tt><tt class="py-name">index</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">dest</tt> </tt>
206</div><a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">         </tt>
207<a name="ImageSequence.render"></a><div id="ImageSequence.render-def"><a name="L102"></a><tt class="py-lineno">102</tt> <a class="py-toggle" href="#" id="ImageSequence.render-toggle" onclick="return toggle('ImageSequence.render');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.ImageSequence-class.html#render">render</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">direc</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">pre</tt><tt class="py-op">=</tt><tt class="py-string">"image"</tt><tt class="py-op">,</tt> <tt class="py-param">replacefiles</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
208</div><div id="ImageSequence.render-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="ImageSequence.render-expanded"><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">        <tt class="py-docstring">"renders sequence to stills. can update sequence with rendered images (default)"</tt> </tt>
209<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">direc</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt>  </tt>
210<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">            <tt class="py-comment">#nothing to render...</tt> </tt>
211<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
212<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-name">dest</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
213<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">xrange</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">files</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
214<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">direc</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
215<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">                <tt class="py-name">dest</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">direc</tt><tt class="py-op">,</tt> <tt class="py-name">pre</tt><tt class="py-op">+</tt><tt class="py-string">'%(#)06d.'</tt> <tt class="py-op">%</tt> <tt class="py-op">{</tt><tt class="py-string">'#'</tt><tt class="py-op">:</tt><tt class="py-name">i</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name" targets="Method echonest.video.VideoSettings.imageformat()=echonest.video.VideoSettings-class.html#imageformat"><a title="echonest.video.VideoSettings.imageformat" class="py-name" href="#" onclick="return doclink('link-24', 'imageformat', 'link-24');">imageformat</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
216<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method echonest.video.ImageSequence.renderframe()=echonest.video.ImageSequence-class.html#renderframe"><a title="echonest.video.ImageSequence.renderframe" class="py-name" href="#" onclick="return doclink('link-25', 'renderframe', 'link-25');">renderframe</a></tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">,</tt> <tt class="py-name">dest</tt><tt class="py-op">,</tt> <tt class="py-name">replacefiles</tt><tt class="py-op">)</tt> </tt>
217</div></div><a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"> </tt>
218<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"> </tt>
219<a name="EditableFrames"></a><div id="EditableFrames-def"><a name="L114"></a><tt class="py-lineno">114</tt> <a class="py-toggle" href="#" id="EditableFrames-toggle" onclick="return toggle('EditableFrames');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="echonest.video.EditableFrames-class.html">EditableFrames</a><tt class="py-op">(</tt><tt class="py-base-class">ImageSequence</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
220</div><div id="EditableFrames-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="EditableFrames-expanded"><a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">    <tt class="py-docstring">"Collection of frames that can be easily edited"</tt> </tt>
221<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"> </tt>
222<a name="EditableFrames.fadein"></a><div id="EditableFrames.fadein-def"><a name="L117"></a><tt class="py-lineno">117</tt> <a class="py-toggle" href="#" id="EditableFrames.fadein-toggle" onclick="return toggle('EditableFrames.fadein');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.EditableFrames-class.html#fadein">fadein</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">frames</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
223</div><div id="EditableFrames.fadein-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EditableFrames.fadein-expanded"><a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-docstring">"linear fade in"</tt> </tt>
224<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">xrange</tt><tt class="py-op">(</tt><tt class="py-name">frames</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
225<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">*=</tt> <tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">frames</tt><tt class="py-op">)</tt> <tt class="py-comment">#todo: can i do this without floats?</tt> </tt>
226</div><a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"> </tt>
227<a name="EditableFrames.fadeout"></a><div id="EditableFrames.fadeout-def"><a name="L122"></a><tt class="py-lineno">122</tt> <a class="py-toggle" href="#" id="EditableFrames.fadeout-toggle" onclick="return toggle('EditableFrames.fadeout');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="echonest.video.EditableFrames-class.html#fadeout">fadeout</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">frames</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
228</div><div id="EditableFrames.fadeout-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EditableFrames.fadeout-expanded"><a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">        <tt class="py-docstring">"linear fade out"</tt> </tt>
229<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">xrange</tt><tt class="py-op">(</tt><tt class="py-name">frames</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
230<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt class="py-name">i</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">*=</tt> <tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">frames</tt><tt class="py-op">)</tt> </tt>
231</div></div><a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"> </tt>
232<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"> </tt>
233<a name="VideoSettings"></a><div id="VideoSettings-def"><a name="L128"></a><tt class="py-lineno">128</tt> <a class="py-toggle" href="#" id="VideoSettings-toggle" onclick="return toggle('VideoSettings');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="echonest.video.VideoSettings-class.html">VideoSettings</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
234</div><div id="VideoSettings-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="VideoSettings-expanded"><a name="L129"></a><tt class="py-lineno…

Large files files are truncated, but you can click here to view the full file