def scan(self): print "Start scanning SmallMediumFileCollection "+self.collectionroot found_tracks = [] extentions = ["mp3", "flac"] for (path, dir, files) in os.walk(self.collectionroot): for mfile in files: if mfile.split(".")[-1] in extentions: filename = path+"/"+mfile try: t = Track.loadFromFile(filename) found_tracks.append(t) except: print "Could not open file for ID3 %s" % filename self._tracks = found_tracks self.writetofile() self.sortTracks() return
def queue_track(self, filename): track = Track.loadFromFile(filename) self.queue.addToQueue(track)
def set_track(self, filename): track = Track.loadFromFile(filename) self.player.changeTrack(track)