]> git.parisson.com Git - timeside.git/commitdiff
add parent list iterating in pipe, fix odf results parents
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 31 Oct 2013 21:46:08 +0000 (22:46 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 31 Oct 2013 21:46:08 +0000 (22:46 +0100)
timeside/analyzer/odf.py
timeside/core.py

index f99a4a4ec619317369dc306101a96d9563b2cab9..161986a72b3b20487be501b7f8e1d5f98c079989 100644 (file)
@@ -40,11 +40,8 @@ class OnsetDetectionFunction(Analyzer):
         else:
             self.input_stepsize = blocksize / 2
 
-    @staticmethod
-    @interfacedoc
-    def parents(self):
-        return list(Spectrogram(blocksize=self.input_blocksize,
-                                stepsize=self.input_stepsize))
+        self.parents.append(Spectrogram(blocksize=self.input_blocksize,
+                                        stepsize=self.input_stepsize))
 
     @interfacedoc
     def setup(self, channels=None, samplerate=None,
@@ -73,7 +70,7 @@ class OnsetDetectionFunction(Analyzer):
     def post_process(self):
 
         #spectrogram = self.parents()[0]['spectrogram_analyzer'].data
-        spectrogram = self.pipe._results['spectrogram_analyzer'].data
+        spectrogram = self.pipe.results['spectrogram_analyzer'].data
         #spectrogram = self.pipe._results[self.parents()[0].id]
 
         # Low-pass filtering of the spectrogram amplitude along the time axis
index 254622ae489eb3779f07a3679f1193291fbd2456..c82ea46565d9b28d84fbe0eab2a0f4311229fe8f 100644 (file)
@@ -84,10 +84,6 @@ class Processor(Component):
         self.pipe = None
         self._uuid = "%08x" % random.getrandbits(32)
 
-    interfacedoc
-    def parents(self):
-        pass
-
     @interfacedoc
     def setup(self, channels=None, samplerate=None, blocksize=None,
               totalframes=None):
@@ -255,8 +251,10 @@ class ProcessPipe(object):
 
     def __ior__(self, other):
         if isinstance(other, Processor):
-            self |= other.parents
-            print self
+            parents = other.parents
+            if parents:
+                for parent in parents:
+                    self |= parent
             self.processors.append(other)
         elif isinstance(other, ProcessPipe):
             self.processors.extend(other.processors)