lilypond-1.2.0
[lilypond.git] / hdr / my-midi-parser.hh
blobd199bc1c4ec3decfc0011fcb4dfe76228815309b
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();
19 void add_score( Midi_score* midi_score_p );
20 void error( char const* sz_l );
21 int parse();
22 void forward( int i );
23 Moment mom();
24 void note_begin( int channel_i, int pitch_i, int dyn_i );
25 Midi_event* note_end_midi_event_p( int channel_i, int pitch_i, int dyn_i );
26 int output_mudela( String filename_str );
27 void reset();
28 void set_division_4( int division_4_i );
29 void set_key( int accidentals_i, int minor_i );
30 void set_tempo( int useconds_i );
31 void set_time( int num_i, int den_i, int clocks_i, int count_32_i );
33 private:
34 Int64 now_i64_; // 31 bits yields tipically about 1000 bars
36 static int const CHANNELS_i = 16;
37 static int const PITCHES_i = 128;
38 Int64 running_i64_i64_a_[ CHANNELS_i ][ PITCHES_i ];
40 Midi_score* midi_score_p_;
41 int division_1_i_;
42 Midi_key* midi_key_p_;
43 Midi_tempo* midi_tempo_p_;
44 Midi_time* midi_time_p_;
46 char const* defined_ch_c_l_;
47 int fatal_error_i_;
48 My_midi_lexer* midi_lexer_p_;
51 extern My_midi_parser* midi_parser_l_g;
53 #endif // MY_MIDI_PARSER_HH