+ @staticmethod
+ def getSongTitle(file) :
+ if os.path.exists(file) :
+ it = ElementTree.iterparse(file, ['start', 'end'])
+ creditFound = False
+
+ for evt, el in it :
+ if el.tag == 'credit' :
+ creditFound = True
+ if el.tag == 'credit-words' and creditFound:
+ return el.text
+ if el.tag == 'part-list' :
+ # plus de chance de trouver un titre
+ return os.path.basename(file)
+ else :
+ return os.path.basename(file)
+
+ def _toTimeDelta(self, milliseconds) :
+ duration = milliseconds / 1000.
+ duration = int(round(duration, 0))
+ return str(timedelta(seconds=duration))
+