def log_NOTEEND(e):
return ''
def log_NOTEEND(e):
return ''
+
+def log_SONGEND(e) :
+ return ''
def log_COLSTATECHANGE(e):
col = e.column
def log_COLSTATECHANGE(e):
col = e.column
'COLDOWN',
'COLUP',
'COLOVER',
'COLDOWN',
'COLUP',
'COLOVER',
+ 'COLSTATECHANGE',
+ 'SONGEND']
eventNames = {}
self = modules[__name__]
for i, name in enumerate(events) :
eventType = pygame.USEREVENT + 1 + i
eventNames = {}
self = modules[__name__]
for i, name in enumerate(events) :
eventType = pygame.USEREVENT + 1 + i
+ if eventType >= pygame.NUMEVENTS :
+ eventType = eventType + 1
eventNames[eventType] = name
setattr(self, name, eventType)
eventNames[eventType] = name
setattr(self, name, eventType)
- def iterNotes(self, indefinitely=True) :
"exécution de la chanson avec l'alternance couplets / refrains"
"exécution de la chanson avec l'alternance couplets / refrains"
- if indefinitely == False :
- iterable = self.verses
- else :
- iterable = cycle(self.verses)
- for verse in iterable :
+ for verse in self.verses :
if self.songStartsWithChorus :
for note in self.chorus :
yield note, 0
if self.songStartsWithChorus :
for note in self.chorus :
yield note, 0
import types
import minwii.events as events
import types
import minwii.events as events
+from minwii.log import eventLogger
from minwii.eventutils import event_handler, EventDispatcher, EventHandlerMixin
from minwii.musicxml import Tone
from minwii.config import FRAMERATE
from minwii.eventutils import event_handler, EventDispatcher, EventHandlerMixin
from minwii.musicxml import Tone
from minwii.config import FRAMERATE
def displayNext(self, event=None) :
if self.currentColumn:
self.currentColumn.update(False)
def displayNext(self, event=None) :
if self.currentColumn:
self.currentColumn.update(False)
- note, verseIndex = self.noteIterator.next()
+ try :
+ note, verseIndex = self.noteIterator.next()
+ except StopIteration :
+ self.noteIterator = self.song.iterNotes()
+ note, verseIndex = self.noteIterator.next()
+ eventLogger.info(pygame.event.Event(events.SONGEND))
try :
syllabus = note.lyrics[verseIndex].syllabus()
except IndexError :
syllabus = u'…'
try :
syllabus = note.lyrics[verseIndex].syllabus()
except IndexError :
syllabus = u'…'
column = self.columns[note.midi]
column.update(True, syllabus)
self.currentColumn = column
column = self.columns[note.midi]
column.update(True, syllabus)
self.currentColumn = column