summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a0e0b03)
from synth import Synth
from musicxml import musicXml2Song
import pygame
from synth import Synth
from musicxml import musicXml2Song
import pygame
+from backwardsfilereader import BackwardsReader
SUPPORTED_FILE_HEADER = 'ENV winwii log format version : 1.0'
SUPPORTED_FILE_HEADER = 'ENV winwii log format version : 1.0'
firstTicks = int(l.split(None, 2)[1])
return firstTicks
firstTicks = int(l.split(None, 2)[1])
return firstTicks
+ @inplaceread
+ def getLastEventTicks(self) :
+ "retourne le timecode du dernier événement (entier)"
+ for l in self.getBackwardLineIterator() :
+ if l.startswith('EVT ') :
+ break
+
+ lastTicks = int(l.split(None, 2)[1])
+ return lastTicks
+
def __del__(self) :
self.logfile.close()
def __del__(self) :
self.logfile.close()
ticks, eventName = l.split(None, 3)[1:]
ticks = int(ticks)
yield ticks, eventName, ''
ticks, eventName = l.split(None, 3)[1:]
ticks = int(ticks)
yield ticks, eventName, ''
+
+ def getBackwardLineIterator(self) :
+ br = BackwardsReader(self.logfile, BLKSIZE=128)
+ line = br.readline()
+ while line :
+ yield line.strip()
+ line = br.readline()
+
class LogFilePlayer(PlayingScreenBase) :
class LogFilePlayer(PlayingScreenBase) :