-Midi_track::Midi_track ()
- : Midi_chunk ()
-{
- // 4D 54 72 6B MTrk
- // 00 00 00 3B chunk length (59)
- // 00 FF 58 04 04 02 18 08 time signature
- // 00 FF 51 03 07 A1 20 tempo
-
- // FF 59 02 sf mi Key Signature
- // sf = -7: 7 flats
- // sf = -1: 1 flat
- // sf = 0: key of C
- // sf = 1: 1 sharp
- // sf = 7: 7 sharps
- // mi = 0: major key
- // mi = 1: minor key
-
- number_ = 0;
-
- char const *data_str0 = ""
- // "00" "ff58" "0404" "0218" "08"
- // "00" "ff51" "0307" "a120"
- // why a key at all, in midi?
- // key: C
- // "00" "ff59" "02" "00" "00"
- // key: F (scsii-menuetto)
- // "00" "ff59" "02" "ff" "00"
- ;
-
- std::string data_string;
- // only for format 0 (currently using format 1)?
- data_string += String_convert::hex2bin (data_str0);
-
- char const *footer_str0 = "00" "ff2f" "00";
- std::string footer_string = String_convert::hex2bin (footer_str0);
-
- set ("MTrk", data_string, footer_string);
-}
-
-void
-Midi_track::add (Moment delta_time_mom, Midi_item *midi)
-{
- assert (delta_time_mom >= Moment (0));
-
- Midi_event *e = new Midi_event (delta_time_mom, midi);
- event_p_list_.append (new Killing_cons<Midi_event> (e, 0));
-}
-
-std::string
-Midi_track::data_string () const
-{
- std::string str = Midi_chunk::data_string ();
- if (do_midi_debugging_global)
- str += "\n";
- for (Cons<Midi_event> *i = event_p_list_.head_; i; i = i->next_)
- {
- str += i->car_->to_string ();
- if (do_midi_debugging_global)
- str += "\n";
- }
- return str;
-}
-
-