encodage des caractères : minwii semble être content avec du iso-8859-1
authorpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Tue, 9 Feb 2010 15:11:26 +0000 (15:11 +0000)
committerpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Tue, 9 Feb 2010 15:11:26 +0000 (15:11 +0000)
git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@20 fe552daf-6dbe-4428-90eb-1537e0879342

src/gui/PGUConfiguration.py
src/gui/SongPlayingScreen.py
src/songs/musicxmltosong.py

index 5e9f7e7..12330ba 100644 (file)
@@ -111,7 +111,7 @@ class PGUConfiguration(pguGui.Desktop):
                     else :\r
                         label = self.createLabel(key)\r
                 elif self.file.endswith('.xml') :\r
-                    self.song = musicXml2Song(self.file, printNotes=True)\r
+                    self.song = musicXml2Song(self.file, printNotes=False)\r
                     filename = os.path.basename(self.file)\r
                     label = self.createLabel(filename) \r
                 self.browseButton = pguGui.Button(label)\r
index 5ddd67a..a64adb6 100644 (file)
@@ -728,7 +728,7 @@ class SongPlayingScreen:
         note, lyricIndex = self.songIterator.next()\r
         self.highlightedNote = note.column\r
         self.highlightedNoteNumber = note.midi\r
-        self.syllabus = str(note.lyrics[lyricIndex])\r
+        self.syllabus = note.lyrics[lyricIndex].syllabus('iso-8859-1')\r
         self.nextCascadeLockLengthMultiplier = note.duration\r
         self.midiNoteNumbers[self.highlightedNote] = self.highlightedNoteNumber\r
         \r
index eb5d5c3..d24d81a 100755 (executable)
@@ -110,7 +110,7 @@ class Part(object) :
     
     def iterNotes(self) :
         "exécution de la chanson avec l'alternance couplets / refrains"
-        for verse in self.verses :
+        for verse in cycle(self.verses) :
             print "---partie---"
             repeats = len(verse[0].lyrics)
             if repeats > 1 :
@@ -257,9 +257,12 @@ class Lyric(object) :
         self.syllabic = _getNodeValue(node, 'syllabic', 'single')
         self.text = _getNodeValue(node, 'text')
     
-    def __str__(self) :
+    def syllabus(self, encoding='utf-8'):
         text = self._syllabicModifiers[self.syllabic] % self.text
-        return text.encode('utf-8')
+        return text.encode(encoding)
+    
+    def __str__(self) :
+        return self.syllabus()
     __repr__  = __str__