Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
 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()
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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()