Changeset - c81f86f3d65a
[Not reviewed]
default
0 3 0
Drew Perttula - 6 years ago 2019-06-02 11:37:14
drewp@bigasterisk.com
effecteval is mostly obsolete, but now it can at least show a list of effects used in a song (which seq can too)
Ignore-this: c24e4c1c3ccd839e79b1b2fb19ee996a
3 files changed with 20 insertions and 13 deletions:
0 comments (0 inline, 0 general)
bin/effecteval
Show inline comments
 
@@ -7,8 +7,6 @@ import cyclone.web, cyclone.websocket, c
 
import sys, optparse, logging, json, itertools
 
from rdflib import URIRef, Literal
 

	
 
sys.path.append('/usr/lib/pymodules/python2.7/')  # for numpy, on rpi
 
sys.path.append('/usr/lib/python2.7/dist-packages')  # For numpy
 
from light9 import networking, showconfig
 
from light9.effecteval.effect import EffectNode
 
from light9.effect.edit import getMusicStatus, songNotePatch
 
@@ -103,11 +101,20 @@ class SongEffectsUpdates(cyclone.websock
 
        songs = list(self.graph.items(playlist))
 
        out = []
 
        for s in songs:
 
            out.append({'uri': s, 'label': self.graph.label(s)})
 
            out[-1]['effects'] = [{
 
                'uri': uri,
 
                'label': self.graph.label(uri)
 
            } for uri in sorted(self.graph.objects(s, L9['effect']))]
 
            out.append({'uri': s, 'label': self.graph.label(s), 'effects': []})
 
            seen = set()
 
            for n in self.graph.objects(s, L9['note']):
 
                for uri in self.graph.objects(n, L9['effectClass']):
 
                    if uri in seen:
 
                        continue
 
                    seen.add(uri)
 
                    out[-1]['effects'].append({
 
                        'uri': uri,
 
                        'label': self.graph.label(uri)
 
                    })
 
            out[-1]['effects'].sort(key=lambda e: e['uri'])
 
                    
 
                    
 
        self.sendMessage({'songs': out})
 

	
 

	
light9/effecteval/effect-components.html
Show inline comments
 
@@ -16,9 +16,10 @@
 
                         label="{{effect.label}}"></l9-effect>
 
            </li>
 
          </template>
 
          <li>
 
            <effect-drop-target song-uri="{{song.uri}}"></effect-drop-target>
 
          </li>
 
       <!--    <li>
 
          <effect-drop-target song-uri="{{song.uri}}"></effect-drop-target>
 
      </li>
 
      -->
 
        </ul>
 
      </li>
 
    </template>
 
@@ -52,7 +53,7 @@
 
<dom-module id="l9-effect">
 
  <template>
 
    <a class="effect" href="{{href}}">{{label}}</a>
 
    <button on-click="deleteEffect">Delete</button>
 
    
 
  </template>
 
</dom-module>
 
<script>
light9/effecteval/index.html
Show inline comments
 
@@ -8,8 +8,7 @@
 
  </head>
 
  <body>
 
    <div id="status">starting...</div>
 
    <div><a href="stats">/stats</a></div>
 
    <h1>Effect instances</h1>
 
    <h1>Effect instances <a href="stats/">[stats]</a></h1>
 
    <div><a href=".">View all songs</a></div>
 
    <!-- subscribe to a query of all effects and their songs -->
 
    <song-effect-list></song-effect-list>
0 comments (0 inline, 0 general)