2 midi-parser.cc -- implement
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
10 #include "string-convert.hh"
11 #include "source-file.hh"
12 #include "mi2mu-global.hh"
13 #include "midi-parser.hh"
15 Midi_parser_info::Midi_parser_info ()
25 Midi_parser::Midi_parser ()
31 Midi_parser::exit (String str)
39 Midi_parser::error (String str)
41 ::message (message (str));
45 Midi_parser::get_i (int n)
47 assert (n <= (int)sizeof(int));
48 return String_convert::bin2_i (get_str (n));
52 Midi_parser::get_u (int n)
54 assert (n <= (int)sizeof(int));
55 return String_convert::bin2_i (get_str (n));
59 Midi_parser::get_str (int n)
62 Byte const* p = forward_byte_L (n);
67 Midi_parser::get_var_i ()
73 Byte byte = next_byte ();
84 Midi_parser::message (String str)
86 return String ("mi2mu: ")
87 + info_l_->source_l_->name_str () + ": "
88 + String_convert::i2dec_str (info_l_->source_l_->line_i ((char const*)info_l_->byte_L_), 0, 0) + ": "
90 + info_l_->source_l_->error_str ((char const*)info_l_->byte_L_);
94 Midi_parser::warning (String str)
96 ::message (message (String ("warning: ") + str));