2 midi-stream.cc -- implement Midi_stream
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "paper-stream.hh"
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
;
24 os_p_
= open_file_stream (filename
, ios::out
|ios::bin
);
26 os_p_
= open_file_stream (filename
, ios::out
|ios::binary
);
30 Midi_stream::~Midi_stream ()
32 close_file_stream (os_p_
);
36 Midi_stream::operator << (String str
)
43 Midi_stream::operator << (Midi_item
const& midi_c_r
)
45 String str
= midi_c_r
.str ();
48 if (midi_debug_global_b
)
50 str
= String_convert::bin2hex_str (str
) + "\n";
51 // ugh, should have separate debugging output with Midi*::print routines
52 int i
= str
.index_i ("0a");
57 i
= str
.index_i ("0a");
66 Midi_stream::operator << (int i
)
68 // output binary string ourselves
69 *this << Midi_item::i2varint_str (i
);