]> git.parisson.com Git - timeside.git/commitdiff
modify parent immplementation, unstable
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 31 Oct 2013 21:30:58 +0000 (22:30 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 31 Oct 2013 21:30:58 +0000 (22:30 +0100)
timeside/analyzer/odf.py
timeside/api.py
timeside/core.py

index 06c91ae490f13b8ed7647444f0f18606729f5a6a..f99a4a4ec619317369dc306101a96d9563b2cab9 100644 (file)
@@ -40,8 +40,11 @@ class OnsetDetectionFunction(Analyzer):
         else:
             self.input_stepsize = blocksize / 2
 
-        self.parents.append(Spectrogram(blocksize=self.input_blocksize,
-                            stepsize=self.input_stepsize))
+    @staticmethod
+    @interfacedoc
+    def parents(self):
+        return list(Spectrogram(blocksize=self.input_blocksize,
+                                stepsize=self.input_stepsize))
 
     @interfacedoc
     def setup(self, channels=None, samplerate=None,
index b6eeb787a9e4aa23ce020900e4f2ff889c7540ae..17d6e38e8709a4d63c6c2cb0e049d8aa43689537 100644 (file)
@@ -100,6 +100,10 @@ class IProcessor(Interface):
     def uuid():
         """Return the UUID of the processor"""
 
+    @staticmethod
+    def parents(self):
+        """Return the parent processor list of the processor"""
+
 
 class IEncoder(IProcessor):
     """Encoder driver interface. Each encoder is expected to support a specific
index b88bcea04fb40d22ddfef767de7ffd76aa827562..254622ae489eb3779f07a3679f1193291fbd2456 100644 (file)
@@ -82,7 +82,11 @@ class Processor(Component):
         self.parents = []
         self.source_mediainfo = None
         self.pipe = None
-        self.UUID = "%08x" % random.getrandbits(32)
+        self._uuid = "%08x" % random.getrandbits(32)
+
+    interfacedoc
+    def parents(self):
+        pass
 
     @interfacedoc
     def setup(self, channels=None, samplerate=None, blocksize=None,
@@ -103,7 +107,6 @@ class Processor(Component):
         if not hasattr(self, 'input_stepsize'):
             self.input_stepsize = self.source_blocksize
 
-
     # default channels(), samplerate() and blocksize() implementations returns
     # the source characteristics, but processors may change this behaviour by
     # overloading those methods
@@ -141,7 +144,7 @@ class Processor(Component):
 
     @interfacedoc
     def uuid(self):
-        return self.UUID
+        return self._uuid
 
     def __del__(self):
         self.release()
@@ -253,6 +256,7 @@ class ProcessPipe(object):
     def __ior__(self, other):
         if isinstance(other, Processor):
             self |= other.parents
+            print self
             self.processors.append(other)
         elif isinstance(other, ProcessPipe):
             self.processors.extend(other.processors)