2 midi-stream.cc -- implement Midi_stream
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
12 #include "string-convert.hh"
15 #include "midi-item.hh"
16 #include "midi-stream.hh"
18 #include "scm-option.hh"
20 Midi_stream::Midi_stream (String filename)
22 filename_str_ = filename;
23 os_p_ = open_file_stream (filename, std::ios::out|std::ios::binary);
26 Midi_stream::~Midi_stream ()
28 close_file_stream (os_p_);
32 Midi_stream::operator << (String str)
34 Byte * b = str.byte_l();
35 for (int sz = str.length_i (); sz--;)
41 Midi_stream::operator << (Midi_item const& midi_c_r)
43 String str = midi_c_r.str ();
46 if (midi_debug_global_b)
48 str = String_convert::bin2hex_str (str) + "\n";
49 // ugh, should have separate debugging output with Midi*::print routines
50 int i = str.index_i ("0a");
55 i = str.index_i ("0a");
60 Byte * b = str.byte_l();
61 for (int sz = str.length_i (); sz--;)
69 Midi_stream::operator << (int i)
71 // output binary string ourselves
72 *this << Midi_item::i2varint_str (i);