def SaveChange(self,*args): if self.timeChange <> 0: lrc = lrcMod.writeLrc(self.lrcLines,self.timeLines,self.timeChange) art = self.exaile.player.current.get_tag_display('artist') tit = self.exaile.player.current.get_tag_display('title') locname = self.exaile.player.current.local_file_name() lrcMod.saveLrc(lrc,self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname))
def lrcList(self, *arg): searchlist = chooser.lrcSearchWin() result = searchlist.run(self.exaile.player.current.get_tag_display('artist'), self.exaile.player.current.get_tag_display('title')) if result: self.lyric = result art = self.exaile.player.current.get_tag_display('artist') tit = self.exaile.player.current.get_tag_display('title') locname = os.path.basename(self.exaile.player.current.local_file_name()) lrcMod.saveLrc(self.lyric,self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname)) (self.lrcLines,self.timeLines) = lrcMod.lrcAny(self.lyric) self.timeChange = 0 try: for i in self.labels.keys(): self.labels[i].destroy() except: pass self.labels={} max = 0 for i in self.timeLines: if max<len(self.lrcLines[i]): max=len(self.lrcLines[i]) mlabel=i for i in self.timeLines: self.labels[i]=gtk.Label(self.lrcLines[i].strip()) self.labels[i].modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse('white')) self.vbox2.pack_start(self.labels[i]) (x,y) = self.labels[mlabel].get_layout().get_pixel_size() self.window.resize(x+40, y*16) self.vbox2.show_all() self.timeSeek()
def lrcList(self, *arg): searchlist = chooser.lrcSearchWin() result = searchlist.run(self.exaile.player.current.get_tag_display('artist'), self.exaile.player.current.get_tag_display('title')) if result: self.lyric = result art = self.exaile.player.current.get_tag_display('artist') tit = self.exaile.player.current.get_tag_display('title') try: locname = os.path.basename(self.exaile.player.current.local_file_name()) except AttributeError: locname = '-'.join([art, tit]) lrcMod.saveLrc(self.lyric,self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname)) (self.lrcLines,self.timeLines) = lrcMod.lrcAny(self.lyric) self.timeChange = 0 try: for i in self.labels.keys(): self.labels[i].destroy() except: pass self.labels={} max = 0 for i in self.timeLines: if max<len(self.lrcLines[i]): max=len(self.lrcLines[i]) mlabel=i for i in self.timeLines: self.labels[i]=gtk.Label(self.lrcLines[i].strip()) self.labels[i].modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse('white')) self.vbox2.pack_start(self.labels[i]) (x,y) = self.labels[mlabel].get_layout().get_pixel_size() self.window.resize(x+40, y*16) self.vbox2.show_all() self.timeSeek()
def SaveChange(self, *args): if self.timeChange <> 0: lrc = lrcMod.writeLrc(self.lrcLines,self.timeLines,self.timeChange) art = self.exaile.player.current.get_tag_display('artist') tit = self.exaile.player.current.get_tag_display('title') locname = self.exaile.player.current.local_file_name() lrcMod.saveLrc(lrc,self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname))
def SaveChange(self, *args): if self.timeChange <> 0: lrc = lrcMod.writeLrc(self.lrcLines,self.timeLines,self.timeChange) art = self.exaile.player.current.get_tag_display('artist') tit = self.exaile.player.current.get_tag_display('title') try: locname = os.path.basename(self.exaile.player.current.local_file_name()) except AttributeError: locname = '-'.join([art, tit]) lrcMod.saveLrc(lrc,self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname))
def lrcList(self,*args): searchlist = chooser.lrcSearchWin() result = searchlist.run(self.exaile.player.current.get_tag_display('artist'), self.exaile.player.current.get_tag_display('title')) if result: self.lyric = result art = self.exaile.player.current.get_tag_display('artist') tit = self.exaile.player.current.get_tag_display('title') locname = os.path.basename(self.exaile.player.current.local_file_name()) lrcMod.saveLrc(self.lyric,self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname)) (self.lrcLines,self.timeLines) = lrcMod.lrcAny(self.lyric) self.text = '\n'.join([self.lrcLines[i] for i in self.timeLines]) self.LyricBuffer.set_text(self.text) self.timeChange = 0 self.timeSeek()
def SaveChange(self, *args): if self.timeChange <> 0: lrc = lrcMod.writeLrc(self.lrcLines, self.timeLines, self.timeChange) art = self.exaile.player.current.get_tag_display('artist') tit = self.exaile.player.current.get_tag_display('title') try: locname = os.path.basename( self.exaile.player.current.local_file_name()) except AttributeError: locname = '-'.join([art, tit]) lrcMod.saveLrc( lrc, self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname))
def lrcSearch(self, art, tit, locname): if not lrcMod.ifLrcExist(self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname)): try: self.lyric = lrcMod.lrcGet(art, tit, 'TT') if self.lyric: self.isLrcFound = True lrcMod.saveLrc(self.lyric, self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname)) except: pass else: self.lyric = lrcMod.readLrc(self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname)) self.isLrcFound = True if self.isLrcFound ==True: (self.lrcLines,self.timeLines) = lrcMod.lrcAny(self.lyric)
def lrcList(self, *args): searchlist = chooser.lrcSearchWin() result = searchlist.run( self.exaile.player.current.get_tag_display('artist'), self.exaile.player.current.get_tag_display('title')) if result: self.lyric = result art = self.exaile.player.current.get_tag_display('artist') tit = self.exaile.player.current.get_tag_display('title') locname = os.path.basename( self.exaile.player.current.local_file_name()) lrcMod.saveLrc( self.lyric, self.options['LyricFolder'], self.ops[self.options['Filename']](art, tit, locname)) (self.lrcLines, self.timeLines) = lrcMod.lrcAny(self.lyric) self.text = '\n'.join([self.lrcLines[i] for i in self.timeLines]) self.LyricBuffer.set_text(self.text) self.timeChange = 0 self.timeSeek()