예제 #1
0
 def next_track(self):
     if self.cur_time > self.time:
         return None
     else:
         track = self.source.next_track()
         if track:
             duration = tlib.get_attr(track, 'duration')
             self.cur_time += duration
         return track
예제 #2
0
 def next_track(self):
     track = self.source.next_track()
     if track:
         print self.which, tlib.get_tn(track)
         if len(self.props) > 0:
             for prop in self.props:
                 val = tlib.get_attr(track, prop)
                 if val != None:
                     print '   ', prop, '->', val
         self.which += 1
     return track
예제 #3
0
 def next_track(self):
     while self.filling:    
         track = self.annotator.next_track()
         if track and (self.max_size == 0 or len(self.buffer) < self.max_size):
             self.buffer.append(track)
         else:
             self.filling = False
             self.buffer.sort(reverse=self.reverse, key=lambda tid: tlib.get_attr(tid, self.attr))
     if len(self.buffer) > 0:
         return self.buffer.pop(0)
     else:
         return None
예제 #4
0
 def next_track(self):
     while True:
         good = True
         track = self.annotator.next_track()
         if track:
             attr_val = tlib.get_attr(track, self.attr)
             if attr_val == None:
                 good = False
             elif self.match != None and attr_val != self.match:
                 good = False
             else:
                 if self.min_val and attr_val < self.min_val:
                     good = False
                 if self.max_val and attr_val > self.max_val:
                     good = False
         if good:
             break
     return track