Remove Timer from transitions not needed

Add Code to use the Verse Order to expand songs
This commit is contained in:
Tim Bentley 2009-11-29 21:03:24 +00:00
parent a4b3bee98e
commit 939909fdd8
3 changed files with 19 additions and 8 deletions

View File

@ -198,13 +198,10 @@ class MainDisplay(DisplayWidget):
elif not self.displayBlank:
if transition:
if self.hasTransition:
delay = 0.01
self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame[u'trans']))
self.repaint()
time.sleep(delay)
self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'trans']))
self.repaint()
time.sleep(delay)
self.hasTransition = True
self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
self.repaint()

View File

@ -226,7 +226,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
verses = self.song.lyrics.split(u'\n\n')
for count, verse in enumerate(verses):
item = QtGui.QListWidgetItem(verse)
variant = u'Verse:%s' % count + 1
variant = u'Verse:%s' % unicode(count + 1)
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant))
self.VerseListWidget.addItem(item)
# clear the results

View File

@ -293,10 +293,24 @@ class SongMediaItem(MediaManagerItem):
if song.lyrics.startswith(u'<?xml version='):
songXML = SongXMLParser(song.lyrics)
verseList = songXML.get_verses()
for verse in verseList:
if verse[1]:
verseTag = u'%s:%s' % (verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text(verse[1][:30], verse[1], verseTag)
for order in service_item.verse_order:
for verse in verseList:
if verse[1]:
#Check for verses and expand all verses
if order.isdigit():
if verse[0][u'type'] == "Verse" and \
verse[0][u'label'].find(order) > -1:
verseTag = u'%s:%s' % \
(verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text\
(verse[1][:30], verse[1], verseTag)
else:
if verse[0][u'type'].find(order) > -1:
verseTag = u'%s:%s' % \
(verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text\
(verse[1][:30], verse[1], verseTag)
else:
verses = song.lyrics.split(u'\n\n')
for slide in verses: