1 # -*- coding: utf-8 -*-
3 import book_base as BookBase
4 import book_texinfo as BookTexinfo
5 import book_snippets as BookSnippet
8 MusicXMLOutputImage = r'''@noindent
10 @image{%(info_image_path)s,,,%(alt)s,%(ext)s}
14 <a href="%(base)s%(ext)s">
15 <img align="middle" border="0" src="%(image)s" alt="%(alt)s">
23 @include %(base)s-systems.texi
27 MusicXMLPrintFilename = r'''
29 <a href="%(base)s%(ext)s">
40 class BookMusicXML (BookTexinfo.BookTexinfoOutputFormat):
42 BookTexinfo.BookTexinfoOutputFormat.__init__ (self)
43 self.format = "MusicXMLTest"
44 self.output[BookBase.OUTPUTIMAGE] = MusicXMLOutputImage
45 self.output[BookBase.OUTPUT] = MusicXMLOutput
46 self.output[BookBase.PRINTFILENAME] = MusicXMLPrintFilename
47 def snippet_class (self, type):
48 if type == "musicxml_file":
49 return MusicXMLTestSuiteSnippet
51 return BookSnippet.snippet_type_to_class.get (type, BookSnippet.Snippet)
52 def snippet_output (self, basename, snippet):
53 return BookTexinfo.BookTexinfoOutputFormat.snippet_output (self, basename, snippet)
56 class MusicXMLTestSuiteSnippet (BookSnippet.MusicXMLFileSnippet):
57 def __init__ (self, type, match, formatter, line_number, global_options):
58 BookSnippet.MusicXMLFileSnippet.__init__ (self, type, match, formatter, line_number, global_options)
60 ## TODO: Customize output with renderings from other MusicXML-supporting
61 # applications. Also add some link to the intermediate .ly file
64 BookBase.register_format (BookMusicXML ());