\r
<pydev_project>\r
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">\r
-<path>/MINWiiV7/src</path>\r
+<path>/MINWii-pinbe/src</path>\r
</pydev_pathproperty>\r
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>\r
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>\r
-#Mon Dec 07 03:31:40 CET 2009\r
+#Mon Feb 08 10:43:31 CET 2010\r
eclipse.preferences.version=1\r
+encoding//src/gui/MINWiiDialog.py=utf-8\r
encoding//src/mxmMidi/DataTypeConverters.py=ISO-8859-1\r
encoding//src/mxmMidi/EventDispatcher.py=ISO-8859-1\r
encoding//src/mxmMidi/MidiFileParser.py=ISO-8859-1\r
encoding//src/mxmMidi/RawOutstreamFile.py=ISO-8859-1\r
encoding//src/mxmMidi/__init__.py=ISO-8859-1\r
encoding//src/mxmMidi/constants.py=ISO-8859-1\r
+encoding//src/songs/musicxmltosong.py=utf-8\r
+# -*- coding: utf-8 -*-\r
'''\r
Created on 17 dec. 2009\r
\r
else :\r
label = pguGui.basic.Label(key,font = self.customFont)\r
self.list.add(label,value=i)\r
+ elif i.endswith(".xml") :\r
+ # TODO : afficher le Titre de la chanson au lieu du nom\r
+ # de fichier\r
+ label = pguGui.basic.Label(i, font=self.customFont)\r
+ self.list.add(label,value=i)\r
#self.list.resize()\r
self.list.set_vertical_scroll(0)\r
#self.list.repaintall()\r
from controllers.Wiimote import Wiimote\r
from logging.Log import Log\r
from songs.Song import Song,loadSong\r
+from songs.musicxmltosong import musicXml2Song\r
from constants import *\r
from MINWiiDialog import MINWiiDialog\r
\r
if dlg.value:\r
if os.path.isfile(dlg.value):\r
self.file = dlg.value\r
- self.song = loadSong(self.file)\r
- key = os.path.basename(self.file)[:-5]\r
- if key in reversedReadabilityDict : \r
- label = self.createLabel(reversedReadabilityDict[key])\r
- else :\r
- label = self.createLabel(key)\r
+ if self.file.endswith('.smwi') :\r
+ self.song = loadSong(self.file)\r
+ key = os.path.basename(self.file)[:-5]\r
+ if key in reversedReadabilityDict : \r
+ label = self.createLabel(reversedReadabilityDict[key])\r
+ else :\r
+ label = self.createLabel(key)\r
+ elif self.file.endswith('.xml') :\r
+ self.song = musicXml2Song(self.file, printNotes=True)\r
+ filename = os.path.basename(self.file)\r
+ label = self.createLabel(filename) \r
self.browseButton = pguGui.Button(label)\r
self.browseButton.connect(pguGui.CLICK, self.open_file_browser, None)\r
if not self.songSwitch.value :\r
self.mainTable.clear()\r
self.fillMainTable()\r
\r
+ \r
def fillMainTable(self):\r
\r
self.mainTable.tr()\r
from types import StringTypes
from xml.dom.minidom import parse
from optparse import OptionParser
-from Song import Song
+#from Song import Song
# Do4 <=> midi 60
OCTAVE_REF = 4
else :
return default
-def musicXml2Song(input, output, partIndex=0, printNotes=False) :
+def musicXml2Song(input, partIndex=0, printNotes=False) :
if isinstance(input, StringTypes) :
input = open(input, 'r')
if printNotes :
part.pprint()
+
+ return part
+
# divisions de la noire
# divisions = 0
options, args = op.parse_args()
- if len(args) != 2 :
+ if len(args) != 1 :
raise SystemExit(op.format_help())
- musicXml2Song(args[0], args[1], partIndex=options.partIndex, printNotes=options.printNotes)
+ musicXml2Song(args[0], partIndex=options.partIndex, printNotes=options.printNotes)