lilypond-1.3.122
[lilypond.git] / m2m / include / my-midi-parser.hh
blob6faf128a89d3762d7401c45e697cbe88dafee6f5
1 //
2 // my-midi-parser.hh -- declare My_midi_parser
3 //
4 // copyright 1997 Jan Nieuwenhuizen <jan@digicash.com>
6 #ifndef MY_MIDI_PARSER_HH
7 #define MY_MIDI_PARSER_HH
9 // #include "proto.hh"
10 // #include "string.hh"
12 int yyparse();
14 /// (midi_parser)
15 class My_midi_parser {
16 public:
17 My_midi_parser( String filename_str );
18 ~My_midi_parser();
20 void add_score( Midi_score* midi_score_p );
21 void error( char const* sz_l );
22 int parse();
23 void forward( int i );
24 Moment mom();
25 void note_begin( int channel_i, int pitch_i, int dyn_i );
26 Midi_event* note_end_midi_event_p( int channel_i, int pitch_i, int dyn_i );
27 int output_mudela( String filename_str );
28 void reset();
29 void set_division_4( int division_4_i );
30 void set_key( int accidentals_i, int minor_i );
31 void set_tempo( int useconds_i );
32 void set_time( int num_i, int den_i, int clocks_i, int count_32_i );
34 int track_i_;
35 String filename_str_;
36 String copyright_str_;
37 String instrument_str_;
38 String track_name_str_;
40 Midi_key* midi_key_p_;
41 Midi_tempo* midi_tempo_p_;
42 Midi_time* midi_time_p_;
44 private:
45 Int64 now_i64_; // 31 bits yields tipically about 1000 bars
47 static int const CHANNELS_i = 16;
48 static int const PITCHES_i = 128;
49 Int64 running_i64_i64_a_[ CHANNELS_i ][ PITCHES_i ];
51 Midi_score* midi_score_p_;
52 int division_1_i_;
54 char const* defined_ch_c_l_;
55 int fatal_error_i_;
56 My_midi_lexer* midi_lexer_p_;
59 extern My_midi_parser* midi_parser_l_g;
61 #endif // MY_MIDI_PARSER_HH