]> git.donarmstrong.com Git - lilypond.git/commitdiff
partial: 0.0.34.hanjan
authorHan-Wen Nienhuys & Jan Nieuwenhuizen <hanjan@lilypond.org>
Mon, 24 Feb 1997 09:48:04 +0000 (10:48 +0100)
committerHan-Wen Nienhuys & Jan Nieuwenhuizen <hanjan@lilypond.org>
Mon, 24 Feb 1997 09:48:04 +0000 (10:48 +0100)
src/inputfile.cc [new file with mode: 0644]
src/midioutput.cc [new file with mode: 0644]

diff --git a/src/inputfile.cc b/src/inputfile.cc
new file mode 100644 (file)
index 0000000..7faefd2
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+  inputfile.cc -- implement Input_file
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl> Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#include <iostream.h>
+#include <strstream.h>
+#include "proto.hh"
+#include "plist.hh"
+#include "inputfile.hh"
+#include "debug.hh"
+#include "sourcefile.hh"
+#include "source.hh"
+
+Input_file::Input_file(String s)
+{
+       name = s;
+       line = 1;
+       String pf(s);
+       if ( pf == "" ) {
+               is = &cin;
+               defined_ch_c_l_ = 0;
+               sourcefile_l_ = 0;
+       }
+       else {
+               Source_file* sourcefile_p = new Source_file( pf );
+               source_l_g->add( sourcefile_p );
+               sourcefile_l_ = sourcefile_p;
+               is = sourcefile_l_->istream_l();
+               defined_ch_c_l_ = sourcefile_l_->ch_c_l();
+       }
+       cout << "[" << pf << flush;
+}
+
+Input_file::~Input_file()
+{
+       cout << "]" << flush;  
+}
diff --git a/src/midioutput.cc b/src/midioutput.cc
new file mode 100644 (file)
index 0000000..b17486e
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+  midioutput.cc -- implement Midi_output
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>, Jan Nieuwehuizen <jan@digicash.com> 
+*/
+#include "plist.hh"
+#include "debug.hh"
+#include "score.hh"
+#include "staff.hh"
+#include "midistream.hh"
+#include "mididef.hh"
+#include "midioutput.hh"
+#include "midiwalker.hh"
+#include "midiitem.hh"
+#include "stcol.hh"
+#include "musicalrequest.hh"
+
+
+Midi_output:: Midi_output(Score* score_l, Midi_def* midi_l )
+{
+    Midi_stream midi_stream(midi_l->outfile_str_,
+                           score_l->staffs_.size(),
+                           midi_l->get_tempo_i(Moment(1, 4)));
+
+    midi_stream_l_ = &midi_stream;
+    int track_i=0;
+
+    for (iter_top(score_l->staffs_,i); i.ok(); i++) {
+       do_staff(i, track_i++);
+    }
+
+}
+
+void
+Midi_output::do_staff(Staff*st_l,int track_i)
+{
+    Midi_track midi_track( track_i );
+    for (Midi_walker w (st_l, &midi_track); w.ok(); w++)
+       w.process_requests();
+
+    *midi_stream_l_  << midi_track;
+}